3 ms·
You're right; code could have used 'async = 1' before. Another technique is: try: import test_module except SyntaxError: ... except NameError:
by eesmith 7y ago
You're right; code could have used 'async = 1' before.
Another technique is:
try:
import test_module
except SyntaxError:
...
except NameError:
...
Nonetheless, my point wasn't really to show that eval() was essential, only that any language which supports eval() will have these problems.
Is C a permissive language?
C99 added support for BCPL-style comments, causing
int a = 1 //* */ 2
;
to give different behavior. C11 removed gets(), and broke code which just happened to define its own aligned_alloc() while also #including stdlib.h.
- 3JPLW 7y agoThose releases are 12 years apart and are definitely not using SemVer. I’m not at all against breaking changes, nor am I trying to litigate which languages are harder to extend non-breakingly, I’m just surprised that there’s no compatibility guarantees between 3.x releases.
- eesmith 7y agoI meant that C example to get some insight on what you mean by "permissive language" and why that was important to the topic. What language makes the compatibility guarantee you're looking for? I can't think of enough such languages to warrant being surprised about Python's behavior.