This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients dchimeno, docs@python, steven.daprano
Date 2018-05-05.09:14:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525511669.86.0.682650639539.issue33430@psf.upfronthosting.co.za>
In-reply-to
Content
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))
History
Date User Action Args
2018-05-05 09:14:29steven.dapranosetrecipients: + steven.daprano, docs@python, dchimeno
2018-05-05 09:14:29steven.dapranosetmessageid: <1525511669.86.0.682650639539.issue33430@psf.upfronthosting.co.za>
2018-05-05 09:14:29steven.dapranolinkissue33430 messages
2018-05-05 09:14:29steven.dapranocreate