[Python-Dev] assymetry in descriptor behavior (original) (raw)
David Abrahams dave@boost-consulting.com
Mon, 24 Feb 2003 08:21:59 -0500
- Previous message: [Python-Dev] assymetry in descriptor behavior
- Next message: [Python-Dev] tuning up...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Guido van Rossum <guido@python.org> writes:
However, I think it might also cost an extra property object per wrapped class, unless I can find a way to get the class and its instance to share the property. Hmm, feels a bit hack-ish to me now that you mention it. Maybe option 2 is better after all. But then, do I want to implement tpgetattr or tpgetattro? I don't recall the differences. Definitely tpgetattro. The difference is that tpgetattr takes a C ^^^^^^^^^^ string argument and tpgetattr takes a Python string object. ^^^^^^^^^^ I guess I can figure out which you mean by looking at the source (Luke).
> When you call it yourself (rather than when it is called as a result > of getattribute).
When do you call it yourself? I've never called it myself except in the test suite. > I suppose this is a bit redundant. I guess; I don't know. I'm trying to understand whether "callable with one or two arguments" is really part of the requirements for use as a property method, or just something that got thrown in there. The latter. The type argument was an afterthought -- I had originally not thought about class attribute access at all.
OK; I hope you like the doc patch I submitted, then. It doesn't require "callable with one argument", only two.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
- Previous message: [Python-Dev] assymetry in descriptor behavior
- Next message: [Python-Dev] tuning up...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]