[Python-Dev] Path PEP: some comments (equality)
Mark Mc Mahon
mark.m.mcmahon at gmail.com
Mon Feb 20 17:06:45 CET 2006
Hi,
It seems that the Path module as currently defined leaves equality
testing up to the underlying string comparison. My guess is that this
is fine for Unix (maybe not even) but it is a bit lacking for Windows.
Should the path class implement an __eq__ method that might do some of
the following things:
- Get the absolute path of both self and the other path
- normcase both
- now see if they are equal
This would make working with paths much easier for keys of a
dictionary on windows. (I frequently use a case insensitive string
class for paths if I need them to be keys of a dict.)
My first email to python-dev :-)
Mark
More information about the Python-Dev
mailing list