threading: fix ExceptHookArgs being a function instead of a type#4768
Conversation
The previous typing meant `threading.ExceptHookArgs` could not be used to type a value. The new typing follows what cpython does in the happy path (`_thread` exists rather than the pure-python fallback being used). Fixes python#4767.
ff9e037 to
0b94a3e
Compare
|
Just saw this change, but I think the fix here changed the visibility of Did this fix depend on no longer using the assignment, or was that just a cleanup on top of the other changes? |
|
Thanks, I didn't know that both Xs need to be the same now. I'll send a PR tomorrow to fix this.
|
|
Thanks for catching, @jakebailey ... Would you mind submitting a PR to fix? (fwiw I adjusted this in mypy in python/mypy#9515 although I'm not sure whether that's been released yet) edit: looks like my comment submission raced against bluetech's, thanks for offering to fix! :-) |
|
Thanks for that link. I can submit a PR later if @bluetech doesn't beat me to it. |
The previous typing meant
threading.ExceptHookArgscould not be used to type a value.The new typing follows what cpython does in the happy path (
_threadexists rather than the pure-python fallback being used), a bit different than @srittau's suggestion in the issue.Also,
ExceptHookArgsis aPyStructSequencerather than an actual namedtuple, so stubtest complained about it. I changed it to tuple+properties instead. I can also addn_fields,n_sequence_fields,n_unnamed_fieldsproperties which some other structseqs in typeshed use, but seems like obscure internal detail to me so I omitted those.Fixes #4767.