[Numpy-svn] [numpy/numpy] 678ad4: FIX: remove a spurious check in get_cast_transfer_...

GitHub noreply@github....
Fri Dec 28 14:05:18 CST 2012


  Branch: refs/heads/master
  Home:   https://github.com/numpy/numpy
  Commit: 678ad43878dfae3a85362c549a8a5ab6bf5c48f1
      https://github.com/numpy/numpy/commit/678ad43878dfae3a85362c549a8a5ab6bf5c48f1
  Author: Nathaniel J. Smith <njs@pobox.com>
  Date:   2012-12-28 (Fri, 28 Dec 2012)

  Changed paths:
    M numpy/core/src/multiarray/dtype_transfer.c
    M numpy/core/tests/test_dtype.py

  Log Message:
  -----------
  FIX: remove a spurious check in get_cast_transfer_function

At least, I hope it's spurious. Certainly it's creating a spurious
error message, is unexpected by callers (one of whom specifically
makes the *opposite* check before calling get_cast_transfer_function),
and even if it is a useful check for some reason I can't see, it
certainly doesn't belong in this function (which is otherwise just
taking care of byte-swapping and alignment issues and doesn't know
anything about dtypes). And worst case, we'll have turned an exception
into a crash; even if I'm wrong, this shouldn't cause any code to go
from working to not working, just from broken to slightly-more-broken.

Test and original diagnosis by @cgohlke.

Fixes gh-2798.


  Commit: 4a3c3478ececa99d0382ca9a8d9d134d4bdd256d
      https://github.com/numpy/numpy/commit/4a3c3478ececa99d0382ca9a8d9d134d4bdd256d
  Author: Charles Harris <charlesr.harris@gmail.com>
  Date:   2012-12-28 (Fri, 28 Dec 2012)

  Changed paths:
    M numpy/core/src/multiarray/dtype_transfer.c
    M numpy/core/tests/test_dtype.py

  Log Message:
  -----------
  Merge pull request #2863 from njsmith/remove-weird-type-check

FIX: remove a spurious check in get_cast_transfer_function


Compare: https://github.com/numpy/numpy/compare/6b788c890be4...4a3c3478ecec


More information about the Numpy-svn mailing list