FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Dictionary bug · Issue #1747 · python/peps · GitHub

Repository navigation

Dictionary bug #1747

Closed
Closed

Description

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'
})

Activity

  1. Rosuav commented on Dec 27, 2020

    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL