[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 one-liners in Python?"!

--
nosy: +eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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').reduce should fix this.

--
assignee: docs@python
components: Documentation
messages: 374258
nosy: docs@python, wyz23x2
priority: normal
severity: normal
status: open
title: Fix FAQ example to use __import__('functools').reduce
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com