Skip to content

BUG: FrozenList is hashable when docs claim it is not #47683

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

Closed
3 tasks done
pyrito opened this issue Jul 12, 2022 · 2 comments · Fixed by #47684
Closed
3 tasks done

BUG: FrozenList is hashable when docs claim it is not #47683

pyrito opened this issue Jul 12, 2022 · 2 comments · Fixed by #47684

Comments

@pyrito
Copy link
Contributor

pyrito commented Jul 12, 2022

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

from pandas.core.indexes.frozen import FrozenList
l = FrozenList([1,2,3])
hash(l) # This works, when docs say that it should be non-hashable

Issue Description

Currently the internal docs (pandas/core/indexes/frozen.py:21) for FrozenList claim that it is non-hashable, however it seems like this is not the case?

Expected Behavior

According to the docs, FrozenList should not be hashable. Or if the internal docs are wrong, this should be changed.

Installed Versions

INSTALLED VERSIONS

commit : e8093ba
python : 3.9.12.final.0
python-bits : 64
OS : Darwin
OS-release : 21.3.0
Version : Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.4.3
numpy : 1.22.4
pytz : 2022.1
dateutil : 2.8.2
setuptools : 61.2.0
pip : 22.1.2
Cython : None
pytest : 7.1.2
hypothesis : None
sphinx : 5.0.1
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.9.0
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.4.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : None
brotli :
fastparquet : None
fsspec : 2022.5.0
gcsfs : None
markupsafe : 2.1.1
matplotlib : 3.5.2
numba : None
numexpr : 2.8.1
odfpy : None
openpyxl : 3.0.10
pandas_gbq : 0.17.6
pyarrow : 8.0.0
pyreadstat : None
pyxlsb : None
s3fs : 2022.5.0
scipy : 1.8.1
snappy : None
sqlalchemy : 1.4.37
tables : 3.7.0
tabulate : None
xarray : 2022.3.0
xlrd : 2.0.1
xlwt : None
zstandard : None

@pyrito pyrito added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 12, 2022
@twoertwein
Copy link
Member

FrozenList is hashable, I recently fixed the type annotations for it in #47654.

Feel free to open a PR adjusting the doc-string.

I think FrozenList is not intended to be public (like most classes that are not explicitly re-exported in __init__.py or api.py).

@twoertwein twoertwein added Docs and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 12, 2022
@pyrito
Copy link
Contributor Author

pyrito commented Jul 12, 2022

Awesome, thanks @twoertwein . I'll make a doc change for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants