[issue26540] Python Macros

Ethan Furman report at bugs.python.org
Fri Mar 11 12:25:54 EST 2016


Ethan Furman added the comment:

That particular use-case is easily handled by simply creating the correct function/method based on the criterion:

if py_ver < 3.6:
   def fribbletz():
      # do something in a 3.0-3.5 compatible way
else:
   def fribbletz():
      # otherwise use 3.6 methods

One possible up-side would by if macros were able to allow not erroring out when new syntax was used in the False branch; but really, we add new syntax so rarely even that is probably not worth it.

----------
nosy: +ethan.furman

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26540>
_______________________________________


More information about the Python-bugs-list mailing list