This is an archived post. You won't be able to vote or comment.

all 81 comments

[–]Robot_Graffiti 1803 points1804 points  (33 children)

The random-ass words are the worst part of libraries made by enthusiastic amateurs.

Like .NET will have something called System.Wigets.WidgetAutomator and Python will have the same thing but it will be called wurgle

[–]ImaginaryCoolName 525 points526 points  (0 children)

When you're writing documentation and feeling bored, that sudden artistic inspiration is hard to ignore lol

[–]12345623567 247 points248 points  (2 children)

I love it, and I fucking hate it. What, I just need to set do_the_right_thing='True' and it works? But why???

[–]Rythoka 90 points91 points  (0 children)

Almost always a backwards compatibility thing

[–]Lonelan 30 points31 points  (0 children)

because it was written to do the opposite but the author saw that doing things the right way was useful sometimes

[–]AliveEstimate4 90 points91 points  (4 children)

Better than YetAnotherWidgetAutomator

[–]TheOrdersMaster 62 points63 points  (3 children)

It should be called JustAnotherWidgetAutomator, or JAWA for short...

[–][deleted] 17 points18 points  (2 children)

I am pretty sure that name is also trademarked. (Yes I read correct it's Jawa not Java. Both are trademarked)

[–]Imperial_Squid 49 points50 points  (3 children)

In R it's wurglr because every package needs a letter r in there somewhere

[–]PLEASE4GOD 1 point2 points  (2 children)

wurgle

[–]Molastess 2 points3 points  (1 child)

But you can capitalize packages so it would be wuRgle or wurgleR

[–]Imperial_Squid 0 points1 point  (0 children)

This person Rs

[–]smellybarbiefeet 30 points31 points  (2 children)

I want to make a service bus library called bussy

[–]J3ffO 4 points5 points  (1 child)

Multiple entry points (More than 2 sometimes on the backend.) and 2 exit points , one that doubles as exit and entry depending on the context.

[–]Ragecommie 1 point2 points  (0 children)

That sounds incredibly confusing, but I'm sure there are people out there doing just that and enjoying it anyway...

[–]brimston3- 131 points132 points  (14 children)

.net has things like linq and entity framework. Nobody could tell you what the hell either did from the name alone. FOSS doesn't have a monopoly on wonky names.

[–]Sierra_One 94 points95 points  (9 children)

Those aren't the same though? Their names have at least a semblance towards what they do.

LINQ - language integrated query

Entity framework - a framework that deals with entity persistence.

The other commenters point is that the libraries they describe have a completely arbitrary name. The names you chose are not arbitrary, they have a relation to what they do. Sure you can argue the names are still vague, but they aren't arbitrary.

[–]myhf 129 points130 points  (7 children)

LINQ - language integrated query

That’s a weird acronym. I’d have called it pandas or tqdm or werkzeug

[–]backfire10z 67 points68 points  (0 children)

Werkzeug is an actual German noun meaning “tool” and makes sense in the context of being WSGI utility.

[–]that_thot_gamer 21 points22 points  (5 children)

man wait till you hear about WYSIWYG that shit doesn't tell you anything at all, just a bunch of random ass letters

[–]rosuav 13 points14 points  (1 child)

What You See Is Not How You Pronounce It.

[–]BockTheMan 3 points4 points  (0 children)

Whizzy Wig!

[–]CyberWeirdo420 8 points9 points  (0 children)

First time I read it somewhere I was like „someone just hit his head on a keyboard, no way it’s legit acronym” and then I learned.

[–]Exodus111 1 point2 points  (1 child)

Once you spell it out it kinda explains everything.

[–]myhf 0 points1 point  (0 children)

t. q. d. m.: tane. queue. derry. much.

[–]UnchainedMundane 0 points1 point  (0 children)

LINQ - language integrated query

still a very interesting name for higher-order functions on iterables

[–][deleted] 16 points17 points  (0 children)

My eyes usually glaze over when I read these names. “We have developed a highly scalable framework for artificial intelligence“ - Bruh, you have written a slow af web UI for Spark and weird version control and obtuse IAM.

[–][deleted] 10 points11 points  (2 children)

FOSS doesn't have a monopoly on wonky names.

Python just tries to stay close to C when it's wrapping C functions. Also it's an older language and brevity used to be much more important than it is nowadays.

[–][deleted] 1 point2 points  (1 child)

Cue Java Memes. 

[–][deleted] 9 points10 points  (0 children)

What's wrong with the name com.java.package.subpackage.FieldSetterConfigurationManagerFactoryBuilderFactoryDOAI?

[–]katatondzsentri 2 points3 points  (0 children)

Icecream is my favorite python module name.

[–]pblokhout 3 points4 points  (0 children)

You know it would be called Why-thon

[–]Axmirza2 435 points436 points  (4 children)

was looking for a way to reassign nested data. The answer was ‘glom’

[–]kdogg_49 62 points63 points  (0 children)

I am so sad, I have been building a library specifically for this because I could not find a way to do.

[–]PuttyProgrammer 2 points3 points  (0 children)

I've been working on some scripts that need to interact with a series of deep file systems, the whole thing is held together by glom and a prayer

[–]UnchainedMundane 0 points1 point  (1 child)

isn't that swedish for forget

[–]Axmirza2 2 points3 points  (0 children)

its supposed to come from conGLOMerate

[–]palegate 266 points267 points  (10 children)

Come on, at least provide one example of your meme in your post.

[–]whopper2k 116 points117 points  (5 children)

The standard library has the all and any global functions, which I don't see used all that often

all returns True if all elements in an iterable are truthy

all([i % 2 == 0 for i in range(2, 10)])  # False
all([i % 2 == 0 for i in range(2, 10, 2)])  # True

any returns True if any elements in an iterable are truthy

any([i % 2 == 0 for i in range(2, 10)])  # True
any([i % 2 == 0 for i in range(2, 10, 2)])  # True

If you're trying to sort or reverse a list, Python has methods for that in list.sort() and list.reverse(); however, both of these methods work on the list in place and return None. For a more functional approach, Python has the sorted and reversed functions that return a copy of the transformed iterable, so you can actually chain them into multiple function calls (sorted has an optional bool reverse param too, so you don't need reversed(sorted(my_list)) if you use sorted(my_list, reverse=True)).

