Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dict_of doesn't work in the python shell #5

Closed
d1618033 opened this issue Feb 1, 2020 · 1 comment
Closed

dict_of doesn't work in the python shell #5

d1618033 opened this issue Feb 1, 2020 · 1 comment

Comments

@d1618033
Copy link

d1618033 commented Feb 1, 2020

$ python
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = 1
>>> y = 2
>>> from sorcery import dict_of
>>> dict_of(x, y)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/david/PycharmProjects/sandbox/venv/lib/python3.6/site-packages/sorcery/core.py", line 177, in __call__
    while frame.f_code in self._excluded_codes or frame.f_code.co_filename.startswith('<'):
AttributeError: 'NoneType' object has no attribute 'f_code'
@alexmojaki
Copy link
Owner

None of this is going to work in a regular shell, access to the source code is required. I should probably add a note to the README about it.

It should work in an IPython notebook or shell though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants