Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

I've always expected that documentation for a module can assume that the module 
itself, and/or the function being described, has been imported.

On the other hand, I have no objection to making this explicit, especially in 
the recipes section where it might not be as clear which functions come from 
the module and which are builtins.

I'm inclined to go for your 2nd option, import the module and use a 
full-qualified name:

password = ''.join(secrets.choice(alphabet) for i in range(8))

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33430>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to