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

Inconsistent PEP 0448 implementation #68757

Closed
vedgar mannequin opened this issue Jul 5, 2015 · 5 comments
Closed

Inconsistent PEP 0448 implementation #68757

vedgar mannequin opened this issue Jul 5, 2015 · 5 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@vedgar
Copy link
Mannequin

vedgar mannequin commented Jul 5, 2015

BPO 24569
Nosy @benjaminp, @vedgar

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 2015-07-05.15:39:29.900>
created_at = <Date 2015-07-05.13:05:43.402>
labels = ['type-bug']
title = 'Inconsistent PEP 0448 implementation'
updated_at = <Date 2015-07-05.16:35:23.673>
user = 'https://github.com/vedgar'

bugs.python.org fields:

activity = <Date 2015-07-05.16:35:23.673>
actor = 'veky'
assignee = 'none'
closed = True
closed_date = <Date 2015-07-05.15:39:29.900>
closer = 'python-dev'
components = []
creation = <Date 2015-07-05.13:05:43.402>
creator = 'veky'
dependencies = []
files = []
hgrepos = []
issue_num = 24569
keywords = []
message_count = 5.0
messages = ['246312', '246319', '246322', '246323', '246324']
nosy_count = 3.0
nosy_names = ['benjamin.peterson', 'python-dev', 'veky']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue24569'
versions = ['Python 3.5']

@vedgar
Copy link
Mannequin Author

vedgar mannequin commented Jul 5, 2015

It seems the consequences of PEP-0448 weren't really thought through. :-/ (And BTW why isn't it in "What's new in Python 3.5"? I know there is a file with full details, but I guess this really should be notable enough.)

{0:1, **{0:2}, 0:3, 0:4}

Do you know what is the value of that dict? And does it make sense to you? It surely doesn't make sense to me (though I understand the implementation). I know things are really subtle and even Guido gets it wrong (https://bugs.python.org/msg234413), even without PEP-0448, but this particular instance is horrible.

ValueError would be perfect, I'd be ok with 4, I'd shrug on 1, I'd frown on 2, but I _scream_ on 3. Please fix this until it's too late and fictional "backward compatibility" starts to freeze the wrong behaviour.

@vedgar vedgar mannequin added the type-bug An unexpected behavior, bug, or error label Jul 5, 2015
@python-dev
Copy link
Mannequin

python-dev mannequin commented Jul 5, 2015

New changeset a4df0fe62b46 by Benjamin Peterson in branch '3.5':
set items in dict displays from left to right (closes bpo-24569)
https://hg.python.org/cpython/rev/a4df0fe62b46

New changeset 75852d90c225 by Benjamin Peterson in branch 'default':
merge 3.5 (bpo-24569)
https://hg.python.org/cpython/rev/75852d90c225

@python-dev python-dev mannequin closed this as completed Jul 5, 2015
@vedgar
Copy link
Mannequin Author

vedgar mannequin commented Jul 5, 2015

Benjamin, you're my hero. :-)

I'm not really at home in C source... is it possible that you have also changed

{0:1, 0:2}

to be {0:2} (as opposed to {0:1} as it is now)? I'm completely fine with that and find it more logical (and as I said in the previous message, it matches BDFL's mental model, which is the real reference implementation of Python:), but I'm afraid backward compatibility zealots will ruin the fun.

@benjaminp
Copy link
Contributor

Python 3.3.5 (default, Aug 19 2014, 23:45:33) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> {0:1, 0:2}
{0: 2}

Python 2.7.9 (default, Dec 24 2014, 23:52:11) 
[GCC 4.8.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> {0:1, 0:2}
{0: 2}

@vedgar
Copy link
Mannequin Author

vedgar mannequin commented Jul 5, 2015

Ah, so it was broken _only_ on 3.5. That should teach me not to uninstall Py3.x as soon as Py3.x+1 comes out. :-)

Ok, thank you very much.

@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
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant