mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 06:24:49 -04:00
Move more xrange to six
plus a bonus next() Signed-off-by: Adrian Tschira <nota@notafile.com>
This commit is contained in:
parent
9558236728
commit
d82b6ea9e6
9 changed files with 28 additions and 11 deletions
|
@ -15,6 +15,7 @@
|
|||
|
||||
import random
|
||||
import string
|
||||
from six.moves import range
|
||||
|
||||
_string_with_symbols = (
|
||||
string.digits + string.ascii_letters + ".,;:^&*-_+=#~@"
|
||||
|
@ -22,12 +23,12 @@ _string_with_symbols = (
|
|||
|
||||
|
||||
def random_string(length):
|
||||
return ''.join(random.choice(string.ascii_letters) for _ in xrange(length))
|
||||
return ''.join(random.choice(string.ascii_letters) for _ in range(length))
|
||||
|
||||
|
||||
def random_string_with_symbols(length):
|
||||
return ''.join(
|
||||
random.choice(_string_with_symbols) for _ in xrange(length)
|
||||
random.choice(_string_with_symbols) for _ in range(length)
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue