Is "bool" the right name?
Trying to add some newcore compatibility to numarray, I bowled through the obvious name collision between the new numarray "bool" and the Python scalar type "bool." The name collision is easy enough to work around in the numarray internals, but it occurred to me that "bool8" might be a better name since it is more explicit, consistent with the other type names, and clearly resolves the recurring question "Is this a 1-bit bool or not?". So, while newcore is still young, does it make sense to rename "bool" to "bool8"? Regards, Todd
Todd Miller wrote:
Trying to add some newcore compatibility to numarray, I bowled through the obvious name collision between the new numarray "bool" and the Python scalar type "bool." The name collision is easy enough to work around in the numarray internals, but it occurred to me that "bool8" might be a better name since it is more explicit, consistent with the other type names, and clearly resolves the recurring question "Is this a 1-bit bool or not?".
So, while newcore is still young, does it make sense to rename "bool" to "bool8"?
Actually, I renamed everything that was conflicting with standard Python types with an appended underscore. When used as a data type, the standard Python scalars actually work to identify what is desired as well. So dtype=bool_ and dtype=bool produce the same result, but of course bool_(...) produces an array of bools and bool() produces a single Python bool -Travis
On Oct 31, 2005, at 12:24, Travis Oliphant wrote:
Todd Miller wrote:
Trying to add some newcore compatibility to numarray, I bowled through the obvious name collision between the new numarray "bool" and the Python scalar type "bool." The name collision is easy enough to work around in the numarray internals, but it occurred to me that "bool8" might be a better name since it is more explicit, consistent with the other type names, and clearly resolves the recurring question "Is this a 1-bit bool or not?".
So, while newcore is still young, does it make sense to rename "bool" to "bool8"?
Actually, I renamed everything that was conflicting with standard Python types with an appended underscore.
... and I also added an __all__ to scipy.base.numerictypes that doesn't export the Python types (this is probably what Christopher Hanley ran in to). I get real nervous overwriting builtin types like that, even though it's supposedly it's the same object. Static checkers (like pylint; haven't got pychecker to work right yet) complain mightly when that happens. -- |>|\/|< /------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca
participants (3)
-
David M. Cooke -
Todd Miller -
Travis Oliphant