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

get_random_word() & get_random_words() return a NoneType....!! #70

Open
arixank opened this issue Jun 14, 2021 · 9 comments
Open

get_random_word() & get_random_words() return a NoneType....!! #70

arixank opened this issue Jun 14, 2021 · 9 comments

Comments

@arixank
Copy link

arixank commented Jun 14, 2021

Describe the bug
At some point in type I'm encountering a NoneType in my code, which I'm unable to try and catch nor ignore it by another method..!

To Reproduce
Steps to reproduce the behavior:
here is a code screen shot:

image

code:

import random

rwd = RandomWords()
choice = random.randint(0, 14)

print(choice)
word = rwd.get_random_words(limit=15)
print(word, '\n')
new_word = word[choice]
print(new_word)

Expected behavior
Need to generate words or at least return a English word

Screenshots
Error Screen Shot
image

Environment (please complete the following information):

  • OS: [Linux]
  • Python [3.9]
@arixank
Copy link
Author

arixank commented Jun 14, 2021

Even This doesn't work:
image

@Maxwelldoug
Copy link

Same issue here under Ubuntu 20.04 LTS with python 3.9, I'll go try with 3.8

@arixank
Copy link
Author

arixank commented Jun 14, 2021

Same issue here under Ubuntu 20.04 LTS with python 3.9, I'll go try with 3.8

yes please let me know, I'm also working on several work arounds..!!

Thanks

@arixank
Copy link
Author

arixank commented Jun 14, 2021

for now this is what I'm doing for a dictionary type application..! At least string type can be done with something.

image

@romanmeister
Copy link

Same here, strangely enough it sometimes spits out a list type, sometimes NoneType

r = RandomWords()
random_words_list = r.get_random_words(limit=length_of_list)

@Mohamed-Amine-AALI
Copy link

Mohamed-Amine-AALI commented Sep 23, 2021

Same here

from random_word import RandomWords
r = RandomWords()
print(r.get_random_word())

Sometimes it prints an actual word, sometimes None

@kikefdezl
Copy link

kikefdezl commented Jul 31, 2022

Still happening for me:

import random
from random_word import RandomWords

random_words = RandomWords()
words = random_words.get_random_words(limit=random.randint(1, 10), hasDictionaryDef=True)

This sometimes returns a list of random words, and sometimes returns NoneType.

@Anas812001
Copy link

I managed to fix it guys
image

@Maxwelldoug
Copy link

That's not a fix, it's a hacky workaround at best.

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

6 participants