[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-26 Thread Guido van Rossum
Change by Guido van Rossum : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-26 Thread miss-islington
miss-islington added the comment: New changeset 3df23b5199a4bb237a595cadca6c49d34ab2a56c by Miss Islington (bot) in branch '3.10': [3.10] bpo-44468: Never skip base classes in `typing.get_type_hints()`, even with invalid `.__module__`. (GH-26862) (GH-26920)

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-26 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 7569c0fe91dfcf562dee8c29798ecda74d738aa8 by will-ca in branch 'main': bpo-44468: Never skip base classes in `typing.get_type_hints()`, even with invalid `.__module__`. (GH-26862)

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-26 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25493 pull_request: https://github.com/python/cpython/pull/26920 ___ Python tracker

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-22 Thread Will Chen
Will Chen added the comment: I opened a PR with a fix and a couple comments on its method: https://github.com/python/cpython/pull/26862 I also *think* I signed the CLA correctly. Not sure. I used my login name here, rather than my Github login, but my account is linked. Didn't add any

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-22 Thread Will Chen
Change by Will Chen : -- keywords: +patch pull_requests: +25437 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26862 ___ Python tracker ___

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-22 Thread Ken Jin
Ken Jin added the comment: > Ken, if you feel like it, a fix should not be too complicated, right? Yup. Will's proposal is to change the try-except to: base_globals = getattr(sys.modules.get(base.__module__, None), '__dict__', {}) @Will, would you like to submit a PR for this? You'd need to

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-21 Thread Guido van Rossum
Guido van Rossum added the comment: I agree with the OP, we can do better here. Ken, if you feel like it, a fix should not be too complicated, right? -- ___ Python tracker

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-21 Thread Ken Jin
Ken Jin added the comment: Will, I think what you say makes sense. @Guido / Ivan / Jelle What do you think? -- nosy: +Jelle Zijlstra, gvanrossum, kj, levkivskyi ___ Python tracker

[issue44468] Shouldn't `typing.get_type_hints()` default `globalns` to `{}` instead of skipping base classes?

2021-06-20 Thread Will Chen
New submission from Will Chen : An issue was recently closed that caused synthetic classes and base classes with invalid `__module__` attributes to raise `KeyError()` in `typing.get_type_hints()`: https://bugs.python.org/issue41515 However, the implemented solution appears to be to skip