[Pyobjc-dev] [ pyobjc-Bugs-678818 ] Missing NSCFNumber to int conversions
Brought to you by:
ronaldoussoren
From: SourceForge.net <no...@so...> - 2003-02-01 22:10:58
|
Bugs item #678818, was opened at 2003-02-01 14:16 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=678818&group_id=14534 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: David Eppstein (eppstein) Assigned to: Nobody/Anonymous (nobody) Summary: Missing NSCFNumber to int conversions Initial Comment: The attached code shows two problems and one non-problem with NSCFNumber (a data type that arises when objc passes an integer value to a python routine -- in the code, python ints passed to undoManager get transmogrified into this type when an undo or redo is requested). 1. if x: should only execute the if clause when x is nonzero. But if x is a zero NSCFNumber, the clause gets executed erroneously (third line of code's output is "Increment by ..." instead of "Null increment") 2. str(x) should produce a decimal representation of x, but if x is an NSCFNumber, it instead produces a string like '<NSCFNumber objective-c instance 0x832ed0>' (third and fourth lines of code's output). Given these bobbles, I would have expected to also have problems with arithmetic expressions involving NSCFNumber, but that is a non-problem -- the arithmetic in the attached code behaves correctly. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=114534&aid=678818&group_id=14534 |