On Wed, 07 Mar 2001 09:49:09 -0500, Shane Hathaway
[EMAIL PROTECTED] wrote:
Invoking C from Python
is fast, but invoking Python from C apparently requires a lot of work.
Invoking a python function from anywhere (even from another python
function) requires alot of work.
Toby Dickenson
[EMAIL
subobjects because acquisition only looks at object attributes. It
doesn't know anything about _getOb(). (And it's not a good idea to
teach it to use _getOb(); think what it would be like if a Xeon ran like
a 386...)
I remember the days when... ;-)
Seriously though, why would that make it
Chris Withers wrote:
subobjects because acquisition only looks at object attributes. It
doesn't know anything about _getOb(). (And it's not a good idea to
teach it to use _getOb(); think what it would be like if a Xeon ran like
a 386...)
I remember the days when... ;-)
Seriously
Shane Hathaway wrote:
No. The expensive part is invoking Python code from C. It's the same
problem described by the documentation for the Python sort() method:
it's much faster to sort() then reverse() than it is to sort() with a
comparison function that reverses the elements. Invoking C
Hi,
I need a product with custom attribute getting code and so looked to the
BTreeFolder product for inspiration.
It implements both __getattr__ and _getOb which appear to do roughly the same
thing.
What's the difference?
Shane hints that __getattr__ is slower but allows acquisiton. Why is
Jeffrey P Shell wrote:
_getOb and _setOb are for placing subobjects somewhere besides attributes
(which is the default implementation).
When would __getattr__ be used then?
cheers,
Chris
___
Zope-Dev maillist - [EMAIL PROTECTED]
Jeffrey P Shell wrote:
_getOb and _setOb are for placing subobjects somewhere besides attributes
(which is the default implementation).
_getOb and friends are the default protocol that *SHOULD* be used by systems
that change subobjects (ie - copy and paste).
Sorry, just thought of
"Chris Withers" [EMAIL PROTECTED] wrote:
Jeffrey P Shell wrote:
_getOb and _setOb are for placing subobjects somewhere besides attributes
(which is the default implementation).
When would __getattr__ be used then?
In what context? You could wire __getattr__ to call into _getOb (and
Sorry, just thought of another coupla questions:
If x is an instance of my class, then:
If I do x.a = 1, is _setOb called?
If I do print x.a, is _getOb called?
No in either case.
_setOb shouldn't be used directly in the current ObjectManger
implementation. It doesn't populate the _objects
Chris McDonough wrote:
Sorry, just thought of another coupla questions:
If x is an instance of my class, then:
If I do x.a = 1, is _setOb called?
If I do print x.a, is _getOb called?
No in either case.
_setOb shouldn't be used directly in the current ObjectManger
Chris Withers wrote:
Hi,
I need a product with custom attribute getting code and so looked to the
BTreeFolder product for inspiration.
It implements both __getattr__ and _getOb which appear to do roughly the same
thing.
What's the difference?
_getOb() is part of the ObjectManager
11 matches
Mail list logo