# Os.path.isempty() & pathlib.Path.is\_empty()

**URL:** <https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337>\
**Category:** Ideas\
**Created:** [April 5, 2024, 2:28pm UTC](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337 "2024-04-05T14:28:30Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![Nineteendo](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/nineteendo/32/19122_2.png) [@Nineteendo](https://discuss.python.org/u/Nineteendo)\
**Post date:** [April 6, 2024, 6:05am UTC](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337/21 "2024-04-06T06:05:54Z")

</div>

I didn’t mean it wasn’t my fault. I simply meant that my reply must not have been grouped with the other messages because I decided to rename the post title.

I did post this in the thread:

> I believe it makes more sense the other way around: `isempty`.  
> I also removed the hardlinks implementation as it was subjective.  
> Is this new classification of empty files and directories more intuitive?
> 
> - A directory containing no files nor subdirectories (excluding `.` & `..`)
> - A zero-byte file
> - A junction (if follow\_symlinks is disabled)
> - A symlink (if follow\_symlinks is disabled)

---

<div class="post-metadata">

**Author:** ![cameron](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cameron/32/2658_2.png) [@cameron](https://discuss.python.org/u/cameron)\
**Post date:** [April 6, 2024, 8:51am UTC](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337/22 "2024-04-06T08:51:34Z")

</div>

No, that message is there, it’s this one at my end:

```
 06Apr2024 06:41 Nice Zombies

```

(That 06:41 is in my local timezone.) It doesn’t show your title change  
because you changed it _after_ the email went out, so I have the old  
title. But I did get the message.

Email threads are not grouped based on their subject lines, they have  
headers expressing the reply chain.

---

<div class="post-metadata">

**Author:** ![Nineteendo](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/nineteendo/32/19122_2.png) [@Nineteendo](https://discuss.python.org/u/Nineteendo)\
**Post date:** [April 6, 2024, 9:02am UTC](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337/23 "2024-04-06T09:02:09Z")

</div>

Then you must simply have replied before reading the rest of the messages, which I also do occasionally.  
I’ll try to always post corrections in the future in addition to editing the post (not the title).

---

<div class="post-metadata">

**Author:** ![elis.byberi](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/elis.byberi/32/35937_2.png) [@elis.byberi](https://discuss.python.org/u/elis.byberi)\
**Post date:** [April 6, 2024, 10:11am UTC](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337/24 "2024-04-06T10:11:58Z")

</div>

I want to stress it again: do not edit posts. It’s like changing the subject each time a constructive debate begins. It doesn’t help, and for someone who has not been part of the discussion from the beginning, they won’t be able to participate. It’s nearly impossible.

---

<div class="post-metadata">

**Author:** ![Rosuav](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rosuav/32/3429_2.png) [@Rosuav](https://discuss.python.org/u/Rosuav)\
**Post date:** [April 6, 2024, 10:22am UTC](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337/25 "2024-04-06T10:22:11Z")

</div>

> [@elis.byberi](#):
>
> for someone who has not been part of the discussion from the beginning, they won’t be able to participate.

Substantive edits are also extremely rude to the people who receive these posts by email, since they are then forced to come to the web interface to see the edit.

---

<div class="post-metadata">

**Author:** ![pkoning2](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pkoning2/32/18682_2.png) [@pkoning2](https://discuss.python.org/u/pkoning2)\
**Post date:** [April 12, 2024, 1:21pm UTC](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337/26 "2024-04-12T13:21:32Z")

</div>

I have several concerns. One is to echo what others have said, which is that this is a specific application’s definition of “there’s nothing important here”, not a generally used one applicable across a wide range. A second one is related: metadata is often important, so a definition of “no data” that disregards metadata is not a good one. A way to see this is that, in file system semantics, there is a real difference between “file xyz does not exist” and “file xyz exists even though it is empty”.  
Lastly: a sequence of checks like this is inherently inaccurate in the face of concurrent file system operations.

[Previous page](https://discuss.python.org/t/os-path-isempty-pathlib-path-is-empty/50337.md?page=1)
