Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add this optionality #87867

Closed
mablue mannequin opened this issue Apr 2, 2021 · 3 comments
Closed

Add this optionality #87867

mablue mannequin opened this issue Apr 2, 2021 · 3 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement

Comments

@mablue
Copy link
Mannequin

mablue mannequin commented Apr 2, 2021

BPO 43701
Nosy @ned-deily, @vedgar, @mablue

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2021-04-03.16:42:52.107>
created_at = <Date 2021-04-02.03:36:06.154>
labels = ['3.7', '3.8', '3.9', '3.10', 'type-feature', 'invalid']
title = 'Add this optionality'
updated_at = <Date 2021-04-03.16:42:52.104>
user = 'https://github.com/mablue'

bugs.python.org fields:

activity = <Date 2021-04-03.16:42:52.104>
actor = 'ned.deily'
assignee = 'none'
closed = True
closed_date = <Date 2021-04-03.16:42:52.107>
closer = 'ned.deily'
components = []
creation = <Date 2021-04-02.03:36:06.154>
creator = 'mablue'
dependencies = []
files = []
hgrepos = []
issue_num = 43701
keywords = []
message_count = 3.0
messages = ['390032', '390123', '390129']
nosy_count = 3.0
nosy_names = ['ned.deily', 'veky', 'mablue']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue43701'
versions = ['Python 3.6', 'Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10']

@mablue
Copy link
Mannequin Author

mablue mannequin commented Apr 2, 2021

I want to rediuse two var togeder!
When i do that buy sum is rediuse to zero and not effect the sellsum
buySum[pair] -= sellSum[pair]
sellSum[pair] -= buySum[pair]

Cuz of that i try this statment but its not work!
Its a simple code that will python support it:

buySum[pair],sellSum[pair] -= sellSum[pair], buySum[pair]

Please add this optionallity to python

@mablue mablue mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement labels Apr 2, 2021
@vedgar
Copy link
Mannequin

vedgar mannequin commented Apr 3, 2021

Well, just reverse the order of -= in second statement. If you write =-, it will magically work. ;-)

But in the general case, sometimes introducing temporary variables is the simplest solution.

The alternative would be to implement pointwise -= for tuples, which would be extremely confusing since they already implement += with a completely different semantics.

@ned-deily
Copy link
Member

If you want to pursue your suggestion for a change in the language, the best place to do so is first on the python-ideas mailing list (https://mail.python.org/mailman3/lists/python-ideas.python.org/). The issue tracker here is more for bugs and minor enhancements.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant