How to identify the method that has called another method ?

Mars martin_a_clausen at hotmail.com
Fri Jul 18 10:20:18 EDT 2003


Hi.

I am using Python 2.2.3 and new-style classes. I want to implement a
static factory method to build objects for me. My plan is to have
__init__ check that it has been called from said factory method and
not directly. Is there a elegant way of achieving this ? (and is this
a silly idea in general ?)

Regards,

Martin




More information about the Python-list mailing list