Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Description
Documentation
RuntimeWarning: assigning None to unbound local ← I get this periodically since upgrading to python 3.12, for various lines of library code somewhere deep in my project's dependencies, and it seems like there's no documentation for it online? It's not even clear to me from the error message why this would be a bad thing to happen. These warnings generally seem to show up in list comprehensions. I don't know how to fix them or what they indicate. Maybe it's even a bug in python! I'm using Python 3.12.6 on Windows 10.
Here's an example from today:
C:\[...]\.venv\Lib\site-packages\asttokens\util.py:173: RuntimeWarning: assigningNonetounboundlocal'n'ifisinstance(c, type) andissubclass(c, ast.expr)} |C:\[...]\.venv\Lib\site-packages\asttokens\util.py:173: RuntimeWarning: assigningNonetounboundlocal'c'ifisinstance(c, type) andissubclass(c, ast.expr)} |Here's the line it's complaining about: https://github.com/gristlabs/asttokens/blob/2ff0e8d157fa89c22fe16839ab060b33f4c888bd/asttokens/util.py#L173
Here's another:
C:\[...]\.venv\Lib\site-packages\scipy\sparse\__init__.py:315: RuntimeWarning: assigningNonetounboundlocal's'__all__= [sforsindir() ifnots.startswith('_')]