How to implement multiple constructors

James Stroud jstroud at mbi.ucla.edu
Sun May 8 18:38:07 EDT 2005


On Sunday 08 May 2005 03:28 pm, James Stroud wrote:
>    try:
>      self.avalue = isinstance.get_avalue()
>    except NameError:
>      self.avalue = isinstance.get_anothervalue()

I have no idea where I copied those "isinstance"s from. Also, the except 
should be an AttributeError. Here is a retry:

    try:
      self.avalue = aninstance.get_avalue()
    except AttributeError:
      self.avalue = aninstance.get_anothervalue()

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/



More information about the Python-list mailing list