Author projetmbc
Recipients paul.moore, pitrou, projetmbc
Date 2015-05-06.18:41:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAAb4jGmH5R7q41GW-dGZyx6Q9nC2wN64ckfuwHiStT21a032rg@mail.gmail.com>
In-reply-to <1430936519.1.0.943827684681.issue24132@psf.upfronthosting.co.za>
Content
I don't agree with you. I prefer to add new functionalities to the paths I
use. This is the power of OOP. It is easier and cleaner to use
*mypath.common_with(otherpath)*  than  *common_with(**mypath, **other path)*
.

Python is highly OOP, so you can't say *"don't use subclassing in your
case"*. As a user, I should have the possibility to use the method I want.

Another example is the use of  *onepath - anotherpath*  instead of
*onepath.relative_to(**another path)* . That's the power of the magic
method to add this kind of feature.

*Christophe BAL*
*Enseignant de mathématiques en Lycée **et développeur Python amateur*
*---*
*French math teacher in a "Lycée" **and **Python **amateur developer*

2015-05-06 20:21 GMT+02:00 Paul Moore <report@bugs.python.org>:

>
> Paul Moore added the comment:
>
> For that type of function, I'd suggest you use a standalone function
> rather than subclassing and methods or operator overloading. You don't gain
> enough to be worth the complexity of having to subclass path objects. And
> duck typing means that your function works for any subclass of (Pure)Path
> without change.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue24132>
> _______________________________________
>
History
Date User Action Args
2015-05-06 18:41:32projetmbcsetrecipients: + projetmbc, paul.moore, pitrou
2015-05-06 18:41:32projetmbclinkissue24132 messages
2015-05-06 18:41:32projetmbccreate