[Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation
Jim Jewett
jimjjewett at gmail.com
Mon Feb 13 21:55:14 CET 2006
More information about the Python-Dev mailing list
Mon Feb 13 21:55:14 CET 2006
- Previous message: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation
- Next message: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Is there a reason __integer__ would be rejected? Guido van Rossum answered: > Given the number of folks who misappreciate the difference between > __getattr__ and __getattribute__, I'm not sure I'd want to encourage > using abbreviated and full forms of the same term in the same context. > When confronted with the existence of __int__ and __integer__ I can > see plenty of confusion ahead. I see this case as slightly different. getattr and getattribute are both things you might reasonably want to do. __int__ is something you probably shouldn't be doing very often anymore; it is being kept for backwards compatibility. Switching getattr and getattribute will cause bugs, which may be hard to diagnose, even for people who might reasonably be using the hooks. Switching __int__ and (newname) won't matter, unless __int__ was already doing something unexpected. Since backwards compatibility means we can't prevent __int__ from doing the unexpected, a similar name might be *good* -- at least it would tip people off that __int__ might not be what they want. I can't think of any way to associate getattr vs getattribute with timing or precedence. I already associate int with a specific C datatype and integer with something more abstract. (I'm not sure the new method is a better match for my integer concept, and it probably isn't a better match for java.lang.Integer, but ... the separation is there.) -jJ
- Previous message: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation
- Next message: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list