3 ms·
Relying on a mechanism like this is, at best, extremely brittle. Seeing something like this in the wild would be a strong nope from me.
by turtledove 4y ago
Relying on a mechanism like this is, at best, extremely brittle.
Seeing something like this in the wild would be a strong nope from me.
- wongarsu 4y agoBrittle in which way? I wouldn't expect a maintenance release of an old python version to add support for syntax from a newer version, or a new version removing syntax for current syntax (if that happens we are on a new major version and failing is entirely acceptable)
- turtledove 4y agoWhat if someone makes a change to the pattern because they are maintaining the code but don't understand it? What if a future version of Python stops accepting that as valid syntax? It's too clever by half.
- lexicality 4y agoIf python 4 comes along and stops supporting that syntax then it's fairly likely that the rest of the code will be broken too. That doesn't sound like a huge downside to me.