ENH: add __contains__() to np.lib.npyio.NpzFile#23661
ENH: add __contains__() to np.lib.npyio.NpzFile#23661charris merged 1 commit intonumpy:mainfrom f380cedric:npzfile-contains
Conversation
NpzFile inherits from collections.abc.Mapping, which provides __contains__(). However, it calls __getitem__(), which can be slow because it performs file decompression on success.
|
Thanks @f380cedric . |
|
Oops, I was a bit hasty. @f380cedric can you make PR adding a release note for this? See |
|
Yes, sure! I misunderstood the contribution doc, sorry for that. |
|
Hi-five on merging your first pull request to NumPy, @f380cedric! We hope you stick around! Your choices aren’t limited to submitting PRs – you can help us stay on top of new and old issues, develop educational material, work on our website, add or improve graphic design, create marketing materials, translate website content, write grant proposals, and help with other fundraising initiatives. For more info, check out: https://numpy.org/contribute |
NpzFile inherits from collections.abc.Mapping,
which provides
__contains__().However, it calls
__getitem__(),which can be slow because it performs file decompression on success.