cpython/Include
Tim Peters 3caca2326e SF bug #488514: -Qnew needs work
Big Hammer to implement -Qnew as PEP 238 says it should work (a global
option affecting all instances of "/").

pydebug.h, main.c, pythonrun.c:  define a private _Py_QnewFlag flag, true
iff -Qnew is passed on the command line.  This should go away (as the
comments say) when true division becomes The Rule.  This is
deliberately not exposed to runtime inspection or modification:  it's
a one-way one-shot switch to pretend you're using Python 3.

ceval.c:  when _Py_QnewFlag is set, treat BINARY_DIVIDE as
BINARY_TRUE_DIVIDE.

test_{descr, generators, zipfile}.py:  fiddle so these pass under
-Qnew too.  This was just a matter of s!/!//! in test_generators and
test_zipfile.  test_descr was trickier, as testbinop() is passed
assumptions that "/" is the same as calling a "__div__" method; put
a temporary hack there to call "__truediv__" instead when the method
name is "__div__" and 1/2 evaluates to 0.5.

Three standard tests still fail under -Qnew (on Windows; somebody
please try the Linux tests with -Qnew too!  Linux runs a whole bunch
of tests Windows doesn't):
    test_augassign
    test_class
    test_coercion
I can't stay awake longer to stare at this (be my guest).  Offhand
cures weren't obvious, nor was it even obvious that cures are possible
without major hackery.

Question:  when -Qnew is in effect, should calls to __div__ magically
change into calls to __truediv__?  See "major hackery" at tail end of
last paragraph <wink>.
2001-12-06 06:23:26 +00:00
..
Python.h Stop defining NDEBUG in Python.h, because it can interfere with 2001-12-04 20:06:11 +00:00
abstract.h Fix SF bug [ #476852 ] Some bad macros in abstract.h 2001-11-28 16:20:07 +00:00
bitset.h
bufferobject.h
cStringIO.h
cellobject.h
ceval.h
classobject.h
cobject.h
codecs.h
compile.h
complexobject.h
descrobject.h
dictobject.h
errcode.h
eval.h
fileobject.h PyFile_WriteString(): change prototype so that the string arg is 2001-11-28 22:13:25 +00:00
floatobject.h
frameobject.h
funcobject.h
graminit.h
grammar.h
import.h
intobject.h
intrcheck.h
iterobject.h
listobject.h
longintrepr.h
longobject.h
marshal.h
metagrammar.h
methodobject.h
modsupport.h
moduleobject.h
node.h
object.h
objimpl.h
opcode.h
osdefs.h
parsetok.h
patchlevel.h Bumping version number. 2001-11-16 21:12:25 +00:00
pgenheaders.h
py_curses.h
pydebug.h SF bug #488514: -Qnew needs work 2001-12-06 06:23:26 +00:00
pyerrors.h mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, to 2001-12-03 00:43:33 +00:00
pyfpe.h
pygetopt.h
pymactoolbox.h
pymem.h
pyport.h
pystate.h
pythonrun.h
pythread.h
rangeobject.h
sliceobject.h
stringobject.h
structmember.h Fix SF bug #486144: Uninitialized __slot__ vrbl is None. 2001-12-04 16:23:42 +00:00
structseq.h
symtable.h
sysmodule.h
token.h
traceback.h
tupleobject.h
ucnhash.h
unicodeobject.h
weakrefobject.h