CONSTRUCT - Python's way of Ruby's "alias_method"
Slawomir Nowaczyk
slawomir.nowaczyk.847 at student.lu.se
Thu Jun 8 15:30:11 EDT 2006
On Thu, 08 Jun 2006 15:28:39 +0300
Ilias Lazaridis <ilias at lazaridis.com> wrote:
#> *IMPORT*
#>
#> I would like to know, if this construct is valid, or if it can
#> result in problems (that I do not see as a newcomer):
The intricacies of import are far beyond me, but FWIW I do not see
anything wrong in this code.
#> Is there any way (beside a patch) to alter the behaviour to an
#> existing function.
You can just assign new function to the old name. There are a few
loops to hop through if you want to alter the behaviour of an existing
*method*... There is an example -- I do not know if a good one -- here:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52192
--
Best wishes,
Slawomir Nowaczyk
( Slawomir.Nowaczyk at cs.lth.se )
Strange how people who don't even know their neighbors
are extremely curious to know if there's extra-terrestrial life.
More information about the Python-list
mailing list