diff options
author | edschofield <edschofield@localhost> | 2005-10-22 11:21:21 +0000 |
---|---|---|
committer | edschofield <edschofield@localhost> | 2005-10-22 11:21:21 +0000 |
commit | 14bdbe98ab230e8252333a185aebc27b3024810d (patch) | |
tree | 32b3a65e6d21b9aa19ce6808e885873f2b772129 /scipy/base/matrix.py | |
parent | 584a026383ebc2422e787de8bd97d223b4d341bd (diff) | |
download | numpy-14bdbe98ab230e8252333a185aebc27b3024810d.tar.gz |
EJS: Patch to use proper True and False values rather than 1 and 0. This allows stricter
type checking when we expect a boolean value to prevent the user shooting himself in
the foot. Example:
>>> a = zeros(1,2,3)
used to succeed, creating an array of shape (1,), dtype 2, and fortran=True,
which was probably not intended. It now raises a TypeError. [The user probably
wants something else, like zeros((1,2,3)).]
Diffstat (limited to 'scipy/base/matrix.py')
-rw-r--r-- | scipy/base/matrix.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scipy/base/matrix.py b/scipy/base/matrix.py index 908e38ec7..3885f9c25 100644 --- a/scipy/base/matrix.py +++ b/scipy/base/matrix.py @@ -47,7 +47,7 @@ def _convert_from_string(data): class matrix(N.ndarray): __array_priority__ = 10.0 - def __new__(self, data, dtype=None, copy=1): + def __new__(self, data, dtype=None, copy=True): if isinstance(data, matrix): dtype2 = data.dtype if (dtype is None): |