[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-dev
Subject:    Re: [Python-Dev] The path module PEP
From:       Michael Hoffman <hoffman () ebi ! ac ! uk>
Date:       2006-01-26 9:26:27
Message-ID: Pine.LNX.4.64.0601260915100.29964 () qnzvnan ! rov ! np ! hx
[Download RAW message or body]

[Thomas Wouters]

>> This issue has been brought up before when people were discussing the
>> path module. I think the consensus is that, while the inheritance
>> isn't pure, practicality beats purity. It would require to big changes
>> to Python and would break to much existing code to not extend string.
>
> This is my only problem with the PEP. It's all very nice that subclassing
> from string makes it easier not to break things, but subclassing implies a
> certain relationship.

This is the soul of arguing for purity's sake when practicality would
dictate something else.

If you remove the basestring superclass, then you remove the ability
to use path objects as a drop-in replacement for any path string right
now.  You will either have to use str(pathobj) or carefully check that
the function/framework you are passing the path to does not use
isinstance() or any of the string methods that are now gone.

http://groups.google.com/group/comp.lang.python/browse_thread/thread/1f5bcb67c4c73f15
-- 
Michael Hoffman <hoffman@ebi.ac.uk>
European Bioinformatics Institute

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic