cpython/Python
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
..
.cvsignore Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
atof.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
bltinmodule.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
ceval.c SF bug #488514: -Qnew needs work 2001-12-06 06:23:26 +00:00
codecs.c Rationalize use of limits.h, moving the inclusion to Python.h. 2000-09-26 05:46:01 +00:00
compile.c SF bug #488687 reported by Neal Norwitz 2001-12-04 02:41:46 +00:00
dup2.c Mass ANSIfication of function definitions. Doesn't cover all 'extern' 2000-07-22 18:47:25 +00:00
dynload_aix.c aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for buffer 2001-11-28 21:35:49 +00:00
dynload_beos.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:37:25 +00:00
dynload_dl.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_hpux.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_mac.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_next.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_os2.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_shlib.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_stub.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
dynload_win.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
errors.c SF bug [#467265] Compile errors on SuSe Linux on IBM/s390. 2001-10-02 21:32:07 +00:00
exceptions.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:24:33 +00:00
fmod.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
frozen.c Squash compiler wng about signed/unsigned mismatch. 2001-10-18 18:57:31 +00:00
frozenmain.c Add -E command line switch (ignore environment variables like PYTHONHOME 2001-07-23 16:30:27 +00:00
future.c Fix SF bug [ #450245 ] Error in parsing future stmts 2001-08-20 20:32:33 +00:00
getargs.c mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, to 2001-12-03 00:43:33 +00:00
getcompiler.c The GCC version is loooooooooong; put it on a new line. 2000-09-05 04:40:39 +00:00
getcopyright.c Because this code was derived from Python 1.6.1 (amongst others), the 2001-04-12 20:53:31 +00:00
getcwd.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
getmtime.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
getopt.c Move our own getopt() implementation to _PyOS_GetOpt(), and use it 2000-11-03 08:18:37 +00:00
getplatform.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
getversion.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
graminit.c Very subtle syntax change: in a list comprehension, the testlist in 2001-10-15 15:44:05 +00:00
hypot.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
import.c Since the MAGIC number scheme is going to break on January 1st, document 2001-11-18 04:06:29 +00:00
importdl.c SF patch #471839: Bug when extensions import extensions (Shane Hathaway) 2001-10-16 20:07:34 +00:00
importdl.h SF patch 473749 compile under OS/2 VA C++, from Michael Muller. 2001-11-05 02:45:59 +00:00
mactoolboxglue.c More sprintf -> PyOS_snprintf. 2001-12-04 01:11:32 +00:00
marshal.c Use PyObject_CheckReadBuffer(). 2001-11-09 22:02:48 +00:00
memmove.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
modsupport.c Patch #445762: Support --disable-unicode 2001-08-17 18:39:25 +00:00
mysnprintf.c mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, to 2001-12-03 00:43:33 +00:00
mystrtoul.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
pyfpe.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
pystate.c Add a low-level API to access interpreters, for David Beazley. 2001-07-19 12:19:27 +00:00
pythonrun.c SF bug #488514: -Qnew needs work 2001-12-06 06:23:26 +00:00
sigcheck.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
strdup.c Mass ANSIfication of function definitions. Doesn't cover all 'extern' 2000-07-22 18:47:25 +00:00
strerror.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
strtod.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
structmember.c Fix SF bug #486144: Uninitialized __slot__ vrbl is None. 2001-12-04 16:23:42 +00:00
symtable.c SF bug #488687 reported by Neal Norwitz 2001-12-04 02:41:46 +00:00
sysmodule.c mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, to 2001-12-03 00:43:33 +00:00
thread.c Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
thread_beos.h More sprintf -> PyOS_snprintf. 2001-11-28 22:07:30 +00:00
thread_cthread.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
thread_foobar.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
thread_lwp.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
thread_nt.h Fix a bug in the previous checkin. The wrong bootstrap function was 2001-10-16 21:50:04 +00:00
thread_os2.h SF patch #474500: Make OS/2 locks work like posix locks, from Michael 2001-10-31 03:50:45 +00:00
thread_pth.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
thread_pthread.h Fix memory leak. This is part of SF patch #478006. 2001-11-09 16:00:41 +00:00
thread_sgi.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
thread_solaris.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
thread_wince.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
traceback.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00