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

faq/design: PEP 572 adds assignment expressions #78418

Closed
jfine2358 mannequin opened this issue Jul 26, 2018 · 10 comments
Closed

faq/design: PEP 572 adds assignment expressions #78418

jfine2358 mannequin opened this issue Jul 26, 2018 · 10 comments
Assignees
Labels
3.8 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@jfine2358
Copy link
Mannequin

jfine2358 mannequin commented Jul 26, 2018

BPO 34237
Nosy @Rosuav, @emilyemorehouse, @ammaraskar, @VadimPushtaev, @jfine2358

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 = 'https://github.com/emilyemorehouse'
closed_at = <Date 2018-07-27.09:55:45.777>
created_at = <Date 2018-07-26.14:19:36.524>
labels = ['type-bug', '3.8', 'docs']
title = 'faq/design: PEP 572 adds assignment expressions'
updated_at = <Date 2018-07-31.15:57:24.793>
user = 'https://github.com/jfine2358'

bugs.python.org fields:

activity = <Date 2018-07-31.15:57:24.793>
actor = 'Rosuav'
assignee = 'emilyemorehouse'
closed = True
closed_date = <Date 2018-07-27.09:55:45.777>
closer = 'ammar2'
components = ['Documentation']
creation = <Date 2018-07-26.14:19:36.524>
creator = 'jfine2358'
dependencies = []
files = []
hgrepos = []
issue_num = 34237
keywords = []
message_count = 10.0
messages = ['322430', '322479', '322480', '322483', '322485', '322491', '322495', '322497', '322793', '322794']
nosy_count = 6.0
nosy_names = ['docs@python', 'Rosuav', 'emilyemorehouse', 'ammar2', 'Vadim Pushtaev', 'jfine2358']
pr_nums = []
priority = 'normal'
resolution = 'postponed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue34237'
versions = ['Python 3.8']

@jfine2358
Copy link
Mannequin Author

jfine2358 mannequin commented Jul 26, 2018

The title says it all.
faq/design: PEP-572 adds assignment expressions

https://docs.python.org/3.8/faq/design.html#why-can-t-i-use-an-assignment-in-an-expression
[Can't use] this C idiom:
while (line = readline(f)) {
    // do something with line
}

https://www.python.org/dev/peps/pep-0572/
while chunk := file.read(8192):
process(chunk)

@jfine2358 jfine2358 mannequin assigned docspython Jul 26, 2018
@jfine2358 jfine2358 mannequin added 3.8 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error labels Jul 26, 2018
@VadimPushtaev
Copy link
Mannequin

VadimPushtaev mannequin commented Jul 27, 2018

This indeed doesn't make much sense now. I'll try to send a PR today.

@ammaraskar
Copy link
Member

This should be done as part of the doc changes for the full PEP-572 implementation, no point in independently doing it now when it hasn't even been implemented yet.

@VadimPushtaev
Copy link
Mannequin

VadimPushtaev mannequin commented Jul 27, 2018

Okay then.

@jfine2358
Copy link
Mannequin Author

jfine2358 mannequin commented Jul 27, 2018

My mistake. But not mine only.

According to https://www.python.org/dev/peps/pep-0572/ the PEP is Python-Version: 3.8

I took this to mean that it had been implemented in Python 3.8. Reading the PEP more closely, it also says Status: Accepted.

According to https://www.python.org/dev/peps/pep-0001/#pep-header-preamble each PEP can have an optional Python-Version, which is "described below". I thus find
===
Standards Track PEPs will typically have a Python-Version header which indicates the version of Python that the feature will be released with.
===

I seems to me that there is a bug in the PEP, perhaps caused either by a failure to increment its Python-Version as part of the release of Python 3.8, or the PEP itself providing too early the optional Python-Version.

I'll email Chris Angelico about this. I'm very happy for the issue to remain closed.

@Rosuav
Copy link
Contributor

Rosuav commented Jul 27, 2018

Yes, the PEP says version 3.8. Why is this a problem? Sit tight, let the implementation land. I don't understand why this needed me to get emailed saying that the PEP has the wrong version number in it.

@jfine2358
Copy link
Mannequin Author

jfine2358 mannequin commented Jul 27, 2018

First, I'm delighted that the current docs are in fact correct regarding assignment expressions. (I should have said this earlier.)

I'm happy to wait for the implementation to land. (And if you like, I'm willing to help with the documentation. I seem to have an eye for detail.)

Whether or not mine was the only my mistake, I was misled by the PEP-572 header. (And perhaps Vadim was also - msg322479.)

This issue is, rightly, closed. Perhaps the discussion should continue in a new issue? And without Chris, if he doesn't want to be involved. Perhaps it's a matter for the release manager?

Or perhaps having Python-Version:3.8 in the PEP remain until the change lands (and then both Status and Python-Version will be changed).

I'm new here. I'm happy for someone else to decide. No action is one option.

@jfine2358
Copy link
Mannequin Author

jfine2358 mannequin commented Jul 27, 2018

I'm sorry. I apologise. I'm being a bit stupid. Everything is fine. Nothing to do.

In case you care, here's the situation. Python 3.8 is in development, and not yet released. Somehow, I'd got it into my mind that it had already been released.

So the PEP-572 header is correct. The PEP status is accepted, the feature is in development (including documentation), and all being well the feature and the documentation will appear in Python3.8.

By the way, according to https://www.python.org/dev/peps/pep-0569/#id5, the first alpha is due 2019-01-27.

So please, all of you, accept my apologies.

@emilyemorehouse
Copy link
Member

This issue was brought to my attention -- I'm helping build the PEP-572 implementation. I'll make sure the docs get updated (and Jonathan, I didn't actually know that assignment expressions were mentioned in the FAQ, so this was still helpful!)

@Rosuav
Copy link
Contributor

Rosuav commented Jul 31, 2018

BTW, sorry for sounding a bit snippy in my comment. Jonathan, in future, rather than dropping someone an email, it'd be more normal to just ping the person on the issue itself.

@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.8 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants