Ned Deily <> added the comment:

This had me confused for a while.  But eric.smith's comment is the clue to 
what's going on here:

> This is the expected behavior, fortunately or not. "math" is not builtin in 
> the sense that is used in that paragraph.

The difference in behavior that you are seeing seems to be due to the fact that 
the Debian/Ubuntu uses a non-standard build to build-in the standard lib "math" 
module, whereas the Mac version you are using undoubtedly does not.  You can 
see this behavior yourself if you build your own version of python (either 2.7 
or 3.x) on your Ubuntu system.  You should now see the same behavior you see on 
the Mac.  For example:

# on a current Debian system
$ /usr/bin/python2.7 -c 'import sys,math;print(sys.modules["math"])'
<module 'math' (built-in)>

# on a current Mac system using the 2.7.14
$ /usr/local/bin/python2.7 -c 'import sys,math;print(sys.modules["math"])'
<module 'math' from 

So, I don't think this is an issue at all.  Please reopen if you think there is 
actually a problem here.

resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

Python tracker <>
Python-bugs-list mailing list

Reply via email to