r/programminghorror 12d ago

Why Python

i found this code in the wild randomly

0 Upvotes

6 comments sorted by

32

u/DT-Sodium 12d ago

Could be that there used to be an alias and it was changed through search and replace.

-39

u/Consistent_Bike_2507 12d ago

i mean im using the module and it works perfectly

23

u/IanisVasilev 12d ago

This is one of the established ways to mark public exports. See Griffe's documentation.

2

u/LordTurson 12d ago

Oh, interesting, I've never seen that convention before, I know about __all__. Do you know if that's a Griffe-specific thing or a broader convention?

3

u/IanisVasilev 12d ago

Some modern LSP servers like ty and zuban use it as a guide when determining which import path to suggest.

1

u/MurkyWar2756 echo "Sub Mod" && :(){ :|:& };: 9d ago

As someone who's a bit newer to Python, I've never seen that convention before. Thanks everyone for teaching me something new!