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.

pytypes breaks @autoreload in a somewhat dangerous way

See original GitHub issue

If I decorate a class method with @typechecked, it works, but breaks autoreload, generating this error:

[autoreload of pytypes.typechecker failed: Traceback (most recent call last):
  File "/Users/srinivas/opt/anaconda3/lib/python3.8/site-packages/IPython/extensions/autoreload.py", line 245, in check
    superreload(m, reload, self.old_objects)
  File "/Users/srinivas/opt/anaconda3/lib/python3.8/site-packages/IPython/extensions/autoreload.py", line 394, in superreload
    module = reload(module)
  File "/Users/srinivas/opt/anaconda3/lib/python3.8/imp.py", line 314, in reload
    return importlib.reload(module)
  File "/Users/srinivas/opt/anaconda3/lib/python3.8/importlib/__init__.py", line 148, in reload
    raise ImportError(msg.format(name), name=name)
ImportError: module MYCLASS not in sys.modules
]

where MYCLASS is the name of the class i’m working on

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
agronholmcommented, Jan 5, 2022

I too don’t have the capacity to research this, but once the root cause is understood and pytypes/typeguard found to do something wrong, I will of course fix typeguard if possible.

1reaction
Steworicommented, Jan 5, 2022

Another thing to try is to check whether the order of decorators makes a difference. Since typeguard is affected similarly, it is worth a try to ask @agronholm whether he happens to know the cause.

Read more comments on GitHub >

github_iconTop Results From Across the Web

autoreload magic doesn't reload objects · Issue #11588 - GitHub
update: the problem appears to be with any object, unrelated to pickle. pickle was just exposing it in a forceful way.
Read more >
Release Notes — Airflow Documentation
Here is the list of breaking changes in dependencies that comes together with FAB 4: Flask from 1.X to 2.X breaking changes. flask-jwt-extended ......
Read more >
How To Style React Components | DigitalOcean
In this tutorial, you'll learn three different ways to style React components: plain Cascading Style Sheets (CSS), inline styles with ...
Read more >
Application reload - Unity Forum
The application.reload sometimes appear while hitting play mode and this is more dangerous it never goes away till I end task as I...
Read more >
NEWS
2.1 has updated its {fontawesome} requirement to >=0.4.0. shiny 1.7.2. Full changelog. Breaking changes. Closed #3626: renderPlot() (and ...
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