3 ms·
This is more of a political statement than a proper library. More to demonstrate the flexibility of Python given I was able to so easily do this.
by astrea 3y ago
This is more of a political statement than a proper library. More to demonstrate the flexibility of Python given I was able to so easily do this.
- nicwolff 3y agoCould have been even easier: `argparse.Namespace` already has `__contains__()` ツ That said, https://pypi.org/project/addict/ https://pypi.org/project/addict/ has been around a long time...
- astrea 3y agoThat contains doesn’t permit the behavior, though. It would give you an AttributeError if you attempted this. Yes, addict seems to be exactly what I was going for.
- Waterluvian 3y agoI enjoy how much complete control Python enables. It’s fun to turn it into what resembles a different language. I want to make a library where you never ever call functions with fn() notation. But just utilize accessors and absolutely bastardize dicts.
- richbell 3y agoMy favorite example of this: https://old.reddit.com/r/learnprogramming/comments/kegalv/my_first_python_script_coming_from_c_feedback/ https://old.reddit.com/r/learnprogramming/comments/kegalv/my...
- Waterluvian 3y agoThis is horrifying and yet I can’t look away.
- necovek 3y agoWow, great job by this "beginner" just "learning a language"! Demonstrates knowledge of so many of Python intricacies that it's worth starting a Non-obfuscated Obfuscated Python Code Contest :)
- bee_rider 3y agoThat is a work of art, and also you have to appreciate the author’s commitment to the bit.
- richbell 3y agoI feel bad that no one seemed to get the joke. At the same time, that makes the whole thing funnier.