jupyter / nbformat

Reference implementation of the Jupyter Notebook format
http://nbformat.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
265 stars 152 forks source link

Sampling from a set is deprecated #212

Closed jaraco closed 3 years ago

jaraco commented 3 years ago

While creating a notebook for testing using nbformat, I see this warning in the logs:

pip_run/tests/test_scripts.py: 14 warnings
  /Users/jaraco/code/main/pip-run/.tox/python/lib/python3.9/site-packages/nbformat/corpus/words.py:20: DeprecationWarning: Sampling from a set deprecated
  since Python 3.9 and will be removed in a subsequent version.
    return '-'.join((random.sample(acceptable_adjectives(), 1)[0], random.sample(acceptable_nouns(), 1)[0]))
MSeal commented 3 years ago

Thanks for reporting! If someone is looking for an easy contribution to the project this is a good candidate task

mwouts commented 3 years ago

Hi @MSeal , changing the sets to lists seems to fix the issue. In the PR, I have added