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

Set Intersection returns unexpected results #62075

Closed
AfifElghraoui mannequin opened this issue Apr 30, 2013 · 2 comments
Closed

Set Intersection returns unexpected results #62075

AfifElghraoui mannequin opened this issue Apr 30, 2013 · 2 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@AfifElghraoui
Copy link
Mannequin

AfifElghraoui mannequin commented Apr 30, 2013

BPO 17875
Nosy @mdickinson
Files
  • lists.dat: test_lists
  • 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 2013-04-30.07:04:29.680>
    created_at = <Date 2013-04-30.05:04:30.602>
    labels = ['interpreter-core', 'type-bug', 'invalid']
    title = 'Set Intersection returns unexpected results'
    updated_at = <Date 2013-04-30.07:04:29.678>
    user = 'https://bugs.python.org/AfifElghraoui'

    bugs.python.org fields:

    activity = <Date 2013-04-30.07:04:29.678>
    actor = 'mark.dickinson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-04-30.07:04:29.680>
    closer = 'mark.dickinson'
    components = ['Interpreter Core']
    creation = <Date 2013-04-30.05:04:30.602>
    creator = 'Afif.Elghraoui'
    dependencies = []
    files = ['30075']
    hgrepos = []
    issue_num = 17875
    keywords = []
    message_count = 2.0
    messages = ['188125', '188132']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'Afif.Elghraoui']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17875'
    versions = ['Python 2.7']

    @AfifElghraoui
    Copy link
    Mannequin Author

    AfifElghraoui mannequin commented Apr 30, 2013

    I have two lists of strings (gene identifiers) that I know have something in common. I convert them to lists and do an intersection and I get the empty set. As an example test case, I know they both have the string 'Rv0500'

    >>> list1.index('Rv0500')
    278
    >>> list2.index('Rv0500')
    245
    >>> set(list1).intersection(set(list2))
    set([])

    I was expecting to get a few hundred matches. My two lists are attached to this report. This is how I created the data file:

    >> x = shelve.open('lists.dat')
    >> x['list1'] = list1
    >> x['list2'] = list2
    >> x.close()

    I did my best to make this report complete-- thanks for all your help.

    @AfifElghraoui AfifElghraoui mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Apr 30, 2013
    @mdickinson
    Copy link
    Member

    It appears that your list1 and list2 are not regular Python lists, but have type cobra.core.DictList (which inherits from list, but overrides the 'index' method). cobra is a 3rd party package, not maintained by the Python developers, so I'm afraid this isn't the right place to ask about it; is there a mailing list for the cobra package?

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant