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

Sets are storing elements in sorted order. #85822

Closed
piyushpravin1998 mannequin opened this issue Aug 28, 2020 · 3 comments
Closed

Sets are storing elements in sorted order. #85822

piyushpravin1998 mannequin opened this issue Aug 28, 2020 · 3 comments
Labels
3.7 (EOL) end of life docs Documentation in the Doc dir performance Performance or resource usage

Comments

@piyushpravin1998
Copy link
Mannequin

piyushpravin1998 mannequin commented Aug 28, 2020

BPO 41656
Nosy @stevendaprano
Files
  • dndndgndghbdgngdndgngtn.PNG
  • 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 2020-08-28.14:07:37.406>
    created_at = <Date 2020-08-28.13:47:27.199>
    labels = ['invalid', 'docs', '3.7', 'performance']
    title = 'Sets are storing elements in sorted order.'
    updated_at = <Date 2020-08-28.14:17:38.469>
    user = 'https://bugs.python.org/piyushpravin1998'

    bugs.python.org fields:

    activity = <Date 2020-08-28.14:17:38.469>
    actor = 'steven.daprano'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-08-28.14:07:37.406>
    closer = 'steven.daprano'
    components = ['Documentation']
    creation = <Date 2020-08-28.13:47:27.199>
    creator = 'piyushpravin1998'
    dependencies = []
    files = ['49432']
    hgrepos = []
    issue_num = 41656
    keywords = []
    message_count = 3.0
    messages = ['376037', '376039', '376040']
    nosy_count = 3.0
    nosy_names = ['steven.daprano', 'docs@python', 'piyushpravin1998']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue41656'
    versions = ['Python 3.7']

    @piyushpravin1998
    Copy link
    Mannequin Author

    piyushpravin1998 mannequin commented Aug 28, 2020

    In documentation it is written that " Sets are unordered collection", but actually it is storing the elements in sorted order.

    @piyushpravin1998 piyushpravin1998 mannequin added the 3.7 (EOL) end of life label Aug 28, 2020
    @piyushpravin1998 piyushpravin1998 mannequin added docs Documentation in the Doc dir performance Performance or resource usage 3.7 (EOL) end of life labels Aug 28, 2020
    @piyushpravin1998 piyushpravin1998 mannequin added docs Documentation in the Doc dir performance Performance or resource usage labels Aug 28, 2020
    @stevendaprano
    Copy link
    Member

    "Unordered" means that the language doesn't promise any specific order, it doesn't mean that there is no order at all.

    Try strings:

    py> set("abcdef")
    {'b', 'f', 'c', 'e', 'd', 'a'}

    or different ints:

    py> set([1, 0, -2])
    {0, 1, -2}

    @stevendaprano
    Copy link
    Member

    Here's another example:

    py> set([1, 2**63, 4, -5, 6, 5])
    {1, 9223372036854775808, 4, 6, 5, -5}

    By the way, in the future, please don't post screen shots of text, copy the code and output and paste it as text into your bug report. Screenshots make it hard for us to reproduce the bug, we have to re-type your code. And it makes it difficult for blind and visually impaired developers, who may be reading this with a screen-reader.

    @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 docs Documentation in the Doc dir performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant