8000 difference between behavior of assignment division and future division not documented (Trac #2061) · Issue #2653 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
difference between behavior of assignment division and future division not documented (Trac #2061) #2653
Closed
@numpy-gitbot

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/2061 on 2012-02-21 by trac user AlanFrankel, assigned to @pv.

I just ran into the same issue described in bug 1734 (assignment division not compatible with future division). Namely, I expected to see that the results of

array_a /= scalar_s

would depend on whether a "from future import division" statement was included in the code. Eventually, I figured out this had no effect; the only way I could get true division, which I wanted, was to use:

array_a = array_a / scalar_s

I see that bug 1734 has been marked "won't fix". Whether or not I agree with that assessment, I definitely think that this behavior should be in user-accessible documentation (not just in the bug database). The "Mathematical Functions" page ( http://docs.scipy.org/doc/numpy/reference/routines.math.html ) doesn't have any reference to the assignment operators at all (+=, -=, *=, /=), which in my opinion is a glaring omission, especially since it's hard to search for these strings via a punctuation-stripping search engine. The assignment operators should be listed (or there should be a link to them), and the fact that "/=" gives different results from "/" should be stated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0