On Wed, May 8, 2019 at 3:48 PM Oscar Benjamin <[email protected]> wrote: > > On Wed, 8 May 2019 at 22:38, Chris Smith <[email protected]> wrote: > > > > None of them work > > That's what I get for not trying them out! > > > >>> import sympy.core.compatibility.builtins as builtins > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > ImportError: No module named builtins > > > > >>> from sympy.core.compatibility.builtins import type > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > ImportError: No module named builtins > > Yes that's because there is no builtins module in the compatibility > package. In fact compatibility is a module not a package. > > > >>> sys.modules['builtins']=__builtin__ > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > NameError: name '__builtin__' is not defined > > This will work if you have imported __builtin__ first: > > >>> import __builtin__ > >>> import sys > >>> sys.modules['builtins'] = __builtin__ > >>> import builtins
What is this for? We shouldn't be monkey-patching sys.modules in library code. Aaron Meurer > > -- > Oscar > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/CAHVvXxQ59yzRzns5MHiqNmZz09Tx82B4aF_CnvidTwMGPA9E6Q%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6Lx_Y2q%2BVHenYL%3D5U6rm1%2BDjcyhNw-R7350HfsuA%3DMbqA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
