builtins is in core.compatibility and it doesn't seem to work for me.

The issue will go away when we drop Py 2.7...or sooner if someone can 
figure out what's wrong.

On Wednesday, May 8, 2019 at 5:02:05 PM UTC-5, Aaron Meurer wrote:
>
> On Wed, May 8, 2019 at 3:48 PM Oscar Benjamin 
> <[email protected] <javascript:>> wrote: 
> > 
> > On Wed, 8 May 2019 at 22:38, Chris Smith <[email protected] <javascript:>> 
> 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] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > 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/bb44f6d2-8d32-410b-97e7-5bd4e2409a2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to