# Missing \`zipfile.Path.\_\_eq\_\_\` and \`zipfile.Path.\_\_hash\_\_\`

**URL:** <https://discuss.python.org/t/missing-zipfile-path-eq-and-zipfile-path-hash/16519>\
**Category:** Ideas\
**Created:** [June 14, 2022, 12:42pm UTC](https://discuss.python.org/t/missing-zipfile-path-eq-and-zipfile-path-hash/16519 "2022-06-14T12:42:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Conchylicultor](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/conchylicultor/32/4052_2.png) [@Conchylicultor](https://discuss.python.org/u/Conchylicultor)\
**Post date:** [June 14, 2022, 12:42pm UTC](https://discuss.python.org/t/missing-zipfile-path-eq-and-zipfile-path-hash/16519/1 "2022-06-14T12:42:54Z")

</div>

I was surprised that the following fail:

```auto
p = zipfile.Path(root)

assert p / 'f.txt' == p / 'f.txt' # raise AssertionError
assert p.joinpath() == p # raise AssertionError

```

It looks like zipfile.Path does not define ` __eq__ ` nor ` __hash__ `. Shouldn’t those be added ?

---

<div class="post-metadata">

**Author:** ![brettcannon](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/brettcannon/32/34895_2.png) [@brettcannon](https://discuss.python.org/u/brettcannon)\
**Post date:** [June 14, 2022, 10:57pm UTC](https://discuss.python.org/t/missing-zipfile-path-eq-and-zipfile-path-hash/16519/2 "2022-06-14T22:57:51Z")

</div>

> [@Conchylicultor](#):
>
> It looks like zipfile.Path does not define ` __eq__ ` nor ` __hash__ `. Shouldn’t those be added ?

I’m not sure about _should_, but the probably _could_ be added. Please feel free to open a feature request.

---

<div class="post-metadata">

**Author:** ![barneygale](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/barneygale/32/1882_2.png) [@barneygale](https://discuss.python.org/u/barneygale)\
**Post date:** [June 15, 2022, 9:24pm UTC](https://discuss.python.org/t/missing-zipfile-path-eq-and-zipfile-path-hash/16519/3 "2022-06-15T21:24:29Z")

</div>

FWIW, I’m hoping to make `zipfile.Path` subclass `pathlib.PurePath` via a new `pathlib.AbstractPath` type. This would provide ` __eq__ ` and ` __hash__ ` methods and many others.
