[issue41393] Fix FAQ example to use __import__('functools').reduce

2020-07-25 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that the example is okay as-is. Plus, I can't see us using __import__ in examples. "import" is the preferred way to load modules. Although now that I think about it, maybe __import__ would fit in with the subject "Is it possible to write obfuscated o

[issue41393] Fix FAQ example to use __import__('functools').reduce

2020-07-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

[issue41393] Fix FAQ example to use __import__('functools').reduce

2020-07-25 Thread Henk-Jaap Wagenaar
Henk-Jaap Wagenaar added the comment: It doesn't raise an error when you run the whole example, it has "from functools import reduce" at the top. -- nosy: +cryvate ___ Python tracker ___

[issue41393] Fix FAQ example to use __import__('functools').reduce

2020-07-25 Thread wyz23x2
New submission from wyz23x2 : https://docs.python.org/3/faq/programming.html#is-it-possible-to-write-obfuscated-one-liners-in-python https://github.com/python/cpython/blob/3.8/Doc/faq/programming.rst The 3rd raises a NameError because reduce was moved into functools. __import__('functools').red