3 ms·
0_0 # Python >= 3.6 is required (https://github.com/jwilk/abmagick/blob/8959fe7c390283d095e4288a4e10c615cd08698c/abmagick#L12 https://github.com/jwilk/abmagic
by PhilipTrauner 4y ago
0_0 # Python >= 3.6 is required
(https://github.com/jwilk/abmagick/blob/8959fe7c390283d095e4288a4e10c615cd08698c/abmagick#L12 https://github.com/jwilk/abmagick/blob/8959fe7c390283d095e42...)
Highly cursed, yet wildly creative way of asserting the language version.
Support for underscores in numeric literals landed in 3.6 (PEP-515), < 3.6 chokes on the underscore and raises a syntax error instead.
- jwilk 4y agoSee https://github.com/jwilk/python-syntax-errors https://github.com/jwilk/python-syntax-errors if you need curses for other Python versions.
- PhilipTrauner 4y agoCan't help but feel that this approach might not be that cursed after all, seeing how you actually went through the effort of automatically testing all of these. Nothing beats this guy though: 0_0
- deleted 4y ago[deleted]
- saghm 4y agoThe first time I read this, I thought you were making a wide-eyed emoticon about the fact that it requires Python 3.6
- metadat 4y agoSee also related: "What the fuck Python?" https://github.com/satwikkansal/wtfpython https://github.com/satwikkansal/wtfpython Along with the corresponding HN discussion: https://news.ycombinator.com/item?id=31566031 https://news.ycombinator.com/item?id=31566031 (450 points, 153 comments)