Il venerdì 24 ottobre 2008 18:54:57 [EMAIL PROTECTED] ha scritto:

> class Foo(object):
>   def bar(self):
>    try:
>      self.baz
>      # qui posso usare baz
>
>    except AttributeError:
>      print 'la variabile non esiste, la creo'
>
>
> Non sono sicuro che sia il metodo giusto, però.
> Avete qualche idea?
hasattr(Foo, baz)

PS: Scusate per l'email sbagliata di prima.... :)
--
Simone
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 

_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a