|
From: shi d. <shi...@gm...> - 2009-01-11 10:55:42
|
Hi,
I would like to define a class where an
attribute can be None.
For instance :
@accept(String, String)
class MyClass(a, b=None):
if b:
return b
else:
return a
I didn't find a way to use typecheck on this kind
of class. I tried to define String with
String = IsOneOf(str, unicode, NoneType) but it does
not work. It seems that 'None' can not
be checked. Have you any idea ?
Regards,
Marc.
|