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

Replace inequality with non-identity for inspect._empty #211

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

albertvillanova
Copy link
Member

The inspect package uses is/is not (instead of ==/!=) with inspect._empty:

  • This is useful because the user might override __eq__/__ne__ (with unexpected behavior).
  • For singletons, is/is not guarantees comparison based on object identity.

See examples in inspect:

Note I discovered this issue because of datasets.Version. I am also proposing an improvement in its implementation, but I think this PR makes sense anyway.

@albertvillanova
Copy link
Member Author

albertvillanova commented May 16, 2022

The CI issue: https://github.com/huggingface/doc-builder/runs/6452663012?check_suite_focus=true

src/doc_builder/__init__.py:23: in <module>
    from .build_doc import build_doc
src/doc_builder/build_doc.py:30: in <module>
    from .convert_to_notebook import generate_notebooks_from_file
src/doc_builder/convert_to_notebook.py:20: in <module>
    import nbformat
/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/nbformat/__init__.py:9: in <module>
    from traitlets.log import get_logger
/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/traitlets/__init__.py:5: in <module>
    from ._version import __version__, version_info
/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/traitlets/_version.py:8: in <module>
    ".".join(map(str, version_info)).replace(".b", "b").replace(".a", "a").replace(".rc", "rc")
E   AssertionError

has to do with the update of traitlets (from 5.2.0 to 5.2.1):

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

Successfully merging this pull request may close these issues.

1 participant