Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of random_letters is not always a list #1484

Closed
svisser opened this issue Jul 22, 2021 · 3 comments
Closed

Return value of random_letters is not always a list #1484

svisser opened this issue Jul 22, 2021 · 3 comments

Comments

@svisser
Copy link
Contributor

svisser commented Jul 22, 2021

  • Faker version: 8.10.1
  • OS: Ubuntu 20.04

The return type of random_letters is not always a list as indicated in the docstring:

def random_letters(self, length=16):
"""Generate a list of random ASCII letters (a-z and A-Z) of the specified ``length``.

Steps to reproduce

>>> from faker import Faker
>>> f = Faker()
>>> f.random_letters(length=0)
[]
>>> f.random_letters(length=1)
('Y',)
>>> f.random_letters(length=2)
['o', 'K']
>>> f.random_letters(length=3)
['L', 'k', 'M']

Expected behavior

type(f.random_letters(length=n)) should be list when n=1

Actual behavior

type(f.random_letters(length=n)) has type tuple when n=1

@fcurella
Copy link
Collaborator

Thank you for the report @svisser ! Do you have time to submit a Pull Request?

@svisser
Copy link
Contributor Author

svisser commented Jul 22, 2021

Thanks for merging in the PR 👌 I'm happy for this issue to be closed but I'll leave it open in case there is anything related to docs / changelog / release management that is left to do here.

@fcurella
Copy link
Collaborator

fcurella commented Feb 4, 2022

Closed by #1485

@fcurella fcurella closed this as completed Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants