On Sep 14, 10:30 am, Mark Morss <[EMAIL PROTECTED]> wrote:
> I would like to construct a class that includes both the integers and
> None. I desire that if x and y are elements of this class, and both
> are integers, then arithmetic operations between them, such as x+y,
> return the same result as integer addition. However if either x or y
> is None, these operations return None.
No need to create a new class:
try:
result = a * b
except TypeError:
result = None
--
Roberto Bonvallet
--
http://mail.python.org/mailman/listinfo/python-list