Can isfile() and isdir() functions both evaluate to False?
--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: A Thousand Exotic Places Looping v001
--
Chapters
00:00 Can Isfile() And Isdir() Functions Both Evaluate To False?
00:54 Accepted Answer Score 3
01:40 Thank you
--
Full question
https://stackoverflow.com/questions/5263...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python
#avk47
    Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: A Thousand Exotic Places Looping v001
--
Chapters
00:00 Can Isfile() And Isdir() Functions Both Evaluate To False?
00:54 Accepted Answer Score 3
01:40 Thank you
--
Full question
https://stackoverflow.com/questions/5263...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python
#avk47
ACCEPTED ANSWER
Score 3
Is it possible for a file f that os.path.isfile(f) and os.path.isdir(f) both evaluate to false?
yes .. if you ask for existence os.path.exists(f).
EDIT: to answer your more detalied question ..
Would the union of B and C be equal to A?
Normaly yes .. if you can assert that none of them is deleted in the meantime.
Take into account that dead links are not exists, which means that os.path.exists(deadlink) of a (existing) link pointing to a dead end results in False while os.path.islink(deadlink) results in True, no matter if it points to a existing object or a dead end.