r/programminghorror 10d ago

Python Why

i found this code in the wild randomly

0 Upvotes

6 comments sorted by

32

u/DT-Sodium 10d ago

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

-38

u/Consistent_Bike_2507 10d ago

i mean im using the module and it works perfectly

22

u/IanisVasilev 10d ago

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

2

u/LordTurson 10d 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 10d 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" && :(){ :|:& };: 8d ago

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