Skip to content

Comment on Python bug: Can assign [] = (), but not () = []parent

Comments

As an occasional numpy contributor, I would call this a bug.

Yes, the expected output is xx›

  xxx›

xxxₓ

xxxv, actually.

(it makes sense if you know why Roman numerals look the way they do)

Good point - I found it after it caused a really weird bug in a library I use. I'll open an issue on github...

Turns out it's deprecated:

    >>> import warnings
    >>> warnings.simplefilter('always')
    >>> 'x'*np.float64(3.5)
    __main__:1: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
    'xxx'

I get no such warning with 2.7.9 on linux.

It would be a warning from numpy, not Python. That comes from numpy/core/src/multiarray/conversion_utils.c and was added 2013-04-13 , which would be for NumPy 1.8, I believe.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.