[issue26540] Python Macros

2016-03-11 Thread Ezio Melotti
Ezio Melotti added the comment: Agreed, this is python-ideas material. The topic also came up in the past, and there are already threads where this has been discussed and even existing projects that implements macros. -- nosy: +ezio.melotti resolution: -> not a bug stage: -> resolve

[issue26540] Python Macros

2016-03-11 Thread Mark Dickinson
Mark Dickinson added the comment: This is really python-ideas material: you'd need to give a *lot* more details about exactly what you mean by "macros". -- nosy: +mark.dickinson ___ Python tracker

[issue26540] Python Macros

2016-03-11 Thread Ethan Furman
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 On

[issue26540] Python Macros

2016-03-11 Thread Devyn Johnson
New submission from Devyn Johnson: Would it be a good idea to add macros to Python? This would allow developers to test a condition (such as, "is this code running on Linux?" or "is this Python version 3.6?"). Then, the compiled bytecode will already contain the needed code, as opposed to test