Message300786
I would phrase that as "check if any of the components of the path are links", at which point one "obvious"[*] answer is "any(x.is_symlink() for x in [*mypath.parents, mypath])". If the path is absolute, you could use "not (mypath.resolve() == mypath)".
[*] I put that in quotes because it is only obvious once you have a non-trivial amount of experience with programming in Python. |
|
Date |
User |
Action |
Args |
2017-08-24 14:42:23 | r.david.murray | set | recipients:
+ r.david.murray, karaV |
2017-08-24 14:42:23 | r.david.murray | set | messageid: <1503585743.46.0.51805035877.issue31269@psf.upfronthosting.co.za> |
2017-08-24 14:42:23 | r.david.murray | link | issue31269 messages |
2017-08-24 14:42:23 | r.david.murray | create | |
|