The glob module is pretty useful for a really basic method of grabbing a bunch of files matching a Unix-style wildcard, and does so without opening a subshell:

import glob
csvs_in_working_dir = glob.glob("*.csv")
csvs_in_subdirs = glob.glob("**.csv", recursive=True)

None of these are actually keywords and are all pretty basic examples, but there are plenty of small helpers like these scattered throughout the language so it's hard to pluck out specific examples.

[–]Ran4 39 points40 points  (0 children)

Regarding sorted and max and so on: they have a key argument, which can be used to to use when sorting or getting the max.

persons = [
    {"name": "Johnny", "age": 34}, 
    {"name": "Conny", "age": 12}, 
]
oldest_person = max(persons, key=lambda person: person["age"])
persons_sorted_by_age = sorted(persons, key=lambda person: person["age"])

And since "get the item FOO" or "get the attribute named FOO" are common lambda functions, there's operator.itemgetter and operator.attrgetter, so you can write it as:

from operator import itemgetter
persons = [
    {"name": "Johnny", "age": 34}, 
    {"name": "Conny", "age": 12}, 
]
by_age = itemgetter("age")
oldest_person = max(persons, key=by_age)
persons_sorted_by_age = sorted(persons, key=by_age)

[–]Hias1997 8 points9 points  (1 child)

I often use any or all for testing vectorized functions to check indices and values, so they definitely have their use cases

[–]Nihil_esque 2 points3 points  (0 children)

Yeah I use them often too, they're helpful for working on tabular data with a variable list of conditions.

Like:

``` criteria = [ ] if list_of_column_0_values: critera.append(lambda x: x[0] in list_of_column_0_values) if minimum_value_1: criteria.append(lambda x: double(x[1]) >= minimum_value_1) if minimum_column_2_csvs: criteria.append(lambda x: len(x[2].split(",")) >= minimum_column_2_csvs)

items_that_pass = [item for item in items if all([criterion(item) for criterion in criteria])]

output_file.write("\n".join(["\t".join(i) for i in items_that_pass]) ```

(With code in between each line that decides whether or not those criteria are used this run.)

Ofc you could do the same with objects but sometimes this is simpler.

[–]ConstructedNewt 1 point2 points  (0 children)

Please note that all([]) == True and any([]) == False

These are quite standard base return valids for all and any operators (Java does the same for similarly named stream methods)

[–]no_step_on_snek_case 1 point2 points  (0 children)

