A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-May/024099.html below:

[Python-Dev] Oberver Pattern

[Python-Dev] Oberver PatternRaymond Hettinger python@rcn.com
Tue, 14 May 2002 20:27:17 -0400
From: "Greg Ewing" <greg@cosc.canterbury.ac.nz>
> Having thought it through a bit more, you're probably
> right. I just thought it might appeal to Magnus, since
> he seems to be fond of lots of layers of magic, without
> much if any regard for performance...

FWIW, the early results from my test implementation is
that there is no measurable performance impact if
an observer function has not been attached or if
the observer function is a short C call (perhaps
setting a flag or logging the object id).  The only way to 
slow it down enough for the timer to notice seems to be 
attaching a pure python function to be notified.

IOW, the observer pattern doesn't slow you down until
you need it.  And, if you need it, then you're probably
doing it to save much more time being spent on repeated
checks to see if a change has taken place and to save
programmer effort by de-coupling the objects.

BTW, Magnus rules.
i-haven't-forgotten-+1-votes-on-generator-enhancements-ly yours <wink>,


Raymond Hettinger

_ ~
@ @
\_/





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4