[Python-ideas] Allow syntax "func(arg=x if condition)"

2021-01-13 Thread Peter O'Connor
I often find that python lacks a nice way to say "only pass an argument under this condition". (See previous python-list email in "Idea: Deferred Default Arguments?") Example 1: Defining a list with conditional elements include_bd = True current_way = ['a'] + (['b'] if include_bd else [])

[Python-ideas] pathlib.Path.makedirs

2021-01-13 Thread Antonio Cavallo
Hi, I've found myself typing too many time this: pathlib.Path("some-dir-name").mkdir(parent=True, exist_ok=True) Wouldn't be better to have a pathlib.Path.makedirs with parent/exist_ok set to True by default? Thanks ___ Python-ideas mailing list -- pyth

[Python-ideas] Renaming variable 'mod' to 'readline' in pymain_import_readline()

2021-01-13 Thread Jero Bado
Hello, In Modules/main.c, wherever PyImport_ImportModule() is use, the variables (runpy and sys) are named as follows: runpy = PyImport_ImportModule("runpy");// line 265 sys = PyImport_ImportModule("sys"); // line 444 Can we also rename 'mod' to 'readline' for consistency in line 2