install_issubclass_patch conflict with typing.py's check
See original GitHub issueHi Vincent @aranega install_issubclass_patch patches the bulitin.issubclass . But typing code will validate the package name of your patched function, like following code for GenericType:
def __subclasscheck__(self, cls):
if self.__origin__ is not None:
if sys._getframe(1).f_globals['__name__'] not in ['abc', 'functools']:
raise TypeError("Parameterized generics cannot be used with class "
"or instance checks")
return False
if self is Generic:
raise TypeError("Class %r cannot be used with class "
"or instance checks" % self)
return super().__subclasscheck__(cls)
Is there a way to solve this conflict? -Andy
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
List of issues - Issues with patch - Python tracker
43916, 88082, 8 months ago, Check that new heap types cannot be created uninitialised: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag, has patch, has PR ...
Read more >How to Use the My Oracle Support Conflict Checker Tool for ...
Goal · Solution · Details · Announcement · Overview · Five easy steps to analyze a patch or group of patches using an...
Read more >Python 3.7: check if type annotation is "subclass" of generic
First of all: There is no API defined to introspect type hinting objects as defined by the typing module. Type hinting tools are...
Read more >PyCharm Educational 183.4588.180 Release Notes
Feature PY‑5138 Link to source code from .po files
Feature PY‑3454 Highlight HTTP links in reStructuredText
Feature PY‑3451 Support Structure View for reStructuredText
Feature PY‑2239 Custom...
Read more >scala/tools/nsc/typechecker/Infer.scala - SBT
@param upper When <code>true</code> search for max solution else min. ... Also, if the * type error is because of a conflict between...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi Vincent, I think your current implementation will only be impacted by typing module in python3.6 and older. In 3.7, it works fine. I just migrate to 3.7 as a quick workaround and it won’t block me right now. -Andy
The last pyecore version get rid of the patch, so there is no more problem regardless of the used python version 😃