Created
January 30, 2013 00:01
-
-
Save zzzeek/4669240 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) | |
| [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin | |
| Type "help", "copyright", "credits" or "license" for more information. | |
| >>> from __future__ import division | |
| >>> 1 / 2 | |
| 0.5 | |
| >>> import pdb | |
| >>> pdb.set_trace() | |
| --Return-- | |
| > <stdin>(1)<module>()->None | |
| (Pdb) 1/2 | |
| 0 | |
| (Pdb) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem is that the flag isn't in effect for the code that actually creates pdb's eval loop. You can see a similar effect here, where the function is compiled before we set the flag, so it doesn't see the change and continues with the old behaviour: