Skip to content

_xxinterpqueues.get return strange value, when the queue is empty #116239

Closed

Description

@sobolevn

Bug report

Code:

» ./python.exe                                      
Python 3.13.0a4+ (heads/main:5dc8c84d397, Mar  2 2024, 10:55:34) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _xxinterpqueues
>>> a = _xxinterpqueues.create(2, 9)
>>> _xxinterpqueues.get(a, 'a')
('a', 0)
>>> 

It is happening on a fresh build of main after #116102 is fixed.

I can reproduce this 100% of times, QueueEmpty as @ericsnowcurrently said in #116102 (comment) never happens to me.

I am on macos.

Activity

  1. added
    type-bug
    on Mar 2, 2024
  2. Eclips4 commented on Mar 2, 2024

    @Eclips4
    Member

    Seems this behaviour is intentional. Second parameter on get method means default value. So, it's ok to not to see the QueueEmpty exception. But, why is there a tuple as a return value of get? The second item in this tuple looks superfluous (Should there really be a tuple here?)

  3. sobolevn commented on Mar 2, 2024

    @sobolevn
    MemberAuthor

    (Should there really be a tuple here?)

    Yes, the tuple is of (default, fmt).

  4. ericsnowcurrently commented on Mar 4, 2024

    @ericsnowcurrently
    Member

    This should be cleared up by gh-116328.

  5. added
    pending
    on Jul 8, 2024
  6. Eclips4 commented on Sep 14, 2024

    @Eclips4
    Member

    This was fixed in #116328.

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

    pendingtopic-subinterpreterstype-bug

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions