question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

install_issubclass_patch conflict with typing.py's check

See original GitHub issue

Hi 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:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
CFAndycommented, Dec 6, 2018

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

0reactions
aranegacommented, Nov 16, 2019

The last pyecore version get rid of the patch, so there is no more problem regardless of the used python version 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found