You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: one typed endmarker sentinel, collapsing make_receive_queue
make_receive_queue branched on its endmarker only to decide between
calling setcallback with and without it -- which looks redundant, because
setcallback's default *is* NO_ENDMARKER_WANTED. It was not: _multi and
_channel each defined their own `object()` under that name, and the
consumer task compares against _channel's. Passing _multi's through
would have been read as a real endmarker and queued a bare object.
So share one sentinel and name its type. It is an enum member rather
than a bare object() so it can appear in an annotation: an endmarker may
be any object, identity is the only thing separating "none wanted" from a
legitimate one, and `Endmarker = object | Literal[NoEndmarker.NOT_WANTED]`
now says on every signature which sentinel a caller has to hand back.
With one definition the branch collapses to a plain forward.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments