On Thu, 25 Apr 2013 16:09:41 -0700
Ethan Furman <ethan at stoneleaf.us> wrote:
> We just fixed NoneType() to return None instead of raising an exception.
>> Another use-case for calling NoneType is working with ORMs:
>> result = []
> for field in row:
> type = get_type(field) # returns int, bool, str, NoneType, ...
> result.append(type(field))
I don't understand what the use case is. If you already have a value of
None, why do you call NoneType on it again?
Perhaps you should write:
if not isinstance(type, field):
field = type(field)
Rehatds
Antoine.