Issue 5621: Add description of special case to "Assignment statements" section (original) (raw)

Created on 2009-03-31 14:45 by jjposner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)

msg84790 - (view)

Author: John Posner (jjposner) *

Date: 2009-03-31 14:45

The subsection "Augmented assignment statements" includes a note on this special case:

a.x += 1

But the parent section "Assignment statements" does not include such a note, even though it's essentially the same situation. I suggest replacing the bulleted paragraph that begins "If the target is an attribute reference" with the following:



msg84800 - (view)

Author: Georg Brandl (georg.brandl) * (Python committer)

Date: 2009-03-31 15:33

I'm not sure it belongs there, since normal assignments do not say anything about the RHS.

msg84805 - (view)

Author: John Posner (jjposner) *

Date: 2009-03-31 15:46

The "Assignment statements" section does talk about the RHS -- but in a subtle way:

For targets which are attribute references, the initial value is retrieved with a getattr()

The retrieving of the initial value (maybe "current value" would be better) occurs on the RHS of the assignment statement.

msg84822 - (view)

Author: Georg Brandl (georg.brandl) * (Python committer)

Date: 2009-03-31 16:15

Yes, it says that getattr() is used in the section about augassign; but there the note you refer to is already present.

msg92420 - (view)

Author: John Posner (jjposner) *

Date: 2009-09-08 15:39

George, here is a patch file for this bug. It modifies file doc/reference/simple_stmts.rst

Please let me know if this was the wrong way to submit the patch file.

msg92677 - (view)

Author: Georg Brandl (georg.brandl) * (Python committer)

Date: 2009-09-16 10:13

The patch submission was correct.

I edited the patch a bit, moved the example from augmented assignment to the regular assignment and added a link from there to the new section.

Committed in r74822.

History

Date

User

Action

Args

2022-04-11 14:56:47

admin

set

github: 49871

2009-09-16 10:13:15

georg.brandl

set

status: open -> closed
resolution: works for me -> accepted
messages: +

2009-09-08 15:39:23

jjposner

set

files: + assignment_statement.diff
keywords: + patch
status: pending -> open
messages: +

2009-03-31 16:15:33

georg.brandl

set

status: open -> pending
resolution: works for me
messages: +

2009-03-31 15:46:00

jjposner

set

messages: +

2009-03-31 15:33:22

georg.brandl

set

messages: +

2009-03-31 14:45:05

jjposner

create