Message 316200 - Python tracker

Message316200

Author dchimeno
Recipients dchimeno, docs@python
Date 2018-05-05.08:54:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525510452.55.0.682650639539.issue33430@psf.upfronthosting.co.za>
In-reply-to
Content
In the secrets module documentation, the examples in `15.3.4. Recipes and best practices` need change things, I think this examples must run after a copy & paste into user terminal.

Options for first example:
1:
````
import string
from secrets import choice
alphabet = string.ascii_letters + string.digits
password = ''.join(choice(alphabet) for i in range(8))
````

2:
```
import string
import secrets
alphabet = string.ascii_letters + string.digits
password = ''.join(secrets.choice(alphabet) for i in range(8))
````

I've looked in the devguide, but I haven't found what's the standard approach here.

First issue here, be nice :)
History
Date User Action Args
2018-05-05 08:54:12dchimenosetrecipients: + dchimeno, docs@python
2018-05-05 08:54:12dchimenosetmessageid: <1525510452.55.0.682650639539.issue33430@psf.upfronthosting.co.za>
2018-05-05 08:54:12dchimenolinkissue33430 messages
2018-05-05 08:54:12dchimenocreate