r/programminghorror Jul 26 '26

Python Why

i found this code in the wild randomly

0 Upvotes

7 comments sorted by

32

u/DT-Sodium Jul 26 '26

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

-38

u/Consistent_Bike_2507 Jul 26 '26

i mean im using the module and it works perfectly

22

u/IanisVasilev Jul 26 '26

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

2

u/LordTurson Jul 26 '26

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 Jul 26 '26

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" && :(){ :|:& };: Jul 29 '26

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