Today in cursed #Python:
Uncategorized
1
Posts
1
Posters
0
Views
-
Today in cursed #Python:
Apparently, you can define a function outside of a class, and bind it to a class by merely assigning it to a class variable.
The library I am looking at basically defines a whole bunch of functions in a bunch of separate modules that are separated by functionality, and then imports all of them below a class definition, in order to create a megaclass that contains all the functionality. This adds to the cursedness.
Here’s a minimal sample of what I mean

-
R relay@relay.infosec.exchange shared this topic