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

Dictionary bug #1747

Closed
SamuelJansen opened this issue Dec 27, 2020 · 1 comment
Closed

Dictionary bug #1747

SamuelJansen opened this issue Dec 27, 2020 · 1 comment

Comments

@SamuelJansen
Copy link

There is a bug in python dictionaries
The following dictionary
{
1: 'first yolo',
True: 'second yolo'
}
returns
{
1: 'second yolo'
}

Tested on python 3.8.3 and python 3.9.0. Both have same issue

Some other statements below that might help see the problem

print({
1: 'yolo',
10: 2.2
})
print({
1: 'yolo',
10: 2.2,
True: False
})
print({
1: 'yolo',
True: False
})
print({
1: 'first yolo',
True: 'second yolo'
})

@Rosuav
Copy link
Contributor

Rosuav commented Dec 27, 2020

This is not a bug. The value True in Python is, in fact, equal to 1. Also, the PEPs repository isn't the right place to discuss this sort of thing - I recommend the python-list mailing list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants