Simplify password_generator() (#4333)

This commit is contained in:
Christian Clauss 2021-04-22 10:52:54 +02:00 committed by GitHub
parent cbe4d5f952
commit ba974810d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ def password_generator(length=8):
>>> len(password_generator(-1))
0
"""
chars = tuple(ascii_letters) + tuple(digits) + tuple(punctuation)
chars = ascii_letters + digits + punctuation
return "".join(choice(chars) for x in range(length))