Message242699
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>
> _______________________________________
> |
|
Date |
User |
Action |
Args |
2015-05-06 18:41:32 | projetmbc | set | recipients:
+ projetmbc, paul.moore, pitrou |
2015-05-06 18:41:32 | projetmbc | link | issue24132 messages |
2015-05-06 18:41:32 | projetmbc | create | |
|