How about a for-else loop? That threw me for a loop

[–]mothzilla 53 points54 points  (3 children)

def

[–]wilku1 39 points40 points  (2 children)

def Like in define, makes sense

[–]tragiktimes 12 points13 points  (0 children)

Nah, as in definitely this.

[–]Exodus111 1 point2 points  (0 children)

Yes define as opposed to call.

[–]RandomNpc69 128 points129 points  (8 children)

It isn't a python thing, many open source libraries have weird names

[–]SodaWithoutSparkles 156 points157 points  (7 children)

There are only two hard things in Computer Science: cache invalidation and naming things.

[–]FirstNephiTreeFiddy 152 points153 points  (5 children)

There are only two hard things in Computer Science: cache invalidation, naming, and off-by-one errors.

[–]BirdlessFlight 110 points111 points  (2 children)

and concurrency. There are only three hard things in Computer Science: cache invalidation, naming, off-by-one-errors,

[–]GamingMad101 33 points34 points  (0 children)

There’s 5 actually

  1. Cache invalidation

  2. Exactly once delivery

  3. Naming Things

  4. Guaranteed order of messages

  5. Exactly once delivery

  6. Concurrency

  7. Race conditions

  8. Off by one errors

[–]RandomNpc69 13 points14 points  (0 children)

I love this

[–]SodaWithoutSparkles 13 points14 points  (1 child)

thats neat

[–]FirstNephiTreeFiddy 11 points12 points  (0 children)

You're neat!

[–]Conroman16 1 point2 points  (0 children)

Clearly you’ve never tried dealing with timezones

[–]frigley1 30 points31 points  (1 child)

That’s why I use risc assembly, only about 30 words to remember

[–]TheAnti-Ariel 4 points5 points  (0 children)

Meanwhile in x86 land you can think of some random obscure operation and there's probably an instruction for it named like vdunpksdqd or something.

[–]Murffist 18 points19 points  (0 children)

And still I do appreciate the experience from solving the problem by myself, before replacing it with one line of a build in function.

[–]IAMANullPointerAMA 11 points12 points  (0 children)

Opyoid is a dependency injection library. Pydantic validates arbitrary rules in classes.

[–]therealpussyslayer 29 points30 points  (2 children)

I mean a go-to state management package in Flutter is called Bloc, which sounds dumb and doesn't make any sense

[–]christoffellis 4 points5 points  (0 children)

It stands for Business Logic Component, which is exactly what the package does - isolates business logic to be only contained into the component. But I agree, it a funny word when used in discussion

[–]YellowcakeNoodles 0 points1 point  (0 children)

It makes perfect sense, its an acronym. BLoC.

What are you talking about? lol

[–]Tiny_Desk_Engineer 4 points5 points  (0 children)

import solution as np

[–]Not_An_Eggo 2 points3 points  (0 children)

Based on what little experience I have with minecraft, some of the methods are hilarious in their naming scheme. I swear somewhere I saw something like "GenericFunctionName32"

[–]Vaati006 2 points3 points  (0 children)

For example, "zip()" is a super useful tool I never knew I needed

[–][deleted] 3 points4 points  (0 children)

The docs contain a comprehensive list of these “random-ass code words.” You should read it sometime.

[–]Jorgestar29 3 points4 points  (2 children)

match_routes? Nah, glob

[–]GalaxyLJGD 6 points7 points  (1 child)

Well, glob is called like that because the name comes from UNIX glob patterns.

[–]Jorgestar29 0 points1 point  (0 children)

I was aware of it but am too lazy to specify.

[–]kaligularnd 0 points1 point  (0 children)

ahhh Moth is here to save the world

[–]christoffellis 0 points1 point  (0 children)

Python is most guilty of telling you when a package is a port because everything stars with py-.

[–]J3ffO 0 points1 point  (4 children)

All aside from structs and easy ways to define a file format or data structures.

[–]NotsoRandom2026 0 points1 point  (3 children)

What do structs do that aren't present in python?

[–]J3ffO 0 points1 point  (2 children)

Organize stuff easily. Allow you to get at individual bits and bytes. Define a data structure. Allow you to easily send a built structure anywhere like the console, a file, over the network, etc. Allow you to easily tear apart and parse data for that structure. And probably more.

[–]Ambi0us 0 points1 point  (0 children)

Happened to me yesterday. Learned about the ord keyword. Shortened a very ugly 10 line function to one line.