From loewis at projects.sourceforge.net Sun Feb 1 13:02:50 2004 From: loewis at projects.sourceforge.net (loewis@projects.sourceforge.net) Date: Sun Feb 1 13:04:39 2004 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.vcproj, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17631 Modified Files: pythoncore.vcproj Log Message: Add collectionsmodule.c. Don't link with largeint.lib anymore. Index: pythoncore.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pythoncore.vcproj 21 Jan 2004 07:54:02 -0000 1.4 --- pythoncore.vcproj 1 Feb 2004 18:02:48 -0000 1.5 *************** *** 41,45 **** + + Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18379 Modified Files: msilib.py Log Message: Support flags on components Index: msilib.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** msilib.py 7 Jan 2004 22:04:10 -0000 1.6 --- msilib.py 1 Feb 2004 18:03:36 -0000 1.7 *************** *** 413,423 **** add_data(db, "Directory", [(logical, blogical, default)]) ! def start_component(self, component, feature = None, keyfile = None): uuid = gen_uuid() self.component = component if Win64: ! flags = 256 ! else: ! flags = 0 if keyfile: keyid = self.cab.gen_id(self.absolute, keyfile) --- 413,421 ---- add_data(db, "Directory", [(logical, blogical, default)]) ! def start_component(self, component, feature = None, flags = 0, keyfile = None): uuid = gen_uuid() self.component = component if Win64: ! flags |= 256 if keyfile: keyid = self.cab.gen_id(self.absolute, keyfile) From loewis at projects.sourceforge.net Sun Feb 1 13:05:33 2004 From: loewis at projects.sourceforge.net (loewis@projects.sourceforge.net) Date: Sun Feb 1 13:07:21 2004 Subject: [Python-checkins] python/nondist/sandbox/msi msi.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20170 Modified Files: msi.py Log Message: Change DEFAULTPYTHON to a feature (ext_feature) Install pythonxy.dll to System32 Make shortcuts advertised Index: msi.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** msi.py 17 Jan 2004 20:51:24 -0000 1.6 --- msi.py 1 Feb 2004 18:05:31 -0000 1.7 *************** *** 67,70 **** --- 67,75 ---- testprefix = '' + if msilib.Win64: + SystemFolderName = "[SystemFolder64]" + else: + SystemFolderName = "[SystemFolder]" + msilib.reset() *************** *** 85,90 **** msilib.add_tables(db, sequence) add_data(db, "Property", [("UpgradeCode", uc), ! ("DEFAULTPYTHON", "1"), ! ("WhichUsers", "ALL")]) db.Commit() return db --- 90,95 ---- msilib.add_tables(db, sequence) add_data(db, "Property", [("UpgradeCode", uc), ! ("WhichUsers", "ALL"), ! ]) db.Commit() return db *************** *** 204,207 **** --- 209,214 ---- ("InitialTargetDir", 307, "TARGETDIR", "[WindowsVolume]Python%s%s" % (major, minor)), + ("SetDLLDirToTarget", 307, "DLLDIR", "[TARGETDIR]"), + ("SetDLLDirToSystem32", 307, "DLLDIR", SystemFolderName), ]) *************** *** 210,213 **** --- 217,223 ---- [("PrepareDlg", None, 140), ("InitialTargetDir", 'TARGETDIR=""', 750), + # In the user interface, assume all-users installation if privileged. + ("SetDLLDirToSystem32", 'DLLDIR="" and Privileged', 751), + ("SetDLLDirToTarget", 'DLLDIR="" and not Privileged', 752), ("SelectDirectoryDlg", "Not Installed", 1230), # XXX notyet *************** *** 216,220 **** ("ProgressDlg", None, 1280)]) add_data(db, "AdminUISequence", ! [("InitialTargetDir", 'TARGETDIR=""', 750)]) ##################################################################### --- 226,243 ---- ("ProgressDlg", None, 1280)]) add_data(db, "AdminUISequence", ! [("InitialTargetDir", 'TARGETDIR=""', 750), ! ("SetDLLDirToTarget", 'DLLDIR=""', 751), ! ]) ! ! # Execute Sequences ! add_data(db, "InstallExecuteSequence", ! [("InitialTargetDir", 'TARGETDIR=""', 750), ! ("SetDLLDirToSystem32", 'DLLDIR="" and ALLUSERS', 751), ! ("SetDLLDirToTarget", 'DLLDIR="" and not ALLUSERS', 752), ! ]) ! add_data(db, "AdminExecuteSequence", ! [("InitialTargetDir", 'TARGETDIR=""', 750), ! ("SetDLLDirToTarget", 'DLLDIR=""', 751), ! ]) ##################################################################### *************** *** 425,433 **** "OK", "OK", "OK") advanced.title("Advanced Options") ! #0x10: Numeric property ! advanced.control("Default", "CheckBox", 135, 60, 160, 20, 19, ! "DEFAULTPYTHON", "Install as Default Python Installation", ! "AdminInstall", None) ! g = advanced.radiogroup("AdminInstall", 135, 90, 160, 50, 3, "WhichUsers", "", "OK") # ALLUSERS should not be tempered with on W9x --- 448,452 ---- "OK", "OK", "OK") advanced.title("Advanced Options") ! g = advanced.radiogroup("AdminInstall", 135, 60, 160, 50, 3, "WhichUsers", "", "OK") # ALLUSERS should not be tempered with on W9x *************** *** 444,448 **** c.condition("Hide", "NOT Windows9x") ! advanced.cancel("Ok", "Default", name="OK").event("EndDialog", "Return") ##################################################################### --- 463,470 ---- c.condition("Hide", "NOT Windows9x") ! c = advanced.cancel("Ok", "AdminInstall", name="OK") ! c.event("DoAction", "SetDLLDirToTarget", 'WhichUsers="JUSTME"', 1) ! c.event("DoAction", "SetDLLDirToSystem32", 'WhichUsers="ALL"', 2) ! c.event("EndDialog", "Return", order = 3) ##################################################################### *************** *** 518,535 **** def add_features(db): ! global default_feature, tcltk, htmlfiles, tools, testsuite default_feature = Feature(db, "DefaultFeature", "Python", "Python Interpreter and Libraries", 1, directory = "TARGETDIR") ! tcltk = Feature(db, "TclTk", "Tcl/Tk", "Tkinter, IDLE, pydoc", 3, parent = default_feature) htmlfiles = Feature(db, "Documentation", "Documentation", ! "Python HTMLHelp File", 5, parent = default_feature) tools = Feature(db, "Tools", "Utility Scripts", ! "Python utility scripts (Tools/", 7, ! parent = default_feature) testsuite = Feature(db, "Testsuite", "Test suite", ! "Python test suite (Lib/test/)", 9, ! parent = default_feature) def extract_msvcr71(): --- 540,561 ---- def add_features(db): ! global default_feature, tcltk, htmlfiles, tools, testsuite, ext_feature default_feature = Feature(db, "DefaultFeature", "Python", "Python Interpreter and Libraries", 1, directory = "TARGETDIR") ! ext_feature = Feature(db, "Extensions", "Register Extensions", ! "Make this Python installation the default Python installation", 3, ! parent = default_feature) ! tcltk = Feature(db, "TclTk", "Tcl/Tk", "Tkinter, IDLE, pydoc", 5, parent = default_feature) htmlfiles = Feature(db, "Documentation", "Documentation", ! "Python HTMLHelp File", 7, parent = default_feature) tools = Feature(db, "Tools", "Utility Scripts", ! "Python utility scripts (Tools/", 9, ! parent = default_feature) testsuite = Feature(db, "Testsuite", "Test suite", ! "Python test suite (Lib/test/)", 11, ! parent = default_feature) ! def extract_msvcr71(): *************** *** 560,565 **** root = Directory(db, cab, None, srcdir, "TARGETDIR", "SourceDir") default_feature.set_current() - root.add_file("PCBuild/python.exe") - root.add_file("PCBuild/pythonw.exe") root.add_file("PCBuild/w9xpopen.exe") root.add_file("PC/py.ico") --- 586,589 ---- *************** *** 568,577 **** root.add_file("NEWS.txt", src="Misc/NEWS") root.add_file("LICENSE.txt", src="LICENSE") ! ! root.add_file("PCBuild/python%s%s.dll" % (major, minor)) # XXX separate component for system32 # XXX determine dependencies version, lang = extract_msvcr71() ! root.add_file("msvcr71.dll", src=os.path.abspath("msvcr71.dll"), ! version=version, language=lang) tmpfiles.append("msvcr71.dll") --- 592,607 ---- root.add_file("NEWS.txt", src="Misc/NEWS") root.add_file("LICENSE.txt", src="LICENSE") ! # msidbComponentAttributesSharedDllRefCount = 8 ! root.start_component("python.exe", flags = 8, keyfile="python.exe") ! root.add_file("PCBuild/python.exe") ! root.start_component("pythonw.exe", flags = 8, keyfile="pythonw.exe") ! root.add_file("PCBuild/pythonw.exe") ! ! dlldir = Directory(db, cab, root, srcdir, "DLLDIR", ".") ! dlldir.add_file("PCBuild/python%s%s.dll" % (major, minor)) # XXX determine dependencies version, lang = extract_msvcr71() ! dlldir.add_file("msvcr71.dll", src=os.path.abspath("msvcr71.dll"), ! version=version, language=lang) tmpfiles.append("msvcr71.dll") *************** *** 709,718 **** "InstallPath"), ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4, ! "DEFAULTPYTHON=1", None), ("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4, ! "DEFAULTPYTHON=1", None)]) add_data(db, "FeatureComponents", [(default_feature.id, "REGISTRY"), ! (default_feature.id, "REGISTRY.def"), (tcltk.id, "REGISTRY.tcl")]) --- 739,748 ---- "InstallPath"), ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4, ! None, "py.ext"), ("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4, ! "&%s <> 2" % ext_feature.id, "py.IDLE")]) add_data(db, "FeatureComponents", [(default_feature.id, "REGISTRY"), ! (ext_feature.id, "REGISTRY.def"), (tcltk.id, "REGISTRY.tcl")]) *************** *** 783,816 **** [("ProgramMenuFolder", "TARGETDIR", "."), ("MenuDir", "ProgramMenuFolder", "PY%s%s|%sPython %s.%s" % (major,minor,testprefix,major,minor))]) add_data(db, "Shortcut", [# Advertised shortcuts: targets are features, not files # The key file of the component is then entered as the real target ! # XXX, advertised shortcuts don't work, so make them unadvertised ! # for now ! #("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "pythonw.exe", ! # default_feature.id, r"[TARGETDIR]Lib\idlelib\idle.pyw", ! # None, None, None, None, None, "TARGETDIR"), ! #("PyDoc", "MenuDir", "MODDOCS|Module Docs", "pythonw.exe", ! # default_feature.id, r"[TARGETDIR]Tools\scripts\pydocgui.pyw", ! # None, None, None, None, None, "TARGETDIR"), ! #("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe", ! # default_feature.id, None, ! # None, None, None, None, None, "TARGETDIR"), ! ("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "REGISTRY", ! r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Lib\idlelib\idle.pyw", ! None, None, None, None, None, "TARGETDIR"), ! ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "REGISTRY", ! r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Tools\scripts\pydocgui.pyw", ! None, None, None, None, None, "TARGETDIR"), ! ("Python", "MenuDir", "PYTHON|Python (command line)", "REGISTRY", ! r"[TARGETDIR]python.exe", None, ! None, None, None, None, None, "TARGETDIR"), ! # Non-advertised features: must be associated with a registry component ("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY", r"[TARGETDIR]Doc\python%s%s.chm" % (major, minor), None, None, None, None, None, None, None), - # XXX: System64Folder on Win64 ("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY", ! "[SystemFolder]msiexec", "/x%s" % product_code, None, None, None, None, None, None), ]) --- 813,836 ---- [("ProgramMenuFolder", "TARGETDIR", "."), ("MenuDir", "ProgramMenuFolder", "PY%s%s|%sPython %s.%s" % (major,minor,testprefix,major,minor))]) + add_data(db, "RemoveFile", + [("MenuDir", "TARGETDIR", None, "MenuDir", 2)]) add_data(db, "Shortcut", [# Advertised shortcuts: targets are features, not files # The key file of the component is then entered as the real target ! ("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "pythonw.exe", ! tcltk.id, r"[TARGETDIR]Lib\idlelib\idle.pyw", ! None, None, None, "py.ico", None, "TARGETDIR"), ! ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "pythonw.exe", ! default_feature.id, r"[TARGETDIR]Tools\scripts\pydocgui.pyw", ! None, None, None, "py.ico", None, "TARGETDIR"), ! ("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe", ! default_feature.id, None, ! None, None, None, "py.ico", None, "TARGETDIR"), ! ## Non-advertised features: must be associated with a registry component ("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY", r"[TARGETDIR]Doc\python%s%s.chm" % (major, minor), None, None, None, None, None, None, None), ("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY", ! SystemFolderName+"msiexec", "/x%s" % product_code, None, None, None, None, None, None), ]) From loewis at projects.sourceforge.net Sun Feb 1 14:40:16 2004 From: loewis at projects.sourceforge.net (loewis@projects.sourceforge.net) Date: Sun Feb 1 14:42:06 2004 Subject: [Python-checkins] python/nondist/peps pep-0326.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3165 Modified Files: pep-0326.txt Log Message: Fix typo. Index: pep-0326.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0326.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0326.txt 9 Jan 2004 02:36:27 -0000 1.3 --- pep-0326.txt 1 Feb 2004 19:40:14 -0000 1.4 *************** *** 395,399 **** (http://mail.python.org/pipermail/python-dev/2003-December/041374.html) ! .. [2] Re: [Python-Dev] Got None. Maybe Some?, von Rossum, Guido (http://mail.python.org/pipermail/python-dev/2003-December/041352.html) --- 395,399 ---- (http://mail.python.org/pipermail/python-dev/2003-December/041374.html) ! .. [2] Re: [Python-Dev] Got None. Maybe Some?, van Rossum, Guido (http://mail.python.org/pipermail/python-dev/2003-December/041352.html) From perky at projects.sourceforge.net Mon Feb 2 01:03:11 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Mon Feb 2 01:05:05 2004 Subject: [Python-checkins] python/dist/src configure.in,1.448,1.449 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1954 Modified Files: configure.in Log Message: Add FreeBSD support for bluetooth sockets. (SF Patch #888148, reviewed by loewis) Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.448 retrieving revision 1.449 diff -C2 -d -r1.448 -r1.449 *** configure.in 31 Jan 2004 12:34:16 -0000 1.448 --- configure.in 2 Feb 2004 06:03:08 -0000 1.449 *************** *** 919,923 **** sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h bluetooth/bluetooth.h) AC_HEADER_DIRENT AC_HEADER_MAJOR --- 919,924 ---- sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ ! bluetooth/bluetooth.h) AC_HEADER_DIRENT AC_HEADER_MAJOR From perky at projects.sourceforge.net Mon Feb 2 01:03:11 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Mon Feb 2 01:05:07 2004 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.282, 1.283 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1954/Modules Modified Files: socketmodule.c Log Message: Add FreeBSD support for bluetooth sockets. (SF Patch #888148, reviewed by loewis) Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.282 retrieving revision 1.283 diff -C2 -d -r1.282 -r1.283 *** socketmodule.c 31 Jan 2004 12:34:16 -0000 1.282 --- socketmodule.c 2 Feb 2004 06:03:09 -0000 1.283 *************** *** 323,326 **** --- 323,344 ---- #endif + #if defined(HAVE_BLUETOOTH_H) || defined(HAVE_BLUETOOTH_BLUETOOTH_H) + #define USE_BLUETOOTH 1 + #if defined(__FreeBSD__) + #define BTPROTO_L2CAP BLUETOOTH_PROTO_L2CAP + #define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM + #define sockaddr_l2 sockaddr_l2cap + #define sockaddr_rc sockaddr_rfcomm + #define _BT_SOCKADDR_MEMB(s, proto) &((s)->sock_addr) + #define _BT_L2_MEMB(sa, memb) ((sa)->l2cap_##memb) + #define _BT_RC_MEMB(sa, memb) ((sa)->rfcomm_##memb) + #else + #define _BT_SOCKADDRMEMB(s, proto) (&((s)->sock_addr).bt_##proto) + #define _BT_L2_MEMB(sa, memb) ((sa)->l2_##memb) + #define _BT_RC_MEMB(sa, memb) ((sa)->rc_##memb) + #define _BT_SCO_MEMB(sa, memb) ((sa)->sco_##memb) + #endif + #endif + /* * Constants for getnameinfo() *************** *** 1013,1017 **** #endif ! #ifdef HAVE_BLUETOOTH_BLUETOOTH_H case AF_BLUETOOTH: { --- 1031,1035 ---- #endif ! #ifdef USE_BLUETOOTH case AF_BLUETOOTH: { *************** *** 1020,1028 **** case BTPROTO_L2CAP: { ! struct sockaddr_l2* addr = (struct sockaddr_l2*) &(s->sock_addr).bt_l2; ! bdaddr_t* bdaddr = &(addr->l2_bdaddr); ! addr->l2_family = AF_BLUETOOTH; ! if( !PyArg_ParseTuple(args, "(iiiiii)i", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5], &addr->l2_psm) ) { PyErr_SetString(socket_error, "getsockaddrarg: wrong format"); --- 1038,1046 ---- case BTPROTO_L2CAP: { ! struct sockaddr_l2* addr = (struct sockaddr_l2*)_BT_SOCKADDR_MEMB(s, l2); ! bdaddr_t* bdaddr = &_BT_L2_MEMB(addr, bdaddr); ! _BT_L2_MEMB(addr, family) = AF_BLUETOOTH; ! if( !PyArg_ParseTuple(args, "(iiiiii)i", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5], &_BT_L2_MEMB(addr, psm)) ) { PyErr_SetString(socket_error, "getsockaddrarg: wrong format"); *************** *** 1036,1044 **** case BTPROTO_RFCOMM: { ! struct sockaddr_rc* addr = (struct sockaddr_rc*) &(s->sock_addr).bt_rc; ! bdaddr_t* bdaddr = &(addr->rc_bdaddr); ! addr->rc_family = AF_BLUETOOTH; ! if( !PyArg_ParseTuple(args, "(iiiiii)i", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5], &addr->rc_channel) ) { PyErr_SetString(socket_error, "getsockaddrarg: wrong format"); --- 1054,1062 ---- case BTPROTO_RFCOMM: { ! struct sockaddr_rc* addr = (struct sockaddr_rc*)_BT_SOCKADDR_MEMB(s, rc); ! bdaddr_t* bdaddr = &_BT_RC_MEMB(addr, bdaddr); ! _BT_RC_MEMB(addr, family) = AF_BLUETOOTH; ! if( !PyArg_ParseTuple(args, "(iiiiii)i", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5], &_BT_RC_MEMB(addr, channel)) ) { PyErr_SetString(socket_error, "getsockaddrarg: wrong format"); *************** *** 1050,1059 **** return 1; } case BTPROTO_SCO: { ! struct sockaddr_sco* addr = (struct sockaddr_sco*) &(s->sock_addr).bt_sco; ! bdaddr_t* bdaddr = &(addr->sco_bdaddr); ! addr->sco_family = AF_BLUETOOTH; if( !PyArg_ParseTuple(args, "iiiiii", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5]) ) { --- 1068,1078 ---- return 1; } + #if !defined(__FreeBSD__) case BTPROTO_SCO: { ! struct sockaddr_sco* addr = (struct sockaddr_sco*)_BT_SOCKADDR_MEMB(s, sco); ! bdaddr_t* bdaddr = &_BT_SCO_MEMB(addr, bdaddr); ! _BT_SCO_MEMB(addr, family) = AF_BLUETOOTH; if( !PyArg_ParseTuple(args, "iiiiii", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5]) ) { *************** *** 1066,1069 **** --- 1085,1089 ---- return 1; } + #endif default: { *************** *** 1148,1152 **** #endif ! #ifdef HAVE_BLUETOOTH_BLUETOOTH_H case AF_BLUETOOTH: { --- 1168,1172 ---- #endif ! #ifdef USE_BLUETOOTH case AF_BLUETOOTH: { *************** *** 1163,1166 **** --- 1183,1187 ---- return 1; } + #if !defined(__FreeBSD__) case BTPROTO_SCO: { *************** *** 1168,1171 **** --- 1189,1193 ---- return 1; } + #endif default: { *************** *** 3666,3673 **** #endif ! #ifdef HAVE_BLUETOOTH_BLUETOOTH_H PyModule_AddIntConstant(m, "AF_BLUETOOTH", AF_BLUETOOTH); PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP); PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO); PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM); PyModule_AddObject(m, "BDADDR_ANY", Py_BuildValue( "iiiiii", 0,0,0,0,0,0 ) ); --- 3688,3697 ---- #endif ! #ifdef USE_BLUETOOTH PyModule_AddIntConstant(m, "AF_BLUETOOTH", AF_BLUETOOTH); PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP); + #if !defined(__FreeBSD__) PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO); + #endif PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM); PyModule_AddObject(m, "BDADDR_ANY", Py_BuildValue( "iiiiii", 0,0,0,0,0,0 ) ); From perky at projects.sourceforge.net Mon Feb 2 01:05:26 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Mon Feb 2 01:07:20 2004 Subject: [Python-checkins] python/dist/src configure, 1.437, 1.438 pyconfig.h.in, 1.91, 1.92 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4760 Modified Files: configure pyconfig.h.in Log Message: Add FreeBSD support for bluetooth sockets. (SF Patch #888148, reviewed by loewis) Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.437 retrieving revision 1.438 diff -C2 -d -r1.437 -r1.438 *** configure 31 Jan 2004 12:34:15 -0000 1.437 --- configure 2 Feb 2004 06:05:23 -0000 1.438 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.447 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.449 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 4351,4354 **** --- 4351,4355 ---- + for ac_header in dlfcn.h fcntl.h grp.h limits.h langinfo.h \ libintl.h locale.h ncurses.h poll.h pthread.h \ *************** *** 4358,4362 **** sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h bluetooth/bluetooth.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --- 4359,4364 ---- sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ ! bluetooth/bluetooth.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** pyconfig.h.in 31 Jan 2004 12:34:16 -0000 1.91 --- pyconfig.h.in 2 Feb 2004 06:05:24 -0000 1.92 *************** *** 41,44 **** --- 41,47 ---- #undef HAVE_BLUETOOTH_BLUETOOTH_H + /* Define to 1 if you have the header file. */ + #undef HAVE_BLUETOOTH_H + /* Define if nice() returns success/failure instead of the new priority. */ #undef HAVE_BROKEN_NICE From perky at projects.sourceforge.net Mon Feb 2 03:48:47 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Mon Feb 2 03:50:45 2004 Subject: [Python-checkins] python/dist/src/Modules socketmodule.h,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2741/Modules Modified Files: socketmodule.h Log Message: Add FreeBSD support for bluetooth sockets. (SF Patch #888148) Index: socketmodule.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** socketmodule.h 31 Jan 2004 12:34:17 -0000 1.10 --- socketmodule.h 2 Feb 2004 08:48:45 -0000 1.11 *************** *** 40,43 **** --- 40,47 ---- #endif + #ifdef HAVE_BLUETOOTH_H + #include + #endif + #ifdef HAVE_NETPACKET_PACKET_H # include From perky at projects.sourceforge.net Mon Feb 2 08:39:03 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Mon Feb 2 08:41:01 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.925,1.926 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18238/Misc Modified Files: NEWS Log Message: Fix input() builtin function to respect compiler flags. (SF patch 876178, patch by mwh, unittest by perky) Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.925 retrieving revision 1.926 diff -C2 -d -r1.925 -r1.926 *** NEWS 31 Jan 2004 12:34:16 -0000 1.925 --- NEWS 2 Feb 2004 13:39:00 -0000 1.926 *************** *** 13,16 **** --- 13,19 ---- ----------------- + - input() builtin function now respects compiler flags such as + __future__ statements. SF patch 876178. + - Removed PendingDeprecationWarning from apply(). apply() remains deprecated, but the nuisance warning will not be issued. From perky at projects.sourceforge.net Mon Feb 2 08:39:04 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Mon Feb 2 08:41:02 2004 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.307,2.308 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18238/Python Modified Files: bltinmodule.c Log Message: Fix input() builtin function to respect compiler flags. (SF patch 876178, patch by mwh, unittest by perky) Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.307 retrieving revision 2.308 diff -C2 -d -r2.307 -r2.308 *** bltinmodule.c 4 Jan 2004 11:00:07 -0000 2.307 --- bltinmodule.c 2 Feb 2004 13:39:01 -0000 2.308 *************** *** 980,983 **** --- 980,984 ---- PyObject *res; PyObject *globals, *locals; + PyCompilerFlags cf; line = builtin_raw_input(self, args); *************** *** 995,999 **** return NULL; } ! res = PyRun_String(str, Py_eval_input, globals, locals); Py_DECREF(line); return res; --- 996,1002 ---- return NULL; } ! cf.cf_flags = 0; ! PyEval_MergeCompilerFlags(&cf); ! res = PyRun_StringFlags(str, Py_eval_input, globals, locals, &cf); Py_DECREF(line); return res; From perky at projects.sourceforge.net Mon Feb 2 08:39:04 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Mon Feb 2 08:41:05 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_builtin.py, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18238/Lib/test Modified Files: test_builtin.py Log Message: Fix input() builtin function to respect compiler flags. (SF patch 876178, patch by mwh, unittest by perky) Index: test_builtin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_builtin.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** test_builtin.py 17 Dec 2003 20:43:32 -0000 1.27 --- test_builtin.py 2 Feb 2004 13:39:01 -0000 1.28 *************** *** 932,935 **** --- 932,948 ---- sys.stdin = cStringIO.StringIO() self.assertRaises(EOFError, input) + + # SF 876178: make sure input() respect future options. + sys.stdin = cStringIO.StringIO('1/2') + sys.stdout = cStringIO.StringIO() + exec compile('print input()', 'test_builtin_tmp', 'exec') + sys.stdin.seek(0, 0) + exec compile('from __future__ import division;print input()', + 'test_builtin_tmp', 'exec') + sys.stdin.seek(0, 0) + exec compile('print input()', 'test_builtin_tmp', 'exec') + self.assertEqual(sys.stdout.getvalue().splitlines(), + ['0', '0.5', '0']) + del sys.stdout self.assertRaises(RuntimeError, input, 'prompt') From nugaskamp at yahoo.es Mon Feb 2 22:22:59 2004 From: nugaskamp at yahoo.es (Harold Vogel) Date: Mon Feb 2 19:25:40 2004 Subject: [Python-checkins] 92.TR. hi Message-ID: Rejuvenate your skin with Botox in a Bottle. HOT TICKET ITEM! Special price on this amazing Anti-Aging Anti-Wrinkle serum. See these incredible Before and After photos. http://www.lowdealz.biz/promo.php?id=93976 This special anti-wrinkle serum works like BOTOX but without the doctor, the needle, and the expensive price that accompanies it. PROVEN TO WORK OR YOUR MONEY BACK! YOU WILL SEE RESULTS FAST! GREAT GIFT FOR ALL! http://www.lowdealz.biz/promo.php?id=93976 This communication is privileged and contains confidential information intended only for the person(s) to whom it is addressed. Any unauthorized disclosure, copying, other distribution of this communication or taking any action on its contents is strictly prohibited. If you have received this message in error, please notify us immediately OR remove yourself from our list if there is no interest in regards to our services or products. http://www.lowdealz.biz/remove.php?id=93976 deanna demarcate ignoramus alcoholic reed vanity coexistent goa tanzania argo capricorn melancholy debenture a1 From fdrake at users.sourceforge.net Tue Feb 3 14:44:56 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 3 14:47:11 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libweakref.tex,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26448 Modified Files: libweakref.tex Log Message: Clarify minor point about the ref() and proxy() constructors. This matches what is already documented for corresponding feature of the C API. Index: libweakref.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libweakref.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libweakref.tex 30 Dec 2003 16:15:35 -0000 1.22 --- libweakref.tex 3 Feb 2004 19:44:26 -0000 1.23 *************** *** 59,63 **** alive; if the referent is no longer alive, calling the reference object will cause \code{None} to be returned. If \var{callback} is ! provided, it will be called when the object is about to be finalized; the weak reference object will be passed as the only parameter to the callback; the referent will no longer be available. --- 59,64 ---- alive; if the referent is no longer alive, calling the reference object will cause \code{None} to be returned. If \var{callback} is ! provided and not \constant{None}, ! it will be called when the object is about to be finalized; the weak reference object will be passed as the only parameter to the callback; the referent will no longer be available. From fdrake at users.sourceforge.net Tue Feb 3 14:53:21 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 3 14:55:37 2004 Subject: [Python-checkins] python/dist/src/Objects weakrefobject.c, 1.14, 1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1276/Objects Modified Files: weakrefobject.c Log Message: Fix bug in interpretation of the "callback" argument in the constructors for weakref ref and proxy objects; None was not being treated as identical to NULL, though it was documented as equivalent. Index: weakrefobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** weakrefobject.c 20 Nov 2003 21:21:46 -0000 1.14 --- weakrefobject.c 3 Feb 2004 19:52:56 -0000 1.15 *************** *** 625,629 **** list = GET_WEAKREFS_LISTPTR(ob); get_basic_refs(*list, &ref, &proxy); ! if (callback == NULL || callback == Py_None) /* return existing weak reference if it exists */ result = ref; --- 625,631 ---- list = GET_WEAKREFS_LISTPTR(ob); get_basic_refs(*list, &ref, &proxy); ! if (callback == Py_None) ! callback = NULL; ! if (callback == NULL) /* return existing weak reference if it exists */ result = ref; *************** *** 665,668 **** --- 667,672 ---- list = GET_WEAKREFS_LISTPTR(ob); get_basic_refs(*list, &ref, &proxy); + if (callback == Py_None) + callback = NULL; if (callback == NULL) /* attempt to return an existing weak reference if it exists */ From fdrake at users.sourceforge.net Tue Feb 3 14:57:14 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 3 14:59:28 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_weakref.py, 1.33, 1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4631/Lib/test Modified Files: test_weakref.py Log Message: - add tests that exercise fixes for the PyWeakref_NewRef() and PyWeakref_NewProxy() constructors from the C API - elaborate the getweakrefcount() and getweakrefs() tests slightly Index: test_weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** test_weakref.py 11 Dec 2003 12:33:54 -0000 1.33 --- test_weakref.py 3 Feb 2004 19:56:46 -0000 1.34 *************** *** 184,187 **** --- 184,219 ---- self.assertEqual(L3[2:5], p3[2:5]) + # The PyWeakref_* C API is documented as allowing either NULL or + # None as the value for the callback, where either means "no + # callback". The "no callback" ref and proxy objects are supposed + # to be shared so long as they exist by all callers so long as + # they are active. In Python 2.3.3 and earlier, this guaranttee + # was not honored, and was broken in different ways for + # PyWeakref_NewRef() and PyWeakref_NewProxy(). (Two tests.) + + def test_shared_ref_without_callback(self): + self.check_shared_without_callback(weakref.ref) + + def test_shared_proxy_without_callback(self): + self.check_shared_without_callback(weakref.proxy) + + def check_shared_without_callback(self, makeref): + o = Object(1) + p1 = makeref(o, None) + p2 = makeref(o, None) + self.assert_(p1 is p2, "both callbacks were None in the C API") + del p1, p2 + p1 = makeref(o) + p2 = makeref(o, None) + self.assert_(p1 is p2, "callbacks were NULL, None in the C API") + del p1, p2 + p1 = makeref(o) + p2 = makeref(o) + self.assert_(p1 is p2, "both callbacks were NULL in the C API") + del p1, p2 + p1 = makeref(o, None) + p2 = makeref(o) + self.assert_(p1 is p2, "callbacks were None, NULL in the C API") + def test_callable_proxy(self): o = Callable() *************** *** 250,253 **** --- 282,290 ---- "got wrong number of weak reference objects") + del ref1, ref2, proxy1, proxy2 + self.assert_(weakref.getweakrefcount(o) == 0, + "weak reference objects not unlinked from" + " referent when discarded.") + # assumes ints do not support weakrefs self.assert_(weakref.getweakrefcount(1) == 0, *************** *** 269,272 **** --- 306,313 ---- "list of refs does not match") + del ref1 + self.assert_(weakref.getweakrefs(o) == [], + "list of refs not cleared") + # assumes ints do not support weakrefs self.assert_(weakref.getweakrefs(1) == [], From fdrake at users.sourceforge.net Tue Feb 3 15:15:55 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 3 15:18:09 2004 Subject: [Python-checkins] python/dist/src/Objects weakrefobject.c, 1.13.6.1, 1.13.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19970/Objects Modified Files: Tag: release23-maint weakrefobject.c Log Message: Fix bug in interpretation of the "callback" argument in the constructors for weakref ref and proxy objects; None was not being treated as identical to NULL, though it was documented as equivalent. Index: weakrefobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v retrieving revision 1.13.6.1 retrieving revision 1.13.6.2 diff -C2 -d -r1.13.6.1 -r1.13.6.2 *** weakrefobject.c 20 Nov 2003 22:13:51 -0000 1.13.6.1 --- weakrefobject.c 3 Feb 2004 20:15:31 -0000 1.13.6.2 *************** *** 625,629 **** list = GET_WEAKREFS_LISTPTR(ob); get_basic_refs(*list, &ref, &proxy); ! if (callback == NULL || callback == Py_None) /* return existing weak reference if it exists */ result = ref; --- 625,631 ---- list = GET_WEAKREFS_LISTPTR(ob); get_basic_refs(*list, &ref, &proxy); ! if (callback == Py_None) ! callback = NULL; ! if (callback == NULL) /* return existing weak reference if it exists */ result = ref; *************** *** 665,668 **** --- 667,672 ---- list = GET_WEAKREFS_LISTPTR(ob); get_basic_refs(*list, &ref, &proxy); + if (callback == Py_None) + callback = NULL; if (callback == NULL) /* attempt to return an existing weak reference if it exists */ From fdrake at users.sourceforge.net Tue Feb 3 15:18:43 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 3 15:20:57 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_weakref.py, 1.28.6.3, 1.28.6.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22377/Lib/test Modified Files: Tag: release23-maint test_weakref.py Log Message: - add tests that exercise fixes for the PyWeakref_NewRef() and PyWeakref_NewProxy() constructors from the C API - elaborate the getweakrefcount() and getweakrefs() tests slightly, including additional checks pulled from the trunk Index: test_weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v retrieving revision 1.28.6.3 retrieving revision 1.28.6.4 diff -C2 -d -r1.28.6.3 -r1.28.6.4 *** test_weakref.py 20 Nov 2003 22:13:50 -0000 1.28.6.3 --- test_weakref.py 3 Feb 2004 20:18:20 -0000 1.28.6.4 *************** *** 185,188 **** --- 185,220 ---- self.assertEqual(L3[2:5], p3[2:5]) + # The PyWeakref_* C API is documented as allowing either NULL or + # None as the value for the callback, where either means "no + # callback". The "no callback" ref and proxy objects are supposed + # to be shared so long as they exist by all callers so long as + # they are active. In Python 2.3.3 and earlier, this guaranttee + # was not honored, and was broken in different ways for + # PyWeakref_NewRef() and PyWeakref_NewProxy(). (Two tests.) + + def test_shared_ref_without_callback(self): + self.check_shared_without_callback(weakref.ref) + + def test_shared_proxy_without_callback(self): + self.check_shared_without_callback(weakref.proxy) + + def check_shared_without_callback(self, makeref): + o = Object(1) + p1 = makeref(o, None) + p2 = makeref(o, None) + self.assert_(p1 is p2, "both callbacks were None in the C API") + del p1, p2 + p1 = makeref(o) + p2 = makeref(o, None) + self.assert_(p1 is p2, "callbacks were NULL, None in the C API") + del p1, p2 + p1 = makeref(o) + p2 = makeref(o) + self.assert_(p1 is p2, "both callbacks were NULL in the C API") + del p1, p2 + p1 = makeref(o, None) + p2 = makeref(o) + self.assert_(p1 is p2, "callbacks were None, NULL in the C API") + def test_callable_proxy(self): o = Callable() *************** *** 251,254 **** --- 283,295 ---- "got wrong number of weak reference objects") + del ref1, ref2, proxy1, proxy2 + self.assert_(weakref.getweakrefcount(o) == 0, + "weak reference objects not unlinked from" + " referent when discarded.") + + # assumes ints do not support weakrefs + self.assert_(weakref.getweakrefcount(1) == 0, + "got wrong number of weak reference objects for int") + def test_getweakrefs(self): o = C() *************** *** 266,269 **** --- 307,318 ---- "list of refs does not match") + del ref1 + self.assert_(weakref.getweakrefs(o) == [], + "list of refs not cleared") + + # assumes ints do not support weakrefs + self.assert_(weakref.getweakrefs(1) == [], + "list of refs does not match for int") + def test_newstyle_number_ops(self): class F(float): From fdrake at users.sourceforge.net Tue Feb 3 15:51:21 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 3 15:53:42 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libweakref.tex, 1.19.8.3, 1.19.8.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16525 Modified Files: Tag: release23-maint libweakref.tex Log Message: Clarify minor point about the ref() and proxy() constructors. This matches what is already documented for corresponding feature of the C API. Index: libweakref.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libweakref.tex,v retrieving revision 1.19.8.3 retrieving revision 1.19.8.4 diff -C2 -d -r1.19.8.3 -r1.19.8.4 *** libweakref.tex 27 Nov 2003 19:43:12 -0000 1.19.8.3 --- libweakref.tex 3 Feb 2004 20:50:45 -0000 1.19.8.4 *************** *** 58,63 **** retrieved by calling the reference object if the referent is still alive; if the referent is no longer alive, calling the reference ! object will cause \code{None} to be returned. If \var{callback} is ! provided, it will be called when the object is about to be finalized; the weak reference object will be passed as the only parameter to the callback; the referent will no longer be available. --- 58,64 ---- retrieved by calling the reference object if the referent is still alive; if the referent is no longer alive, calling the reference ! object will cause \constant{None} to be returned. If \var{callback} is ! provided and not \constant{None}, ! it will be called when the object is about to be finalized; the weak reference object will be passed as the only parameter to the callback; the referent will no longer be available. *************** *** 191,195 **** If the referent no longer exists, calling the reference object returns ! \code{None}: \begin{verbatim} --- 192,196 ---- If the referent no longer exists, calling the reference object returns ! \constant{None}: \begin{verbatim} From fdrake at users.sourceforge.net Tue Feb 3 15:56:24 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 3 15:58:39 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libweakref.tex,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19980 Modified Files: libweakref.tex Log Message: minor markup adjustments Index: libweakref.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libweakref.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** libweakref.tex 3 Feb 2004 19:44:26 -0000 1.23 --- libweakref.tex 3 Feb 2004 20:55:15 -0000 1.24 *************** *** 58,62 **** retrieved by calling the reference object if the referent is still alive; if the referent is no longer alive, calling the reference ! object will cause \code{None} to be returned. If \var{callback} is provided and not \constant{None}, it will be called when the object is about to be --- 58,62 ---- retrieved by calling the reference object if the referent is still alive; if the referent is no longer alive, calling the reference ! object will cause \constant{None} to be returned. If \var{callback} is provided and not \constant{None}, it will be called when the object is about to be *************** *** 192,196 **** If the referent no longer exists, calling the reference object returns ! \code{None}: \begin{verbatim} --- 192,196 ---- If the referent no longer exists, calling the reference object returns ! \constant{None}: \begin{verbatim} From deremer at indiatimes.com Wed Feb 4 22:03:40 2004 From: deremer at indiatimes.com (Erna Steele) Date: Wed Feb 4 12:21:44 2004 Subject: [Python-checkins] 59.VVW. Order Generic C.I.A.L.I.S ONLINE! No prior prescription needed Message-ID: PRIVATE OFFSHORE PHARMACY! No Questions asked! The Newest Drug on the Market is on SALE Super Viaggra - CIALIS is Here - as advertised during the SUPER BOWL Dubbed "The Weekend Pill" * LONGER LIFE * ACTS FASTER * BEST SEX EVER "Cialis works in 15 minutes and lasts for 36 hours giving you strong healthy erections whenever you want or need them!" COMPLETE PRIVACY & CONFIDENTIATLITY. 128-bit encrypted website for maximum security. We also have an assortment of other drugs such as soma, valium, xanax, meridia, etc. http://maynard.amilsdcx.com/m0013/index.php?id=m0013 No more of this sort of material. Honoured in 24-48 hours. http://snuffle.amilsdcx.com/a.html earthmoving noose lubbock sound effusive extractor crewel diachronic brevity builtin dub dakar irritable ithaca c's monotonous soutane barlow bp From fdrake at users.sourceforge.net Wed Feb 4 18:13:46 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Feb 4 18:16:08 2004 Subject: [Python-checkins] python/dist/src/Objects weakrefobject.c, 1.13.6.2, 1.13.6.3 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21840/Objects Modified Files: Tag: release23-maint weakrefobject.c Log Message: Allocating a new weakref object can cause existing weakref objects for the same object to be collected by the cyclic GC support if they are only referenced by a cycle. If the weakref being collected was one of the weakrefs without callbacks, some local variables for the constructor became invalid and have to be re-computed. The test caused a segfault under a debug build without the fix applied. Index: weakrefobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v retrieving revision 1.13.6.2 retrieving revision 1.13.6.3 diff -C2 -d -r1.13.6.2 -r1.13.6.3 *** weakrefobject.c 3 Feb 2004 20:15:31 -0000 1.13.6.2 --- weakrefobject.c 4 Feb 2004 23:13:43 -0000 1.13.6.3 *************** *** 631,636 **** result = ref; if (result != NULL) ! Py_XINCREF(result); else { result = new_weakref(ob, callback); if (result != NULL) { --- 631,641 ---- result = ref; if (result != NULL) ! Py_INCREF(result); else { + /* Note: new_weakref() can trigger cyclic GC, so the weakref + list on ob can be mutated. This means that the ref and + proxy pointers we got back earlier may have been collected, + so we need to compute these values again before we use + them. */ result = new_weakref(ob, callback); if (result != NULL) { *************** *** 639,644 **** } else { ! PyWeakReference *prev = (proxy == NULL) ? ref : proxy; if (prev == NULL) insert_head(result, list); --- 644,651 ---- } else { ! PyWeakReference *prev; + get_basic_refs(*list, &ref, &proxy); + prev = (proxy == NULL) ? ref : proxy; if (prev == NULL) insert_head(result, list); *************** *** 673,678 **** result = proxy; if (result != NULL) ! Py_XINCREF(result); else { result = new_weakref(ob, callback); if (result != NULL) { --- 680,690 ---- result = proxy; if (result != NULL) ! Py_INCREF(result); else { + /* Note: new_weakref() can trigger cyclic GC, so the weakref + list on ob can be mutated. This means that the ref and + proxy pointers we got back earlier may have been collected, + so we need to compute these values again before we use + them. */ result = new_weakref(ob, callback); if (result != NULL) { *************** *** 683,686 **** --- 695,699 ---- else result->ob_type = &_PyWeakref_ProxyType; + get_basic_refs(*list, &ref, &proxy); if (callback == NULL) prev = ref; From fdrake at users.sourceforge.net Wed Feb 4 18:13:46 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Feb 4 18:16:09 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_weakref.py, 1.28.6.4, 1.28.6.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21840/Lib/test Modified Files: Tag: release23-maint test_weakref.py Log Message: Allocating a new weakref object can cause existing weakref objects for the same object to be collected by the cyclic GC support if they are only referenced by a cycle. If the weakref being collected was one of the weakrefs without callbacks, some local variables for the constructor became invalid and have to be re-computed. The test caused a segfault under a debug build without the fix applied. Index: test_weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v retrieving revision 1.28.6.4 retrieving revision 1.28.6.5 diff -C2 -d -r1.28.6.4 -r1.28.6.5 *** test_weakref.py 3 Feb 2004 20:18:20 -0000 1.28.6.4 --- test_weakref.py 4 Feb 2004 23:13:43 -0000 1.28.6.5 *************** *** 1,2 **** --- 1,3 ---- + import gc import sys import unittest *************** *** 593,596 **** --- 594,628 ---- self.assertEqual(alist, []) + def test_gc_during_ref_creation(self): + self.check_gc_during_creation(weakref.ref) + + def test_gc_during_proxy_creation(self): + self.check_gc_during_creation(weakref.proxy) + + def check_gc_during_creation(self, makeref): + thresholds = gc.get_threshold() + gc.set_threshold(1, 1, 1) + gc.collect() + class A: + pass + + def callback(*args): + pass + + referenced = A() + + a = A() + a.a = a + a.wr = makeref(referenced) + + try: + # now make sure the object and the ref get labeled as + # cyclic trash: + a = A() + a.wrc = weakref.ref(referenced, callback) + + finally: + gc.set_threshold(*thresholds) + class Object: def __init__(self, arg): From fdrake at users.sourceforge.net Wed Feb 4 18:14:16 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Feb 4 18:16:38 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_weakref.py, 1.34, 1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22056/Lib/test Modified Files: test_weakref.py Log Message: Allocating a new weakref object can cause existing weakref objects for the same object to be collected by the cyclic GC support if they are only referenced by a cycle. If the weakref being collected was one of the weakrefs without callbacks, some local variables for the constructor became invalid and have to be re-computed. The test caused a segfault under a debug build without the fix applied. Index: test_weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** test_weakref.py 3 Feb 2004 19:56:46 -0000 1.34 --- test_weakref.py 4 Feb 2004 23:14:14 -0000 1.35 *************** *** 1,2 **** --- 1,3 ---- + import gc import sys import unittest *************** *** 592,595 **** --- 593,627 ---- self.assertEqual(alist, []) + def test_gc_during_ref_creation(self): + self.check_gc_during_creation(weakref.ref) + + def test_gc_during_proxy_creation(self): + self.check_gc_during_creation(weakref.proxy) + + def check_gc_during_creation(self, makeref): + thresholds = gc.get_threshold() + gc.set_threshold(1, 1, 1) + gc.collect() + class A: + pass + + def callback(*args): + pass + + referenced = A() + + a = A() + a.a = a + a.wr = makeref(referenced) + + try: + # now make sure the object and the ref get labeled as + # cyclic trash: + a = A() + a.wrc = weakref.ref(referenced, callback) + + finally: + gc.set_threshold(*thresholds) + class Object: def __init__(self, arg): From fdrake at users.sourceforge.net Wed Feb 4 18:14:17 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Feb 4 18:16:39 2004 Subject: [Python-checkins] python/dist/src/Objects weakrefobject.c, 1.15, 1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22056/Objects Modified Files: weakrefobject.c Log Message: Allocating a new weakref object can cause existing weakref objects for the same object to be collected by the cyclic GC support if they are only referenced by a cycle. If the weakref being collected was one of the weakrefs without callbacks, some local variables for the constructor became invalid and have to be re-computed. The test caused a segfault under a debug build without the fix applied. Index: weakrefobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** weakrefobject.c 3 Feb 2004 19:52:56 -0000 1.15 --- weakrefobject.c 4 Feb 2004 23:14:14 -0000 1.16 *************** *** 631,636 **** result = ref; if (result != NULL) ! Py_XINCREF(result); else { result = new_weakref(ob, callback); if (result != NULL) { --- 631,641 ---- result = ref; if (result != NULL) ! Py_INCREF(result); else { + /* Note: new_weakref() can trigger cyclic GC, so the weakref + list on ob can be mutated. This means that the ref and + proxy pointers we got back earlier may have been collected, + so we need to compute these values again before we use + them. */ result = new_weakref(ob, callback); if (result != NULL) { *************** *** 639,644 **** } else { ! PyWeakReference *prev = (proxy == NULL) ? ref : proxy; if (prev == NULL) insert_head(result, list); --- 644,651 ---- } else { ! PyWeakReference *prev; + get_basic_refs(*list, &ref, &proxy); + prev = (proxy == NULL) ? ref : proxy; if (prev == NULL) insert_head(result, list); *************** *** 673,678 **** result = proxy; if (result != NULL) ! Py_XINCREF(result); else { result = new_weakref(ob, callback); if (result != NULL) { --- 680,690 ---- result = proxy; if (result != NULL) ! Py_INCREF(result); else { + /* Note: new_weakref() can trigger cyclic GC, so the weakref + list on ob can be mutated. This means that the ref and + proxy pointers we got back earlier may have been collected, + so we need to compute these values again before we use + them. */ result = new_weakref(ob, callback); if (result != NULL) { *************** *** 683,686 **** --- 695,699 ---- else result->ob_type = &_PyWeakref_ProxyType; + get_basic_refs(*list, &ref, &proxy); if (callback == NULL) prev = ref; From doerwalter at users.sourceforge.net Thu Feb 5 12:36:02 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 5 12:38:33 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode.py, 1.86, 1.87 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8673/Lib/test Modified Files: test_unicode.py Log Message: Fix reallocation bug in unicode.translate(): The code was comparing characters instead of character pointers to determine space requirements. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** test_unicode.py 6 Oct 2003 05:08:26 -0000 1.86 --- test_unicode.py 5 Feb 2004 17:36:00 -0000 1.87 *************** *** 137,140 **** --- 137,141 ---- self.checkequalnofix(u'c', u'abababc', 'translate', {ord('a'):None, ord('b'):u''}) self.checkequalnofix(u'c', u'abababc', 'translate', {ord('a'):None, ord('b'):u''}) + self.checkequalnofix(u'xyyx', u'xzx', 'translate', {ord('z'):u'yy'}) self.assertRaises(TypeError, u'hello'.translate) From doerwalter at users.sourceforge.net Thu Feb 5 12:36:02 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 5 12:38:36 2004 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.209, 2.210 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8673/Objects Modified Files: unicodeobject.c Log Message: Fix reallocation bug in unicode.translate(): The code was comparing characters instead of character pointers to determine space requirements. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.209 retrieving revision 2.210 diff -C2 -d -r2.209 -r2.210 *** unicodeobject.c 3 Jan 2004 19:35:43 -0000 2.209 --- unicodeobject.c 5 Feb 2004 17:35:59 -0000 2.210 *************** *** 3284,3288 **** /* more than one character */ int requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + ! (insize - (*curinp-*startinp)) + repsize - 1; if (charmaptranslate_makespace(outobj, outp, requiredsize)) --- 3284,3288 ---- /* more than one character */ int requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + ! (insize - (curinp-startinp)) + repsize - 1; if (charmaptranslate_makespace(outobj, outp, requiredsize)) From doerwalter at users.sourceforge.net Thu Feb 5 12:44:28 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 5 12:46:57 2004 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.190.6.9, 2.190.6.10 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10527/Objects Modified Files: Tag: release23-maint unicodeobject.c Log Message: Backport checkin: Fix reallocation bug in unicode.translate(): The code was comparing characters instead of character pointers to determine space requirements. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.190.6.9 retrieving revision 2.190.6.10 diff -C2 -d -r2.190.6.9 -r2.190.6.10 *** unicodeobject.c 24 Oct 2003 15:05:29 -0000 2.190.6.9 --- unicodeobject.c 5 Feb 2004 17:44:26 -0000 2.190.6.10 *************** *** 3272,3276 **** /* more than one character */ int requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + ! (insize - (*curinp-*startinp)) + repsize - 1; if (charmaptranslate_makespace(outobj, outp, requiredsize)) --- 3272,3276 ---- /* more than one character */ int requiredsize = (*outp-PyUnicode_AS_UNICODE(*outobj)) + ! (insize - (curinp-startinp)) + repsize - 1; if (charmaptranslate_makespace(outobj, outp, requiredsize)) From doerwalter at users.sourceforge.net Thu Feb 5 12:44:28 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 5 12:46:59 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_unicode.py, 1.84.8.1, 1.84.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10527/Lib/test Modified Files: Tag: release23-maint test_unicode.py Log Message: Backport checkin: Fix reallocation bug in unicode.translate(): The code was comparing characters instead of character pointers to determine space requirements. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.84.8.1 retrieving revision 1.84.8.2 diff -C2 -d -r1.84.8.1 -r1.84.8.2 *** test_unicode.py 5 Aug 2003 06:20:23 -0000 1.84.8.1 --- test_unicode.py 5 Feb 2004 17:44:26 -0000 1.84.8.2 *************** *** 130,133 **** --- 130,134 ---- self.checkequalnofix(u'c', u'abababc', 'translate', {ord('a'):None, ord('b'):u''}) self.checkequalnofix(u'c', u'abababc', 'translate', {ord('a'):None, ord('b'):u''}) + self.checkequalnofix(u'xyyx', u'xzx', 'translate', {ord('z'):u'yy'}) self.assertRaises(TypeError, u'hello'.translate) From perky at users.sourceforge.net Thu Feb 5 21:52:17 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Thu Feb 5 21:54:52 2004 Subject: [Python-checkins] python/dist/src/Lib this.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11893 Modified Files: this.py Log Message: Simple is better than complex. Index: this.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/this.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** this.py 8 Feb 2002 20:41:34 -0000 1.2 --- this.py 6 Feb 2004 02:52:15 -0000 1.3 *************** *** 21,28 **** Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" ! d = {} ! for c in (65, 97): ! for i in range(26): ! d[chr(i+c)] = chr((i+13) % 26 + c) ! ! print "".join([d.get(c, c) for c in s]) --- 21,23 ---- Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" ! print s.decode('rot_13') From fdrake at users.sourceforge.net Thu Feb 5 23:14:44 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Feb 5 23:17:19 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.87,1.831.4.88 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27554 Modified Files: Tag: release23-maint NEWS Log Message: added notes about weakref changes Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.87 retrieving revision 1.831.4.88 diff -C2 -d -r1.831.4.87 -r1.831.4.88 *** NEWS 19 Dec 2003 02:06:06 -0000 1.831.4.87 --- NEWS 6 Feb 2004 04:14:41 -0000 1.831.4.88 *************** *** 5,8 **** --- 5,31 ---- (editors: check NEWS.help for information about editing NEWS using ReST.) + What's New in Python 2.3.4 (final)? + =================================== + + *Release date: DD-MMM-2004* + + Core and builtins + ----------------- + + - Made omitted callback and None equivalent for weakref.ref() and + weakref.proxy(); the None case wasn't handled correctly in all + cases. + + - Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy() + assumed that initial existing entries in an object's weakref list + would not be removed while allocating a new weakref object. Since + GC could be invoked at that time, however, that assumption was + invalid. In a truly obscure case of GC being triggered during + creation for a new weakref object for an referent which already + has a weakref without a callback which is only referenced from + cyclic trash, a memory error can occur. This consistently created a + segfault in a debug build, but provided less predictable behavior in + a release build. + What's New in Python 2.3.3 (final)? =================================== From fdrake at users.sourceforge.net Thu Feb 5 23:15:25 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Feb 5 23:17:58 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.926,1.927 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27649 Modified Files: NEWS Log Message: added notes about weakref changes Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.926 retrieving revision 1.927 diff -C2 -d -r1.926 -r1.927 *** NEWS 2 Feb 2004 13:39:00 -0000 1.926 --- NEWS 6 Feb 2004 04:15:22 -0000 1.927 *************** *** 13,16 **** --- 13,31 ---- ----------------- + - Made omitted callback and None equivalent for weakref.ref() and + weakref.proxy(); the None case wasn't handled correctly in all + cases. + + - Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy() + assumed that initial existing entries in an object's weakref list + would not be removed while allocating a new weakref object. Since + GC could be invoked at that time, however, that assumption was + invalid. In a truly obscure case of GC being triggered during + creation for a new weakref object for an referent which already + has a weakref without a callback which is only referenced from + cyclic trash, a memory error can occur. This consistently created a + segfault in a debug build, but provided less predictable behavior in + a release build. + - input() builtin function now respects compiler flags such as __future__ statements. SF patch 876178. From perky at users.sourceforge.net Thu Feb 5 23:40:58 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Thu Feb 5 23:43:31 2004 Subject: [Python-checkins] python/dist/src/Lib this.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32534 Modified Files: this.py Log Message: Back rev 1.3 out per Raymond's request. Index: this.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/this.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** this.py 6 Feb 2004 02:52:15 -0000 1.3 --- this.py 6 Feb 2004 04:40:56 -0000 1.4 *************** *** 21,23 **** Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" ! print s.decode('rot_13') --- 21,28 ---- Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" ! d = {} ! for c in (65, 97): ! for i in range(26): ! d[chr(i+c)] = chr((i+13) % 26 + c) ! ! print "".join([d.get(c, c) for c in s]) From eprice at users.sourceforge.net Fri Feb 6 11:31:35 2004 From: eprice at users.sourceforge.net (eprice@users.sourceforge.net) Date: Fri Feb 6 11:34:15 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.12, 1.13 test_Decimal.py, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12521 Modified Files: Decimal.py test_Decimal.py Log Message: Updated to pass newer test cases. Most notably, NaNs with diagnostic info work. Index: Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Decimal.py 12 Aug 2003 23:04:23 -0000 1.12 --- Decimal.py 6 Feb 2004 16:31:32 -0000 1.13 *************** *** 248,252 **** def handle(self, context, *args): if args: ! return (NaN,NaN) return NaN --- 248,253 ---- def handle(self, context, *args): if args: ! if args[0] == 1: #sNaN, must drop 's' but keep diagnostics ! return Decimal( (args[1]._sign, args[1]._int, 'n') ) return NaN *************** *** 374,377 **** --- 375,382 ---- ExceptionList = filter(filterfunct, globals().values()) + #To fix reloading, force it to create a new context + #Old contexts have different exceptions in their dicts, making problems. + if hasattr(threading.currentThread(), '__decimal_context__'): + del threading.currentThread().__decimal_context__ def setcontext(context): *************** *** 423,433 **** return if isnan(value): ! sig = isnan(value) - 1 ! self._exp = sig and 'N' or 'n' ! self._sign = 0 ! self._int = (0,) #snan or nan return self._convertString(value, context) - # Only a string if it works here return --- 428,444 ---- return if isnan(value): ! sig, sign, diag = isnan(value) ! if len(diag) > context.prec: #Diagnostic info too long ! self._sign, self._int, self._exp = \ ! context.raise_error(ConversionSyntax) ! return ! if sig == 1: ! self._exp = 'n' #qNaN ! else: #sig == 2 ! self._exp = 'N' #sNaN ! self._sign = sign ! self._int = tuple(map(int, tuple(diag))) #Diagnostic info return self._convertString(value, context) return *************** *** 441,452 **** raise ValueError, 'Invalid arguments' if value[0] not in [0,1]: ! raise ValueError, 'Invalid sign' # FIXME: Add more input validation checks here self._sign = value[0] self._int = tuple(value[1]) if value[2] in ('F','n','N'): ! self._exp = value[2] else: ! self._exp = long(value[2]) return --- 452,464 ---- raise ValueError, 'Invalid arguments' if value[0] not in [0,1]: ! raise ValueError, 'Invalid sign' ! # FIXME: Add more input validation checks here self._sign = value[0] self._int = tuple(value[1]) if value[2] in ('F','n','N'): ! self._exp = value[2] else: ! self._exp = long(value[2]) return *************** *** 468,472 **** if isinstance(value, float): ! #self._convertString(_floatToString(value), context) # # This would give a more strictly accurate representation, --- 480,485 ---- if isinstance(value, float): ! # Another possibility would be: ! # self._convertString(_floatToString(value), context) # # This would give a more strictly accurate representation, *************** *** 521,531 **** if self._isnan() == 2: ! return context.raise_error(InvalidOperation, 'sNaN') if other is not None and other._isnan() == 2: ! return context.raise_error(InvalidOperation, 'sNaN') if self._isnan(): ! return NaN if other is not None and other._isnan(): ! return NaN return 0 --- 534,546 ---- if self._isnan() == 2: ! return context.raise_error(InvalidOperation, 'sNaN', ! 1, self) if other is not None and other._isnan() == 2: ! return context.raise_error(InvalidOperation, 'sNaN', ! 1, other) if self._isnan(): ! return self if other is not None and other._isnan(): ! return other return 0 *************** *** 540,544 **** self._sign, self._int, self._exp = _string2exact(value) except ValueError: ! self._sign, self._int, self._exp = context.raise_error(ConversionSyntax) return --- 555,560 ---- self._sign, self._int, self._exp = _string2exact(value) except ValueError: ! self._sign, self._int, self._exp = \ ! context.raise_error(ConversionSyntax) return *************** *** 660,671 **** """ if self._isnan(): if self._isnan() == 2: ! return 'sNaN' ! return 'NaN' if self._isinfinity(): ! sign = self._isinfinity() ! if sign > 0: ! return 'Infinity' ! return '-Infinity' if context is None: --- 676,690 ---- """ if self._isnan(): + minus = '-'*self._sign + if self._int == (0,): + info = '' + else: + info = ''.join(map(str, self._int)) if self._isnan() == 2: ! return minus + 'sNaN' + info ! return minus + 'NaN' + info if self._isinfinity(): ! minus = '-'*self._sign ! return minus + 'Infinity' if context is None: *************** *** 675,678 **** --- 694,717 ---- numdigits = len(self._int) leftdigits = self._exp + numdigits + if eng and not self: #self = 0eX wants 0[.0[0]]eY, not [[0]0]0eY + if self._exp < 0 and self._exp >= -6: #short, no need for e/E + s = '-'*self._sign + '0.' + '0'*(abs(self._exp)) + return s + #exp is closest mult. of 3 >= self._exp + exp = ((self._exp - 1)// 3 + 1) * 3 + if exp != self._exp: + s = '0.'+'0'*(exp - self._exp) + else: + s = '0' + if exp != 0: + if context.capitals: + s += 'E' + else: + s += 'e' + if exp > 0: + s += '+' #0.0e+3, not 0.0e3 + s += str(exp) + s = '-'*self._sign + s + return s if eng: dotplace = (leftdigits-1)%3+1 *************** *** 900,904 **** if context is None: context = getcontext() ! # -Decimal(0) = Decimal(0), which we don't want # (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.) # so we change the sign directly. --- 939,946 ---- if context is None: context = getcontext() ! ans = self._check_nans(other, context=context) ! if ans: ! return ans ! # -Decimal(0) = Decimal(0), which we don't want since # (-0 - 0 = -0 + (-0) = -0, but -0 + 0 = 0.) # so we change the sign directly. *************** *** 1076,1079 **** --- 1118,1123 ---- context.raise_error(Clamped, 'Division by infinity') return Decimal((sign, (0,), context.Etiny())) + if self._isinfinity(): + return Infsign[sign] #These two have different precision. if not self: *************** *** 1089,1105 **** if not other: return context.raise_error(DivisionByZero, 'x / 0', sign) - if self._isinfinity(): - return Infsign[sign] if divmod: if other._isinfinity(): return (Decimal((sign, (0,), 0)), Decimal(self)) - if not self: - otherside = Decimal(self) - otherside._exp = min(self._exp, other._exp) - return (Decimal((sign, (0,), 0)), otherside) - - if not other: - return context.raise_error(DivisionByZero, 'divmod(x,0)', - sign, 1) if self._isinfinity(): if divmod == 1: --- 1133,1139 ---- *************** *** 1111,1114 **** --- 1145,1156 ---- return (Infsign[sign], context.raise_error(InvalidOperation, 'INF % x')) + if not self: + otherside = Decimal(self) + otherside._exp = min(self._exp, other._exp) + return (Decimal((sign, (0,), 0)), otherside) + + if not other: + return context.raise_error(DivisionByZero, 'divmod(x,0)', + sign, 1) #OK, so neither = 0, INF *************** *** 1121,1125 **** if divmod == 1 or divmod == 3: ! ans2 = Decimal(self) if shouldround: ans2 = ans2.fix(context=context) --- 1163,1168 ---- if divmod == 1 or divmod == 3: ! exp = min(self._exp, other._exp) ! ans2 = self.rescale(exp, context=context, watchexp=0) if shouldround: ans2 = ans2.fix(context=context) *************** *** 1160,1165 **** watchexp=0) context.regard_flags(*frozen) - if not otherside: - otherside._exp = 0 if shouldround: otherside = otherside.fix(context=context) --- 1203,1206 ---- *************** *** 1199,1204 **** context.regard_flags(*frozen) - if not otherside: - otherside._exp = 0 return (Decimal(res), otherside) --- 1240,1243 ---- *************** *** 1332,1336 **** """Converts self to a long, truncating if necessary.""" if self._isnan(): - context = getcontext() return context.raise_error(InvalidContext) --- 1371,1374 ---- *************** *** 1755,1763 **** if context is None: context = getcontext() ! if exp._isinfinity() or self._isinfinity(): ! return context.raise_error(InvalidOperation, 'quantize with an INF') ans = self._check_nans(exp, context) if ans: return ans return self.rescale(exp._exp, rounding, context, watchexp) --- 1793,1806 ---- if context is None: context = getcontext() ! ans = self._check_nans(exp, context) if ans: return ans + + if exp._isinfinity() or self._isinfinity(): + if exp._isinfinity() and self._isinfinity(): + return self #if both are inf, it is OK + return context.raise_error(InvalidOperation, + 'quantize with one INF') return self.rescale(exp._exp, rounding, context, watchexp) *************** *** 2491,2495 **** DEFAULT_TRAPS = BASIC_DEFAULT_TRAPS DEFAULT_FLAGS= BASIC_DEFAULT_FLAGS ! DEFAULT_ROUNDING_DECISION = EXTENDED_DEFAULT_ROUNDING_DECISION elif DEFAULT_CONTEXT == EXTENDED_DEFAULT_CONTEXT: --- 2534,2538 ---- DEFAULT_TRAPS = BASIC_DEFAULT_TRAPS DEFAULT_FLAGS= BASIC_DEFAULT_FLAGS ! DEFAULT_ROUNDING_DECISION = BASIC_DEFAULT_ROUNDING_DECISION elif DEFAULT_CONTEXT == EXTENDED_DEFAULT_CONTEXT: *************** *** 2524,2537 **** """Determines whether a string or float is NaN ! 1 => NaN ! 2 => sNaN """ if isinstance(num, float): num = str(num) num = num.lower() ! if num == 'nan': ! return 1 ! if num == 'snan': ! return 2 return 0 --- 2567,2594 ---- """Determines whether a string or float is NaN ! (1, sign, diagnostic info as string) => NaN ! (2, sign, diagnostic info as string) => sNaN ! 0 => not a NaN """ if isinstance(num, float): num = str(num) num = num.lower() ! ! #get the sign, get rid of trailing [+-] ! sign = 0 ! if num[0] == '+': ! num = num[1:] ! elif num[0] == '-': #elif avoids '+-nan' ! num = num[1:] ! sign = 1 ! ! if num.startswith('nan'): ! if len(num) > 3 and not num[3:].isdigit(): #diagnostic info ! return 0 ! return (1, sign, num[3:].lstrip('0')) ! if num.startswith('snan'): ! if len(num) > 4 and not num[4:].isdigit(): ! return 0 ! return (2, sign, num[4:].lstrip('0')) return 0 Index: test_Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_Decimal.py 12 Nov 2003 20:38:41 -0000 1.5 --- test_Decimal.py 6 Feb 2004 16:31:32 -0000 1.6 *************** *** 12,15 **** --- 12,19 ---- skip_expected = not os.path.isdir(dir) + # Make sure it actually raises errors when not expected and caught in flags + # Slower, since it runs some things several times. + EXTENDEDERRORTEST = False + #Map the test cases' error names to the actual errors *************** *** 158,161 **** --- 162,178 ---- v = FixQuotes(val) if fname in ('tosci', 'toeng'): + if EXTENDEDERRORTEST: + for error in theirexceptions: + self.context.trap_enablers[error] = 1 + try: + funct(self.context.new(v)) + except error: + pass + except ExceptionList, e: + self.fail("Raised %s in %s when %s disabled" % \ + (e, s, error)) + else: + self.fail("Did not raise %s in %s" % (error, s)) + self.context.trap_enablers[error] = 0 v = self.context.new(v) #elif fname == 'rescale' and i == 1: *************** *** 169,173 **** ans = FixQuotes(ans) ! try: result = str(funct(*vals)) --- 186,203 ---- ans = FixQuotes(ans) ! ! if EXTENDEDERRORTEST and fname not in ('tosci', 'toeng'): ! for error in theirexceptions: ! self.context.trap_enablers[error] = 1 ! try: ! funct(*vals) ! except error: ! pass ! except ExceptionList, e: ! self.fail("Raised %s in %s when %s disabled" % \ ! (e, s, error)) ! else: ! self.fail("Did not raise %s in %s" % (error, s)) ! self.context.trap_enablers[error] = 0 try: result = str(funct(*vals)) *************** *** 184,189 **** theirexceptions.sort() ! self.assertEqual(result, ans, 'Incorrect answer for ' + s + ' -- got ' + result) ! self.assertEqual(myexceptions, theirexceptions, 'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions)) --- 214,221 ---- theirexceptions.sort() ! self.assertEqual(result, ans, ! 'Incorrect answer for ' + s + ' -- got ' + result) ! self.assertEqual(myexceptions, theirexceptions, ! 'Incorrect flags set in ' + s + ' -- got ' \ + str(myexceptions)) *************** *** 268,277 **** self.eval_file(dir + 'inexact' + '.decTest') ! #def test_integer(self): ! # """Tests the Decimal class on Cowlishaw's integer tests. ! # ! # See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. ! # """ ! # self.eval_file(dir + 'integer' + '.decTest') def test_max(self): --- 300,309 ---- self.eval_file(dir + 'inexact' + '.decTest') ! def test_integer(self): ! """Tests the Decimal class on Cowlishaw's integer tests. ! ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. ! """ ! self.eval_file(dir + 'integer' + '.decTest') def test_max(self): From eprice at users.sourceforge.net Fri Feb 6 11:56:05 2004 From: eprice at users.sourceforge.net (eprice@users.sourceforge.net) Date: Fri Feb 6 11:58:45 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal Decimal.py, 1.13, 1.14 test_Decimal.py, 1.6, 1.7 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18673 Modified Files: Decimal.py test_Decimal.py Log Message: Added new tests, fix Decimal/test_Decimal to have samequantum. Index: Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/Decimal.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Decimal.py 6 Feb 2004 16:31:32 -0000 1.13 --- Decimal.py 6 Feb 2004 16:56:03 -0000 1.14 *************** *** 1805,1809 **** --- 1805,1822 ---- return self.rescale(exp._exp, rounding, context, watchexp) + def samequantum(self, other, context=None): + """Test whether self and other have the same exponent. + same as self._exp == other._exp, except NaN == sNaN + """ + if self._isnan() or other._isnan(): + if self._isnan() and other._isnan(): + return True + return False + if self._isinfinity() or other._isinfinity(): + if self._isinfinity() and other._isinfinity(): + return True + return False + return self._exp == other._exp def rescale(self, exp, rounding = None, context=None, watchexp = 1): """Rescales so that the exponent is exp. *************** *** 2282,2285 **** --- 2295,2300 ---- def rescale(self, a, b): return a.rescale(b, context=self) + def samequantum(self, a, b): + return a.samequantum(b, context=self) def squareroot(self, a): return a.sqrt(context=self) Index: test_Decimal.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_Decimal.py 6 Feb 2004 16:31:32 -0000 1.6 --- test_Decimal.py 6 Feb 2004 16:56:03 -0000 1.7 *************** *** 202,205 **** --- 202,207 ---- try: result = str(funct(*vals)) + if fname == 'samequantum': + result = str(int(eval(result))) # 'True', 'False' -> '1', '0' except ExceptionList, error: self.fail("Raised %s in %s" % (error, s)) *************** *** 244,265 **** self.context.clamp = clamp - def test_add(self): - """Tests the Decimal class on Cowlishaw's add tests. - - See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. - """ - self.eval_file(dir + 'add' + '.decTest') - def test_abs(self): """Tests the Decimal class on Cowlishaw's abs tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'abs' + '.decTest') def test_base(self): """Tests the Decimal class on Cowlishaw's base tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'base' + '.decTest') --- 246,267 ---- self.context.clamp = clamp def test_abs(self): """Tests the Decimal class on Cowlishaw's abs tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'abs' + '.decTest') + def test_add(self): + """Tests the Decimal class on Cowlishaw's add tests. + + See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. + """ + self.eval_file(dir + 'add' + '.decTest') + def test_base(self): """Tests the Decimal class on Cowlishaw's base tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'base' + '.decTest') *************** *** 268,272 **** """Tests the Decimal class on Cowlishaw's clamp tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'clamp' + '.decTest') --- 270,274 ---- """Tests the Decimal class on Cowlishaw's clamp tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'clamp' + '.decTest') *************** *** 275,279 **** """Tests the Decimal class on Cowlishaw's compare tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'compare' + '.decTest') --- 277,281 ---- """Tests the Decimal class on Cowlishaw's compare tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'compare' + '.decTest') *************** *** 282,286 **** """Tests the Decimal class on Cowlishaw's divide tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'divide' + '.decTest') --- 284,288 ---- """Tests the Decimal class on Cowlishaw's divide tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'divide' + '.decTest') *************** *** 289,293 **** """Tests the Decimal class on Cowlishaw's divideint tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'divideint' + '.decTest') --- 291,295 ---- """Tests the Decimal class on Cowlishaw's divideint tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'divideint' + '.decTest') *************** *** 296,314 **** """Tests the Decimal class on Cowlishaw's inexact tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'inexact' + '.decTest') - def test_integer(self): - """Tests the Decimal class on Cowlishaw's integer tests. - - See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. - """ - self.eval_file(dir + 'integer' + '.decTest') - def test_max(self): """Tests the Decimal class on Cowlishaw's max tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'max' + '.decTest') --- 298,309 ---- """Tests the Decimal class on Cowlishaw's inexact tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'inexact' + '.decTest') def test_max(self): """Tests the Decimal class on Cowlishaw's max tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'max' + '.decTest') *************** *** 317,321 **** """Tests the Decimal class on Cowlishaw's min tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'min' + '.decTest') --- 312,316 ---- """Tests the Decimal class on Cowlishaw's min tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'min' + '.decTest') *************** *** 324,328 **** """Tests the Decimal class on Cowlishaw's minus tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'minus' + '.decTest') --- 319,323 ---- """Tests the Decimal class on Cowlishaw's minus tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'minus' + '.decTest') *************** *** 331,335 **** """Tests the Decimal class on Cowlishaw's multiply tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir+'multiply'+'.decTest') --- 326,330 ---- """Tests the Decimal class on Cowlishaw's multiply tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir+'multiply'+'.decTest') *************** *** 338,342 **** """Tests the Decimal class on Cowlishaw's normalize tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'normalize' + '.decTest') --- 333,337 ---- """Tests the Decimal class on Cowlishaw's normalize tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'normalize' + '.decTest') *************** *** 345,349 **** """Tests the Decimal class on Cowlishaw's plus tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'plus' + '.decTest') --- 340,344 ---- """Tests the Decimal class on Cowlishaw's plus tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'plus' + '.decTest') *************** *** 352,356 **** """Tests the Decimal class on Cowlishaw's power tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'power' + '.decTest') --- 347,351 ---- """Tests the Decimal class on Cowlishaw's power tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'power' + '.decTest') *************** *** 359,363 **** """Tests the Decimal class on Cowlishaw's quantize tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'quantize' + '.decTest') --- 354,358 ---- """Tests the Decimal class on Cowlishaw's quantize tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'quantize' + '.decTest') *************** *** 366,370 **** """Tests the Decimal class on Cowlishaw's randomBound32 tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'randomBound32' + '.decTest') --- 361,365 ---- """Tests the Decimal class on Cowlishaw's randomBound32 tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'randomBound32' + '.decTest') *************** *** 373,377 **** """Tests the Decimal class on Cowlishaw's randoms tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'randoms' + '.decTest') --- 368,372 ---- """Tests the Decimal class on Cowlishaw's randoms tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'randoms' + '.decTest') *************** *** 380,384 **** """Tests the Decimal class on Cowlishaw's remainder tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'remainder' + '.decTest') --- 375,379 ---- """Tests the Decimal class on Cowlishaw's remainder tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'remainder' + '.decTest') *************** *** 387,391 **** """Tests the Decimal class on Cowlishaw's remainderNear tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'remainderNear' + '.decTest') --- 382,386 ---- """Tests the Decimal class on Cowlishaw's remainderNear tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'remainderNear' + '.decTest') *************** *** 394,405 **** """Tests the Decimal class on Cowlishaw's rounding tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'rounding' + '.decTest') def test_squareroot(self): """Tests the Decimal class on Cowlishaw's squareroot tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'squareroot' + '.decTest') --- 389,407 ---- """Tests the Decimal class on Cowlishaw's rounding tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'rounding' + '.decTest') + def test_samequantum(self): + """Tests the Decimal class on Cowlishaw's samequantum tests. + + See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. + """ + self.eval_file(dir + 'samequantum' + '.decTest') + def test_squareroot(self): """Tests the Decimal class on Cowlishaw's squareroot tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'squareroot' + '.decTest') *************** *** 408,412 **** """Tests the Decimal class on Cowlishaw's subtract tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'subtract' + '.decTest') --- 410,414 ---- """Tests the Decimal class on Cowlishaw's subtract tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'subtract' + '.decTest') *************** *** 415,419 **** """Tests the Decimal class on Cowlishaw's tointegral tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'tointegral' + '.decTest') --- 417,421 ---- """Tests the Decimal class on Cowlishaw's tointegral tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'tointegral' + '.decTest') *************** *** 422,426 **** """Tests the Decimal class on Cowlishaw's trim tests. ! See www2.hursley.ibm.com/decimal/decTest.zip to download the suite. """ self.eval_file(dir + 'trim' + '.decTest') --- 424,428 ---- """Tests the Decimal class on Cowlishaw's trim tests. ! See www2.hursley.ibm.com/decimal/dectest.zip to download the suite. """ self.eval_file(dir + 'trim' + '.decTest') From eprice at users.sourceforge.net Fri Feb 6 11:56:07 2004 From: eprice at users.sourceforge.net (eprice@users.sourceforge.net) Date: Fri Feb 6 11:58:49 2004 Subject: [Python-checkins] python/nondist/sandbox/decimal/tests samequantum.decTest, NONE, 1.1 abs.decTest, 1.4, 1.5 add.decTest, 1.4, 1.5 base.decTest, 1.4, 1.5 clamp.decTest, 1.4, 1.5 compare.decTest, 1.4, 1.5 divide.decTest, 1.4, 1.5 divideint.decTest, 1.4, 1.5 inexact.decTest, 1.4, 1.5 max.decTest, 1.4, 1.5 min.decTest, 1.4, 1.5 minus.decTest, 1.4, 1.5 multiply.decTest, 1.4, 1.5 normalize.decTest, 1.4, 1.5 plus.decTest, 1.4, 1.5 power.decTest, 1.4, 1.5 quantize.decTest, 1.2, 1.3 randomBound32.decTest, 1.4, 1.5 randoms.decTest, 1.4, 1.5 remainder.decTest, 1.4, 1.5 remainderNear.decTest, 1.4, 1.5 rescale.decTest, 1.4, 1.5 rounding.decTest, 1.4, 1.5 squareroot.decTest, 1.4, 1.5 subtract.decTest, 1.4, 1.5 testall.decTest, 1.4, 1.5 tointegral.decTest, 1.1, 1.2 trim.decTest, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/decimal/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18673/tests Modified Files: abs.decTest add.decTest base.decTest clamp.decTest compare.decTest divide.decTest divideint.decTest inexact.decTest max.decTest min.decTest minus.decTest multiply.decTest normalize.decTest plus.decTest power.decTest quantize.decTest randomBound32.decTest randoms.decTest remainder.decTest remainderNear.decTest rescale.decTest rounding.decTest squareroot.decTest subtract.decTest testall.decTest tointegral.decTest trim.decTest Added Files: samequantum.decTest Log Message: Added new tests, fix Decimal/test_Decimal to have samequantum. --- NEW FILE: samequantum.decTest --- ------------------------------------------------------------------------ -- samequantum.decTest -- check quantums match -- -- Copyright (c) IBM Corporation, 2001, 2003. All rights reserved. -- ------------------------------------------------------------------------ -- Please see the document "General Decimal Arithmetic Testcases" -- -- at http://www2.hursley.ibm.com/decimal for the description of -- -- these testcases. -- -- -- -- These testcases are experimental ('beta' versions), and they -- -- may contain errors. They are offered on an as-is basis. In -- -- particular, achieving the same results as the tests here is not -- -- a guarantee that an implementation complies with any Standard -- -- or specification. The tests are not exhaustive. -- -- -- -- Please send comments, suggestions, and corrections to the author: -- -- Mike Cowlishaw, IBM Fellow -- -- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK -- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ version: 2.35 extended: 1 precision: 9 rounding: half_up maxExponent: 999 minExponent: -999 samq001 samequantum 0 0 -> 1 samq002 samequantum 0 1 -> 1 samq003 samequantum 1 0 -> 1 samq004 samequantum 1 1 -> 1 samq011 samequantum 10 1E+1 -> 0 samq012 samequantum 10E+1 10E+1 -> 1 samq013 samequantum 100 10E+1 -> 0 samq014 samequantum 100 1E+2 -> 0 samq015 samequantum 0.1 1E-2 -> 0 samq016 samequantum 0.1 1E-1 -> 1 samq017 samequantum 0.1 1E-0 -> 0 samq018 samequantum 999 999 -> 1 samq019 samequantum 999E-1 99.9 -> 1 samq020 samequantum 111E-1 22.2 -> 1 samq021 samequantum 111E-1 1234.2 -> 1 -- zeros samq030 samequantum 0.0 1.1 -> 1 samq031 samequantum 0.0 1.11 -> 0 samq032 samequantum 0.0 0 -> 0 samq033 samequantum 0.0 0.0 -> 1 samq034 samequantum 0.0 0.00 -> 0 samq035 samequantum 0E+1 0E+0 -> 0 samq036 samequantum 0E+1 0E+1 -> 1 samq037 samequantum 0E+1 0E+2 -> 0 samq038 samequantum 0E-17 0E-16 -> 0 samq039 samequantum 0E-17 0E-17 -> 1 samq040 samequantum 0E-17 0E-18 -> 0 samq041 samequantum 0E-17 0.0E-15 -> 0 samq042 samequantum 0E-17 0.0E-16 -> 1 samq043 samequantum 0E-17 0.0E-17 -> 0 samq044 samequantum -0E-17 0.0E-16 -> 1 samq045 samequantum 0E-17 -0.0E-17 -> 0 samq046 samequantum 0E-17 -0.0E-16 -> 1 samq047 samequantum -0E-17 0.0E-17 -> 0 samq048 samequantum -0E-17 -0.0E-16 -> 1 samq049 samequantum -0E-17 -0.0E-17 -> 0 -- specials & combinations samq0110 samequantum -Inf -Inf -> 1 samq0111 samequantum -Inf Inf -> 1 samq0112 samequantum -Inf NaN -> 0 samq0113 samequantum -Inf -7E+3 -> 0 samq0114 samequantum -Inf -7 -> 0 samq0115 samequantum -Inf -7E-3 -> 0 samq0116 samequantum -Inf -0E-3 -> 0 samq0117 samequantum -Inf -0 -> 0 samq0118 samequantum -Inf -0E+3 -> 0 samq0119 samequantum -Inf 0E-3 -> 0 samq0120 samequantum -Inf 0 -> 0 samq0121 samequantum -Inf 0E+3 -> 0 samq0122 samequantum -Inf 7E-3 -> 0 samq0123 samequantum -Inf 7 -> 0 samq0124 samequantum -Inf 7E+3 -> 0 samq0125 samequantum -Inf sNaN -> 0 samq0210 samequantum Inf -Inf -> 1 samq0211 samequantum Inf Inf -> 1 samq0212 samequantum Inf NaN -> 0 samq0213 samequantum Inf -7E+3 -> 0 samq0214 samequantum Inf -7 -> 0 samq0215 samequantum Inf -7E-3 -> 0 samq0216 samequantum Inf -0E-3 -> 0 samq0217 samequantum Inf -0 -> 0 samq0218 samequantum Inf -0E+3 -> 0 samq0219 samequantum Inf 0E-3 -> 0 samq0220 samequantum Inf 0 -> 0 samq0221 samequantum Inf 0E+3 -> 0 samq0222 samequantum Inf 7E-3 -> 0 samq0223 samequantum Inf 7 -> 0 samq0224 samequantum Inf 7E+3 -> 0 samq0225 samequantum Inf sNaN -> 0 samq0310 samequantum NaN -Inf -> 0 samq0311 samequantum NaN Inf -> 0 samq0312 samequantum NaN NaN -> 1 samq0313 samequantum NaN -7E+3 -> 0 samq0314 samequantum NaN -7 -> 0 samq0315 samequantum NaN -7E-3 -> 0 samq0316 samequantum NaN -0E-3 -> 0 samq0317 samequantum NaN -0 -> 0 samq0318 samequantum NaN -0E+3 -> 0 samq0319 samequantum NaN 0E-3 -> 0 samq0320 samequantum NaN 0 -> 0 samq0321 samequantum NaN 0E+3 -> 0 samq0322 samequantum NaN 7E-3 -> 0 samq0323 samequantum NaN 7 -> 0 samq0324 samequantum NaN 7E+3 -> 0 samq0325 samequantum NaN sNaN -> 1 samq0410 samequantum -7E+3 -Inf -> 0 samq0411 samequantum -7E+3 Inf -> 0 samq0412 samequantum -7E+3 NaN -> 0 samq0413 samequantum -7E+3 -7E+3 -> 1 samq0414 samequantum -7E+3 -7 -> 0 samq0415 samequantum -7E+3 -7E-3 -> 0 samq0416 samequantum -7E+3 -0E-3 -> 0 samq0417 samequantum -7E+3 -0 -> 0 samq0418 samequantum -7E+3 -0E+3 -> 1 samq0419 samequantum -7E+3 0E-3 -> 0 samq0420 samequantum -7E+3 0 -> 0 samq0421 samequantum -7E+3 0E+3 -> 1 samq0422 samequantum -7E+3 7E-3 -> 0 samq0423 samequantum -7E+3 7 -> 0 samq0424 samequantum -7E+3 7E+3 -> 1 samq0425 samequantum -7E+3 sNaN -> 0 samq0510 samequantum -7 -Inf -> 0 samq0511 samequantum -7 Inf -> 0 samq0512 samequantum -7 NaN -> 0 samq0513 samequantum -7 -7E+3 -> 0 samq0514 samequantum -7 -7 -> 1 samq0515 samequantum -7 -7E-3 -> 0 samq0516 samequantum -7 -0E-3 -> 0 samq0517 samequantum -7 -0 -> 1 samq0518 samequantum -7 -0E+3 -> 0 samq0519 samequantum -7 0E-3 -> 0 samq0520 samequantum -7 0 -> 1 samq0521 samequantum -7 0E+3 -> 0 samq0522 samequantum -7 7E-3 -> 0 samq0523 samequantum -7 7 -> 1 samq0524 samequantum -7 7E+3 -> 0 samq0525 samequantum -7 sNaN -> 0 samq0610 samequantum -7E-3 -Inf -> 0 samq0611 samequantum -7E-3 Inf -> 0 samq0612 samequantum -7E-3 NaN -> 0 samq0613 samequantum -7E-3 -7E+3 -> 0 samq0614 samequantum -7E-3 -7 -> 0 samq0615 samequantum -7E-3 -7E-3 -> 1 samq0616 samequantum -7E-3 -0E-3 -> 1 samq0617 samequantum -7E-3 -0 -> 0 samq0618 samequantum -7E-3 -0E+3 -> 0 samq0619 samequantum -7E-3 0E-3 -> 1 samq0620 samequantum -7E-3 0 -> 0 samq0621 samequantum -7E-3 0E+3 -> 0 samq0622 samequantum -7E-3 7E-3 -> 1 samq0623 samequantum -7E-3 7 -> 0 samq0624 samequantum -7E-3 7E+3 -> 0 samq0625 samequantum -7E-3 sNaN -> 0 samq0710 samequantum -0E-3 -Inf -> 0 samq0711 samequantum -0E-3 Inf -> 0 samq0712 samequantum -0E-3 NaN -> 0 samq0713 samequantum -0E-3 -7E+3 -> 0 samq0714 samequantum -0E-3 -7 -> 0 samq0715 samequantum -0E-3 -7E-3 -> 1 samq0716 samequantum -0E-3 -0E-3 -> 1 samq0717 samequantum -0E-3 -0 -> 0 samq0718 samequantum -0E-3 -0E+3 -> 0 samq0719 samequantum -0E-3 0E-3 -> 1 samq0720 samequantum -0E-3 0 -> 0 samq0721 samequantum -0E-3 0E+3 -> 0 samq0722 samequantum -0E-3 7E-3 -> 1 samq0723 samequantum -0E-3 7 -> 0 samq0724 samequantum -0E-3 7E+3 -> 0 samq0725 samequantum -0E-3 sNaN -> 0 samq0810 samequantum -0 -Inf -> 0 samq0811 samequantum -0 Inf -> 0 samq0812 samequantum -0 NaN -> 0 samq0813 samequantum -0 -7E+3 -> 0 samq0814 samequantum -0 -7 -> 1 samq0815 samequantum -0 -7E-3 -> 0 samq0816 samequantum -0 -0E-3 -> 0 samq0817 samequantum -0 -0 -> 1 samq0818 samequantum -0 -0E+3 -> 0 samq0819 samequantum -0 0E-3 -> 0 samq0820 samequantum -0 0 -> 1 samq0821 samequantum -0 0E+3 -> 0 samq0822 samequantum -0 7E-3 -> 0 samq0823 samequantum -0 7 -> 1 samq0824 samequantum -0 7E+3 -> 0 samq0825 samequantum -0 sNaN -> 0 samq0910 samequantum -0E+3 -Inf -> 0 samq0911 samequantum -0E+3 Inf -> 0 samq0912 samequantum -0E+3 NaN -> 0 samq0913 samequantum -0E+3 -7E+3 -> 1 samq0914 samequantum -0E+3 -7 -> 0 samq0915 samequantum -0E+3 -7E-3 -> 0 samq0916 samequantum -0E+3 -0E-3 -> 0 samq0917 samequantum -0E+3 -0 -> 0 samq0918 samequantum -0E+3 -0E+3 -> 1 samq0919 samequantum -0E+3 0E-3 -> 0 samq0920 samequantum -0E+3 0 -> 0 samq0921 samequantum -0E+3 0E+3 -> 1 samq0922 samequantum -0E+3 7E-3 -> 0 samq0923 samequantum -0E+3 7 -> 0 samq0924 samequantum -0E+3 7E+3 -> 1 samq0925 samequantum -0E+3 sNaN -> 0 samq1110 samequantum 0E-3 -Inf -> 0 samq1111 samequantum 0E-3 Inf -> 0 samq1112 samequantum 0E-3 NaN -> 0 samq1113 samequantum 0E-3 -7E+3 -> 0 samq1114 samequantum 0E-3 -7 -> 0 samq1115 samequantum 0E-3 -7E-3 -> 1 samq1116 samequantum 0E-3 -0E-3 -> 1 samq1117 samequantum 0E-3 -0 -> 0 samq1118 samequantum 0E-3 -0E+3 -> 0 samq1119 samequantum 0E-3 0E-3 -> 1 samq1120 samequantum 0E-3 0 -> 0 samq1121 samequantum 0E-3 0E+3 -> 0 samq1122 samequantum 0E-3 7E-3 -> 1 samq1123 samequantum 0E-3 7 -> 0 samq1124 samequantum 0E-3 7E+3 -> 0 samq1125 samequantum 0E-3 sNaN -> 0 samq1210 samequantum 0 -Inf -> 0 samq1211 samequantum 0 Inf -> 0 samq1212 samequantum 0 NaN -> 0 samq1213 samequantum 0 -7E+3 -> 0 samq1214 samequantum 0 -7 -> 1 samq1215 samequantum 0 -7E-3 -> 0 samq1216 samequantum 0 -0E-3 -> 0 samq1217 samequantum 0 -0 -> 1 samq1218 samequantum 0 -0E+3 -> 0 samq1219 samequantum 0 0E-3 -> 0 samq1220 samequantum 0 0 -> 1 samq1221 samequantum 0 0E+3 -> 0 samq1222 samequantum 0 7E-3 -> 0 samq1223 samequantum 0 7 -> 1 samq1224 samequantum 0 7E+3 -> 0 samq1225 samequantum 0 sNaN -> 0 samq1310 samequantum 0E+3 -Inf -> 0 samq1311 samequantum 0E+3 Inf -> 0 samq1312 samequantum 0E+3 NaN -> 0 samq1313 samequantum 0E+3 -7E+3 -> 1 samq1314 samequantum 0E+3 -7 -> 0 samq1315 samequantum 0E+3 -7E-3 -> 0 samq1316 samequantum 0E+3 -0E-3 -> 0 samq1317 samequantum 0E+3 -0 -> 0 samq1318 samequantum 0E+3 -0E+3 -> 1 samq1319 samequantum 0E+3 0E-3 -> 0 samq1320 samequantum 0E+3 0 -> 0 samq1321 samequantum 0E+3 0E+3 -> 1 samq1322 samequantum 0E+3 7E-3 -> 0 samq1323 samequantum 0E+3 7 -> 0 samq1324 samequantum 0E+3 7E+3 -> 1 samq1325 samequantum 0E+3 sNaN -> 0 samq1410 samequantum 7E-3 -Inf -> 0 samq1411 samequantum 7E-3 Inf -> 0 samq1412 samequantum 7E-3 NaN -> 0 samq1413 samequantum 7E-3 -7E+3 -> 0 samq1414 samequantum 7E-3 -7 -> 0 samq1415 samequantum 7E-3 -7E-3 -> 1 samq1416 samequantum 7E-3 -0E-3 -> 1 samq1417 samequantum 7E-3 -0 -> 0 samq1418 samequantum 7E-3 -0E+3 -> 0 samq1419 samequantum 7E-3 0E-3 -> 1 samq1420 samequantum 7E-3 0 -> 0 samq1421 samequantum 7E-3 0E+3 -> 0 samq1422 samequantum 7E-3 7E-3 -> 1 samq1423 samequantum 7E-3 7 -> 0 samq1424 samequantum 7E-3 7E+3 -> 0 samq1425 samequantum 7E-3 sNaN -> 0 samq1510 samequantum 7 -Inf -> 0 samq1511 samequantum 7 Inf -> 0 samq1512 samequantum 7 NaN -> 0 samq1513 samequantum 7 -7E+3 -> 0 samq1514 samequantum 7 -7 -> 1 samq1515 samequantum 7 -7E-3 -> 0 samq1516 samequantum 7 -0E-3 -> 0 samq1517 samequantum 7 -0 -> 1 samq1518 samequantum 7 -0E+3 -> 0 samq1519 samequantum 7 0E-3 -> 0 samq1520 samequantum 7 0 -> 1 samq1521 samequantum 7 0E+3 -> 0 samq1522 samequantum 7 7E-3 -> 0 samq1523 samequantum 7 7 -> 1 samq1524 samequantum 7 7E+3 -> 0 samq1525 samequantum 7 sNaN -> 0 samq1610 samequantum 7E+3 -Inf -> 0 samq1611 samequantum 7E+3 Inf -> 0 samq1612 samequantum 7E+3 NaN -> 0 samq1613 samequantum 7E+3 -7E+3 -> 1 samq1614 samequantum 7E+3 -7 -> 0 samq1615 samequantum 7E+3 -7E-3 -> 0 samq1616 samequantum 7E+3 -0E-3 -> 0 samq1617 samequantum 7E+3 -0 -> 0 samq1618 samequantum 7E+3 -0E+3 -> 1 samq1619 samequantum 7E+3 0E-3 -> 0 samq1620 samequantum 7E+3 0 -> 0 samq1621 samequantum 7E+3 0E+3 -> 1 samq1622 samequantum 7E+3 7E-3 -> 0 samq1623 samequantum 7E+3 7 -> 0 samq1624 samequantum 7E+3 7E+3 -> 1 samq1625 samequantum 7E+3 sNaN -> 0 samq1710 samequantum sNaN -Inf -> 0 samq1711 samequantum sNaN Inf -> 0 samq1712 samequantum sNaN NaN -> 1 samq1713 samequantum sNaN -7E+3 -> 0 samq1714 samequantum sNaN -7 -> 0 samq1715 samequantum sNaN -7E-3 -> 0 samq1716 samequantum sNaN -0E-3 -> 0 samq1717 samequantum sNaN -0 -> 0 samq1718 samequantum sNaN -0E+3 -> 0 samq1719 samequantum sNaN 0E-3 -> 0 samq1720 samequantum sNaN 0 -> 0 samq1721 samequantum sNaN 0E+3 -> 0 samq1722 samequantum sNaN 7E-3 -> 0 samq1723 samequantum sNaN 7 -> 0 samq1724 samequantum sNaN 7E+3 -> 0 samq1725 samequantum sNaN sNaN -> 1 -- noisy NaNs samq1730 samequantum sNaN3 sNaN3 -> 1 samq1731 samequantum sNaN3 sNaN4 -> 1 samq1732 samequantum NaN3 NaN3 -> 1 samq1733 samequantum NaN3 NaN4 -> 1 samq1734 samequantum sNaN3 3 -> 0 samq1735 samequantum NaN3 3 -> 0 samq1736 samequantum 4 sNaN4 -> 0 samq1737 samequantum 3 NaN3 -> 0 samq1738 samequantum Inf sNaN4 -> 0 samq1739 samequantum -Inf NaN3 -> 0 Index: abs.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/abs.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** abs.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- abs.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests primarily tests the existence of the operator. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- This set of tests primarily tests the existence of the operator. *************** *** 151,155 **** absx521 abs '-Inf' -> 'Infinity' absx522 abs NaN -> NaN ! absx523 abs sNaN -> NaN Invalid_operation -- Null tests --- 151,159 ---- absx521 abs '-Inf' -> 'Infinity' absx522 abs NaN -> NaN ! absx523 abs sNaN -> NaN Invalid_operation ! absx524 abs NaN22 -> NaN22 ! absx525 abs sNaN33 -> NaN33 Invalid_operation ! absx526 abs -NaN22 -> -NaN22 ! absx527 abs -sNaN33 -> -NaN33 Invalid_operation -- Null tests Index: add.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/add.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** add.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- add.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 precision: 9 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 precision: 9 *************** *** 833,836 **** --- 833,837 ---- addx792 add 1 -Inf -> -Infinity addx793 add 1000 -Inf -> -Infinity + addx794 add Inf -Inf -> NaN Invalid_operation addx800 add Inf -Inf -> NaN Invalid_operation *************** *** 889,916 **** addx859 add NaN sNaN -> NaN Invalid_operation -- overflow, underflow and subnormal tests maxexponent: 999999999 minexponent: -999999999 precision: 9 ! addx860 add 1E+999999999 9E+999999999 -> Infinity Overflow Inexact Rounded ! addx861 add 9E+999999999 1E+999999999 -> Infinity Overflow Inexact Rounded ! addx862 add -1.1E-999999999 1E-999999999 -> -1E-1000000000 Subnormal ! addx863 add 1E-999999999 -1.1e-999999999 -> -1E-1000000000 Subnormal ! addx864 add -1.0001E-999999999 1E-999999999 -> -1E-1000000003 Subnormal ! addx865 add 1E-999999999 -1.0001e-999999999 -> -1E-1000000003 Subnormal ! addx866 add -1E+999999999 -9E+999999999 -> -Infinity Overflow Inexact Rounded ! addx867 add -9E+999999999 -1E+999999999 -> -Infinity Overflow Inexact Rounded ! addx868 add +1.1E-999999999 -1E-999999999 -> 1E-1000000000 Subnormal ! addx869 add -1E-999999999 +1.1e-999999999 -> 1E-1000000000 Subnormal ! addx870 add +1.0001E-999999999 -1E-999999999 -> 1E-1000000003 Subnormal ! addx871 add -1E-999999999 +1.0001e-999999999 -> 1E-1000000003 Subnormal ! addx872 add -1E+999999999 +9E+999999999 -> 8E+999999999 ! addx873 add -9E+999999999 +1E+999999999 -> -8E+999999999 precision: 3 ! addx880 add 0 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded ! addx881 add -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded ! addx882 add 0 9.999E+999999999 -> Infinity Inexact Overflow Rounded ! addx883 add 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded precision: 3 --- 890,943 ---- addx859 add NaN sNaN -> NaN Invalid_operation + -- propagating NaNs + addx861 add NaN1 -Inf -> NaN1 + addx862 add +NaN2 -1000 -> NaN2 + addx863 add NaN3 1000 -> NaN3 + addx864 add NaN4 Inf -> NaN4 + addx865 add NaN5 +NaN6 -> NaN5 + addx866 add -Inf NaN7 -> NaN7 + addx867 add -1000 NaN8 -> NaN8 + addx868 add 1000 NaN9 -> NaN9 + addx869 add Inf +NaN10 -> NaN10 + addx871 add sNaN11 -Inf -> NaN11 Invalid_operation + addx872 add sNaN12 -1000 -> NaN12 Invalid_operation + addx873 add sNaN13 1000 -> NaN13 Invalid_operation + addx874 add sNaN14 NaN17 -> NaN14 Invalid_operation + addx875 add sNaN15 sNaN18 -> NaN15 Invalid_operation + addx876 add NaN16 sNaN19 -> NaN19 Invalid_operation + addx877 add -Inf +sNaN20 -> NaN20 Invalid_operation + addx878 add -1000 sNaN21 -> NaN21 Invalid_operation + addx879 add 1000 sNaN22 -> NaN22 Invalid_operation + addx880 add Inf sNaN23 -> NaN23 Invalid_operation + addx881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation + addx882 add -NaN26 NaN28 -> -NaN26 + addx883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation + addx884 add 1000 -NaN30 -> -NaN30 + addx885 add 1000 -sNaN31 -> -NaN31 Invalid_operation + -- overflow, underflow and subnormal tests maxexponent: 999999999 minexponent: -999999999 precision: 9 ! addx890 add 1E+999999999 9E+999999999 -> Infinity Overflow Inexact Rounded ! addx891 add 9E+999999999 1E+999999999 -> Infinity Overflow Inexact Rounded ! addx892 add -1.1E-999999999 1E-999999999 -> -1E-1000000000 Subnormal ! addx893 add 1E-999999999 -1.1e-999999999 -> -1E-1000000000 Subnormal ! addx894 add -1.0001E-999999999 1E-999999999 -> -1E-1000000003 Subnormal ! addx895 add 1E-999999999 -1.0001e-999999999 -> -1E-1000000003 Subnormal ! addx896 add -1E+999999999 -9E+999999999 -> -Infinity Overflow Inexact Rounded ! addx897 add -9E+999999999 -1E+999999999 -> -Infinity Overflow Inexact Rounded ! addx898 add +1.1E-999999999 -1E-999999999 -> 1E-1000000000 Subnormal ! addx899 add -1E-999999999 +1.1e-999999999 -> 1E-1000000000 Subnormal ! addx900 add +1.0001E-999999999 -1E-999999999 -> 1E-1000000003 Subnormal ! addx901 add -1E-999999999 +1.0001e-999999999 -> 1E-1000000003 Subnormal ! addx902 add -1E+999999999 +9E+999999999 -> 8E+999999999 ! addx903 add -9E+999999999 +1E+999999999 -> -8E+999999999 precision: 3 ! addx904 add 0 -9.999E+999999999 -> -Infinity Inexact Overflow Rounded ! addx905 add -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded ! addx906 add 0 9.999E+999999999 -> Infinity Inexact Overflow Rounded ! addx907 add 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded precision: 3 *************** *** 968,971 **** --- 995,1031 ---- addx971 add 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow + -- check overflow edge case + precision: 7 + rounding: half_up + maxExponent: 96 + minExponent: -95 + addx972 apply 9.999999E+96 -> 9.999999E+96 + addx973 add 9.999999E+96 1 -> 9.999999E+96 Inexact Rounded + addx974 add 9999999E+90 1 -> 9.999999E+96 Inexact Rounded + addx975 add 9999999E+90 1E+90 -> Infinity Overflow Inexact Rounded + addx976 add 9999999E+90 9E+89 -> Infinity Overflow Inexact Rounded + addx977 add 9999999E+90 8E+89 -> Infinity Overflow Inexact Rounded + addx978 add 9999999E+90 7E+89 -> Infinity Overflow Inexact Rounded + addx979 add 9999999E+90 6E+89 -> Infinity Overflow Inexact Rounded + addx980 add 9999999E+90 5E+89 -> Infinity Overflow Inexact Rounded + addx981 add 9999999E+90 4E+89 -> 9.999999E+96 Inexact Rounded + addx982 add 9999999E+90 3E+89 -> 9.999999E+96 Inexact Rounded + addx983 add 9999999E+90 2E+89 -> 9.999999E+96 Inexact Rounded + addx984 add 9999999E+90 1E+89 -> 9.999999E+96 Inexact Rounded + + addx985 apply -9.999999E+96 -> -9.999999E+96 + addx986 add -9.999999E+96 -1 -> -9.999999E+96 Inexact Rounded + addx987 add -9999999E+90 -1 -> -9.999999E+96 Inexact Rounded + addx988 add -9999999E+90 -1E+90 -> -Infinity Overflow Inexact Rounded + addx989 add -9999999E+90 -9E+89 -> -Infinity Overflow Inexact Rounded + addx990 add -9999999E+90 -8E+89 -> -Infinity Overflow Inexact Rounded + addx991 add -9999999E+90 -7E+89 -> -Infinity Overflow Inexact Rounded + addx992 add -9999999E+90 -6E+89 -> -Infinity Overflow Inexact Rounded + addx993 add -9999999E+90 -5E+89 -> -Infinity Overflow Inexact Rounded + addx994 add -9999999E+90 -4E+89 -> -9.999999E+96 Inexact Rounded + addx995 add -9999999E+90 -3E+89 -> -9.999999E+96 Inexact Rounded + addx996 add -9999999E+90 -2E+89 -> -9.999999E+96 Inexact Rounded + addx997 add -9999999E+90 -1E+89 -> -9.999999E+96 Inexact Rounded + -- check for double-rounded subnormals precision: 5 Index: base.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/base.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** base.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- base.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This file tests base conversions from string to a decimal number --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- This file tests base conversions from string to a decimal number *************** *** 353,356 **** --- 353,357 ---- basx411 toSci 7E-13 -> 7E-13 basx412 toEng 7E-13 -> 700E-15 + -- Exacts remain exact up to precision .. precision: 9 *************** *** 566,597 **** basx567 toSci "Infinit" -> NaN Conversion_syntax basx568 toSci "-Infinit" -> NaN Conversion_syntax ! basx569 toSci "-sNa" -> NaN Conversion_syntax -- subnormals and overflows ! basx570 toSci '99e999999999' -> Infinity Overflow Inexact Rounded ! basx571 toSci '999e999999999' -> Infinity Overflow Inexact Rounded ! basx572 toSci '0.9e-999999999' -> 9E-1000000000 Subnormal ! basx573 toSci '0.09e-999999999' -> 9E-1000000001 Subnormal ! basx574 toSci '0.1e1000000000' -> 1E+999999999 ! basx575 toSci '10e-1000000000' -> 1.0E-999999999 ! basx576 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded ! basx577 toSci '99e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded ! basx578 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded ! basx579 toSci '1111e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded ! basx580 toSci '1111e-99999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded ! basx581 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded -- negatives the same ! basx582 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded ! basx583 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded ! basx584 toSci '-0.9e-999999999' -> -9E-1000000000 Subnormal ! basx585 toSci '-0.09e-999999999' -> -9E-1000000001 Subnormal ! basx586 toSci '-0.1e1000000000' -> -1E+999999999 ! basx587 toSci '-10e-1000000000' -> -1.0E-999999999 ! basx588 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded ! basx589 toSci '-99e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded ! basx590 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded ! basx591 toSci '-1111e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded ! basx592 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded ! basx593 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded -- Zeros --- 567,604 ---- basx567 toSci "Infinit" -> NaN Conversion_syntax basx568 toSci "-Infinit" -> NaN Conversion_syntax ! basx569 toSci "0Inf" -> NaN Conversion_syntax ! basx570 toSci "9Inf" -> NaN Conversion_syntax ! basx571 toSci "-0Inf" -> NaN Conversion_syntax ! basx572 toSci "-9Inf" -> NaN Conversion_syntax ! basx573 toSci "-sNa" -> NaN Conversion_syntax ! basx574 toSci "xNaN" -> NaN Conversion_syntax ! basx575 toSci "0sNaN" -> NaN Conversion_syntax -- subnormals and overflows ! basx576 toSci '99e999999999' -> Infinity Overflow Inexact Rounded ! basx577 toSci '999e999999999' -> Infinity Overflow Inexact Rounded ! basx578 toSci '0.9e-999999999' -> 9E-1000000000 Subnormal ! basx579 toSci '0.09e-999999999' -> 9E-1000000001 Subnormal ! basx580 toSci '0.1e1000000000' -> 1E+999999999 ! basx581 toSci '10e-1000000000' -> 1.0E-999999999 ! basx582 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded ! basx583 toSci '99e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded ! basx584 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded ! basx585 toSci '1111e-9999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded ! basx586 toSci '1111e-99999999999' -> 0E-1000000007 Underflow Subnormal Inexact Rounded ! basx587 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded -- negatives the same ! basx588 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded ! basx589 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded ! basx590 toSci '-0.9e-999999999' -> -9E-1000000000 Subnormal ! basx591 toSci '-0.09e-999999999' -> -9E-1000000001 Subnormal ! basx592 toSci '-0.1e1000000000' -> -1E+999999999 ! basx593 toSci '-10e-1000000000' -> -1.0E-999999999 ! basx594 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded ! basx595 toSci '-99e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded ! basx596 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded ! basx597 toSci '-1111e-9999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded ! basx598 toSci '-1111e-99999999999' -> -0E-1000000007 Underflow Subnormal Inexact Rounded ! basx599 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded -- Zeros *************** *** 675,716 **** -- Specials basx700 toSci "NaN" -> NaN basx701 toSci "nan" -> NaN basx702 toSci "nAn" -> NaN basx703 toSci "NAN" -> NaN ! basx704 toSci "+NaN" -> NaN Conversion_syntax ! basx705 toSci "+nan" -> NaN Conversion_syntax ! basx706 toSci "+nAn" -> NaN Conversion_syntax ! basx707 toSci "+NAN" -> NaN Conversion_syntax ! basx708 toSci "-NaN" -> NaN Conversion_syntax ! basx709 toSci "-nan" -> NaN Conversion_syntax ! basx710 toSci "-nAn" -> NaN Conversion_syntax ! basx711 toSci "-NAN" -> NaN Conversion_syntax ! basx720 toSci "sNaN" -> sNaN ! basx721 toSci "snan" -> sNaN ! basx722 toSci "SnAn" -> sNaN ! basx723 toSci "SNAN" -> sNaN ! basx724 toSci "+sNaN" -> NaN Conversion_syntax ! basx725 toSci "+snan" -> NaN Conversion_syntax ! basx726 toSci "+SnAn" -> NaN Conversion_syntax ! basx727 toSci "+SNAN" -> NaN Conversion_syntax ! basx728 toSci "-sNaN" -> NaN Conversion_syntax ! basx729 toSci "-snan" -> NaN Conversion_syntax ! basx730 toSci "-SnAn" -> NaN Conversion_syntax ! basx731 toSci "-SNAN" -> NaN Conversion_syntax ! basx740 toSci "Inf" -> Infinity ! basx741 toSci "inf" -> Infinity ! basx742 toSci "iNf" -> Infinity ! basx743 toSci "INF" -> Infinity ! basx744 toSci "+Inf" -> Infinity ! basx745 toSci "+inf" -> Infinity ! basx746 toSci "+iNf" -> Infinity ! basx747 toSci "+INF" -> Infinity ! basx748 toSci "-Inf" -> -Infinity ! basx749 toSci "-inf" -> -Infinity ! basx750 toSci "-iNf" -> -Infinity ! basx751 toSci "-INF" -> -Infinity basx760 toSci "Infinity" -> Infinity --- 682,748 ---- -- Specials + precision: 4 basx700 toSci "NaN" -> NaN basx701 toSci "nan" -> NaN basx702 toSci "nAn" -> NaN basx703 toSci "NAN" -> NaN ! basx704 toSci "+NaN" -> NaN ! basx705 toSci "+nan" -> NaN ! basx706 toSci "+nAn" -> NaN ! basx707 toSci "+NAN" -> NaN ! basx708 toSci "-NaN" -> -NaN ! basx709 toSci "-nan" -> -NaN ! basx710 toSci "-nAn" -> -NaN ! basx711 toSci "-NAN" -> -NaN ! basx712 toSci 'NaN0' -> NaN ! basx713 toSci 'NaN1' -> NaN1 ! basx714 toSci 'NaN12' -> NaN12 ! basx715 toSci 'NaN123' -> NaN123 ! basx716 toSci 'NaN1234' -> NaN1234 ! basx717 toSci 'NaN01' -> NaN1 ! basx718 toSci 'NaN012' -> NaN12 ! basx719 toSci 'NaN0123' -> NaN123 ! basx720 toSci 'NaN01234' -> NaN1234 ! basx721 toSci 'NaN001' -> NaN1 ! basx722 toSci 'NaN0012' -> NaN12 ! basx723 toSci 'NaN00123' -> NaN123 ! basx724 toSci 'NaN001234' -> NaN1234 ! basx725 toSci 'NaN12345' -> NaN Conversion_syntax ! basx726 toSci 'NaN123e+1' -> NaN Conversion_syntax ! basx727 toSci 'NaN12.45' -> NaN Conversion_syntax ! basx728 toSci 'NaN-12' -> NaN Conversion_syntax ! basx729 toSci 'NaN+12' -> NaN Conversion_syntax ! basx730 toSci "sNaN" -> sNaN ! basx731 toSci "snan" -> sNaN ! basx732 toSci "SnAn" -> sNaN ! basx733 toSci "SNAN" -> sNaN ! basx734 toSci "+sNaN" -> sNaN ! basx735 toSci "+snan" -> sNaN ! basx736 toSci "+SnAn" -> sNaN ! basx737 toSci "+SNAN" -> sNaN ! basx738 toSci "-sNaN" -> -sNaN ! basx739 toSci "-snan" -> -sNaN ! basx740 toSci "-SnAn" -> -sNaN ! basx741 toSci "-SNAN" -> -sNaN ! basx742 toSci 'sNaN0000' -> sNaN ! basx743 toSci 'sNaN7' -> sNaN7 ! basx744 toSci 'sNaN007234' -> sNaN7234 ! basx745 toSci 'sNaN72345' -> NaN Conversion_syntax ! basx746 toSci 'sNaN72.45' -> NaN Conversion_syntax ! basx747 toSci 'sNaN-72' -> NaN Conversion_syntax ! basx748 toSci "Inf" -> Infinity ! basx749 toSci "inf" -> Infinity ! basx750 toSci "iNf" -> Infinity ! basx751 toSci "INF" -> Infinity ! basx752 toSci "+Inf" -> Infinity ! basx753 toSci "+inf" -> Infinity ! basx754 toSci "+iNf" -> Infinity ! basx755 toSci "+INF" -> Infinity ! basx756 toSci "-Inf" -> -Infinity ! basx757 toSci "-inf" -> -Infinity ! basx758 toSci "-iNf" -> -Infinity ! basx759 toSci "-INF" -> -Infinity basx760 toSci "Infinity" -> Infinity *************** *** 730,738 **** basx772 toEng "NaN" -> NaN basx773 toEng "-Infinity" -> -Infinity ! basx774 toEng "-sNaN" -> NaN Conversion_syntax ! basx775 toEng "-NaN" -> NaN Conversion_syntax basx776 toEng "+Infinity" -> Infinity ! basx778 toEng "+sNaN" -> NaN Conversion_syntax ! basx779 toEng "+NaN" -> NaN Conversion_syntax basx780 toEng "INFINITY" -> Infinity basx781 toEng "SNAN" -> sNaN --- 762,770 ---- basx772 toEng "NaN" -> NaN basx773 toEng "-Infinity" -> -Infinity ! basx774 toEng "-sNaN" -> -sNaN ! basx775 toEng "-NaN" -> -NaN basx776 toEng "+Infinity" -> Infinity ! basx778 toEng "+sNaN" -> sNaN ! basx779 toEng "+NaN" -> NaN basx780 toEng "INFINITY" -> Infinity basx781 toEng "SNAN" -> sNaN *************** *** 750,756 **** basx793 toEng "sNaN" -> sNaN basx801 toEng 0.000000000 -> 0E-9 ! basx802 toEng 0.00000000 -> 0E-9 ! basx803 toEng 0.0000000 -> 0E-9 basx804 toEng 0.000000 -> 0.000000 basx805 toEng 0.00000 -> 0.00000 --- 782,791 ---- basx793 toEng "sNaN" -> sNaN + -- Zero toEng, etc. + basx800 toEng 0e+1 -> "0.00E+3" -- doc example + basx801 toEng 0.000000000 -> 0E-9 ! basx802 toEng 0.00000000 -> 0.00E-6 ! basx803 toEng 0.0000000 -> 0.0E-6 basx804 toEng 0.000000 -> 0.000000 basx805 toEng 0.00000 -> 0.00000 *************** *** 769,774 **** basx818 toEng -0.00000 -> -0.00000 basx819 toEng -0.000000 -> -0.000000 ! basx820 toEng -0.0000000 -> -0E-9 ! basx821 toEng -0.00000000 -> -0E-9 basx822 toEng -0.000000000 -> -0E-9 --- 804,809 ---- basx818 toEng -0.00000 -> -0.00000 basx819 toEng -0.000000 -> -0.000000 ! basx820 toEng -0.0000000 -> -0.0E-6 ! basx821 toEng -0.00000000 -> -0.00E-6 basx822 toEng -0.000000000 -> -0E-9 *************** *** 776,807 **** basx831 toEng 0.00E+1 -> 0.0 basx832 toEng 0.00E+2 -> 0 ! basx833 toEng 0.00E+3 -> 0 ! basx834 toEng 0.00E+4 -> 0 basx835 toEng 0.00E+5 -> 0E+3 ! basx836 toEng 0.00E+6 -> 0E+3 ! basx837 toEng 0.00E+7 -> 0E+3 basx838 toEng 0.00E+8 -> 0E+6 ! basx839 toEng 0.00E+9 -> 0E+6 basx840 toEng 0.0E+0 -> 0.0 basx841 toEng 0.0E+1 -> 0 ! basx842 toEng 0.0E+2 -> 0 ! basx843 toEng 0.0E+3 -> 0 basx844 toEng 0.0E+4 -> 0E+3 ! basx845 toEng 0.0E+5 -> 0E+3 ! basx846 toEng 0.0E+6 -> 0E+3 basx847 toEng 0.0E+7 -> 0E+6 ! basx848 toEng 0.0E+8 -> 0E+6 ! basx849 toEng 0.0E+9 -> 0E+6 basx850 toEng 0E+0 -> 0 ! basx851 toEng 0E+1 -> 0 ! basx852 toEng 0E+2 -> 0 basx853 toEng 0E+3 -> 0E+3 ! basx854 toEng 0E+4 -> 0E+3 ! basx855 toEng 0E+5 -> 0E+3 basx856 toEng 0E+6 -> 0E+6 ! basx857 toEng 0E+7 -> 0E+6 ! basx858 toEng 0E+8 -> 0E+6 basx859 toEng 0E+9 -> 0E+9 --- 811,842 ---- basx831 toEng 0.00E+1 -> 0.0 basx832 toEng 0.00E+2 -> 0 ! basx833 toEng 0.00E+3 -> 0.00E+3 ! basx834 toEng 0.00E+4 -> 0.0E+3 basx835 toEng 0.00E+5 -> 0E+3 ! basx836 toEng 0.00E+6 -> 0.00E+6 ! basx837 toEng 0.00E+7 -> 0.0E+6 basx838 toEng 0.00E+8 -> 0E+6 ! basx839 toEng 0.00E+9 -> 0.00E+9 basx840 toEng 0.0E+0 -> 0.0 basx841 toEng 0.0E+1 -> 0 ! basx842 toEng 0.0E+2 -> 0.00E+3 ! basx843 toEng 0.0E+3 -> 0.0E+3 basx844 toEng 0.0E+4 -> 0E+3 ! basx845 toEng 0.0E+5 -> 0.00E+6 ! basx846 toEng 0.0E+6 -> 0.0E+6 basx847 toEng 0.0E+7 -> 0E+6 ! basx848 toEng 0.0E+8 -> 0.00E+9 ! basx849 toEng 0.0E+9 -> 0.0E+9 basx850 toEng 0E+0 -> 0 ! basx851 toEng 0E+1 -> 0.00E+3 ! basx852 toEng 0E+2 -> 0.0E+3 basx853 toEng 0E+3 -> 0E+3 ! basx854 toEng 0E+4 -> 0.00E+6 ! basx855 toEng 0E+5 -> 0.0E+6 basx856 toEng 0E+6 -> 0E+6 ! basx857 toEng 0E+7 -> 0.00E+9 ! basx858 toEng 0E+8 -> 0.0E+9 basx859 toEng 0E+9 -> 0E+9 *************** *** 812,819 **** basx864 toEng 0.0E-4 -> 0.00000 basx865 toEng 0.0E-5 -> 0.000000 ! basx866 toEng 0.0E-6 -> 0E-9 ! basx867 toEng 0.0E-7 -> 0E-9 basx868 toEng 0.0E-8 -> 0E-9 ! basx869 toEng 0.0E-9 -> 0E-12 basx870 toEng 0.00E-0 -> 0.00 --- 847,854 ---- basx864 toEng 0.0E-4 -> 0.00000 basx865 toEng 0.0E-5 -> 0.000000 ! basx866 toEng 0.0E-6 -> 0.0E-6 ! basx867 toEng 0.0E-7 -> 0.00E-6 basx868 toEng 0.0E-8 -> 0E-9 ! basx869 toEng 0.0E-9 -> 0.0E-9 basx870 toEng 0.00E-0 -> 0.00 *************** *** 822,830 **** basx873 toEng 0.00E-3 -> 0.00000 basx874 toEng 0.00E-4 -> 0.000000 ! basx875 toEng 0.00E-5 -> 0E-9 ! basx876 toEng 0.00E-6 -> 0E-9 basx877 toEng 0.00E-7 -> 0E-9 ! basx878 toEng 0.00E-8 -> 0E-12 ! basx879 toEng 0.00E-9 -> 0E-12 -- Giga exponent initial tests --- 857,865 ---- basx873 toEng 0.00E-3 -> 0.00000 basx874 toEng 0.00E-4 -> 0.000000 ! basx875 toEng 0.00E-5 -> 0.0E-6 ! basx876 toEng 0.00E-6 -> 0.00E-6 basx877 toEng 0.00E-7 -> 0E-9 ! basx878 toEng 0.00E-8 -> 0.0E-9 ! basx879 toEng 0.00E-9 -> 0.00E-9 -- Giga exponent initial tests Index: clamp.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/clamp.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** clamp.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- clamp.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests uses the same limits as the 8-byte concrete --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- This set of tests uses the same limits as the 8-byte concrete Index: compare.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/compare.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** compare.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- compare.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- Note that we cannot assume add/subtract tests cover paths adequately, --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- Note that we cannot assume add/subtract tests cover paths adequately, *************** *** 632,635 **** --- 632,638 ---- comx836 compare 1000 NaN -> NaN comx837 compare Inf NaN -> NaN + comx838 compare -NaN -NaN -> -NaN + comx839 compare +NaN -NaN -> NaN + comx840 compare -NaN +NaN -> -NaN comx841 compare sNaN -Inf -> NaN Invalid_operation *************** *** 653,691 **** comx859 compare NaN sNaN -> NaN Invalid_operation -- overflow and underflow tests .. subnormal results now allowed maxExponent: 999999999 minexponent: -999999999 ! comx860 compare +1.23456789012345E-0 9E+999999999 -> -1 ! comx861 compare 9E+999999999 +1.23456789012345E-0 -> 1 ! comx862 compare +0.100 9E-999999999 -> 1 ! comx863 compare 9E-999999999 +0.100 -> -1 ! comx865 compare -1.23456789012345E-0 9E+999999999 -> -1 ! comx866 compare 9E+999999999 -1.23456789012345E-0 -> 1 ! comx867 compare -0.100 9E-999999999 -> -1 ! comx868 compare 9E-999999999 -0.100 -> 1 ! comx869 compare 1e-599999999 1e-400000001 -> -1 ! comx870 compare 1e-599999999 1e-400000000 -> -1 ! comx871 compare 1e-600000000 1e-400000000 -> -1 ! comx872 compare 9e-999999998 0.01 -> -1 ! comx873 compare 9e-999999998 0.1 -> -1 ! comx874 compare 0.01 9e-999999998 -> 1 ! comx875 compare 1e599999999 1e400000001 -> 1 ! comx876 compare 1e599999999 1e400000000 -> 1 ! comx877 compare 1e600000000 1e400000000 -> 1 ! comx878 compare 9e999999998 100 -> 1 ! comx879 compare 9e999999998 10 -> 1 ! comx880 compare 100 9e999999998 -> -1 -- signs ! comx881 compare 1e+777777777 1e+411111111 -> 1 ! comx882 compare 1e+777777777 -1e+411111111 -> 1 ! comx883 compare -1e+777777777 1e+411111111 -> -1 ! comx884 compare -1e+777777777 -1e+411111111 -> -1 ! comx885 compare 1e-777777777 1e-411111111 -> -1 ! comx886 compare 1e-777777777 -1e-411111111 -> 1 ! comx887 compare -1e-777777777 1e-411111111 -> -1 ! comx888 compare -1e-777777777 -1e-411111111 -> 1 -- Null tests ! comx900 compare 10 # -> NaN Invalid_operation ! comx901 compare # 10 -> NaN Invalid_operation --- 656,717 ---- comx859 compare NaN sNaN -> NaN Invalid_operation + -- propagating NaNs + comx860 compare NaN9 -Inf -> NaN9 + comx861 compare NaN8 999 -> NaN8 + comx862 compare NaN77 Inf -> NaN77 + comx863 compare -NaN67 NaN5 -> -NaN67 + comx864 compare -Inf -NaN4 -> -NaN4 + comx865 compare -999 -NaN33 -> -NaN33 + comx866 compare Inf NaN2 -> NaN2 + comx867 compare -NaN41 -NaN42 -> -NaN41 + comx868 compare +NaN41 -NaN42 -> NaN41 + comx869 compare -NaN41 +NaN42 -> -NaN41 + comx870 compare +NaN41 +NaN42 -> NaN41 + + comx871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation + comx872 compare sNaN98 -11 -> NaN98 Invalid_operation + comx873 compare sNaN97 NaN -> NaN97 Invalid_operation + comx874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation + comx875 compare NaN85 sNaN83 -> NaN83 Invalid_operation + comx876 compare -Inf sNaN92 -> NaN92 Invalid_operation + comx877 compare 088 sNaN81 -> NaN81 Invalid_operation + comx878 compare Inf sNaN90 -> NaN90 Invalid_operation + comx879 compare NaN -sNaN89 -> -NaN89 Invalid_operation + -- overflow and underflow tests .. subnormal results now allowed maxExponent: 999999999 minexponent: -999999999 ! comx880 compare +1.23456789012345E-0 9E+999999999 -> -1 ! comx881 compare 9E+999999999 +1.23456789012345E-0 -> 1 ! comx882 compare +0.100 9E-999999999 -> 1 ! comx883 compare 9E-999999999 +0.100 -> -1 ! comx885 compare -1.23456789012345E-0 9E+999999999 -> -1 ! comx886 compare 9E+999999999 -1.23456789012345E-0 -> 1 ! comx887 compare -0.100 9E-999999999 -> -1 ! comx888 compare 9E-999999999 -0.100 -> 1 ! comx889 compare 1e-599999999 1e-400000001 -> -1 ! comx890 compare 1e-599999999 1e-400000000 -> -1 ! comx891 compare 1e-600000000 1e-400000000 -> -1 ! comx892 compare 9e-999999998 0.01 -> -1 ! comx893 compare 9e-999999998 0.1 -> -1 ! comx894 compare 0.01 9e-999999998 -> 1 ! comx895 compare 1e599999999 1e400000001 -> 1 ! comx896 compare 1e599999999 1e400000000 -> 1 ! comx897 compare 1e600000000 1e400000000 -> 1 ! comx898 compare 9e999999998 100 -> 1 ! comx899 compare 9e999999998 10 -> 1 ! comx900 compare 100 9e999999998 -> -1 -- signs ! comx901 compare 1e+777777777 1e+411111111 -> 1 ! comx902 compare 1e+777777777 -1e+411111111 -> 1 ! comx903 compare -1e+777777777 1e+411111111 -> -1 ! comx904 compare -1e+777777777 -1e+411111111 -> -1 ! comx905 compare 1e-777777777 1e-411111111 -> -1 ! comx906 compare 1e-777777777 -1e-411111111 -> 1 ! comx907 compare -1e-777777777 1e-411111111 -> -1 ! comx908 compare -1e-777777777 -1e-411111111 -> 1 -- Null tests ! comx990 compare 10 # -> NaN Invalid_operation ! comx991 compare # 10 -> NaN Invalid_operation Index: divide.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/divide.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** divide.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- divide.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 134,137 **** --- 134,140 ---- divx119 divide 10 1 -> 10 + divx120 divide 3E+1 0.001 -> 3E+4 + divx121 divide 2.200 2 -> 1.100 + divx130 divide 12345 4.999 -> 2469.49390 Inexact Rounded divx131 divide 12345 4.99 -> 2473.94790 Inexact Rounded *************** *** 304,307 **** --- 307,318 ---- divx452 divide 1 1234567896 -> 8.10000003434400E-10 Inexact Rounded + -- high-lows + divx453 divide 1e+1 1 -> 1E+1 + divx454 divide 1e+1 1.0 -> 1E+1 + divx455 divide 1e+1 1.00 -> 1E+1 + divx456 divide 1e+2 2 -> 5E+1 + divx457 divide 1e+2 2.0 -> 5E+1 + divx458 divide 1e+2 2.00 -> 5E+1 + -- some from IEEE discussions divx460 divide 3e0 2e0 -> 1.5 *************** *** 528,532 **** -- more zeros, etc. ! precision: 9 divx731 divide 5.00 1E-3 -> 5.00E+3 divx732 divide 00.00 0.000 -> NaN Division_undefined --- 539,547 ---- -- more zeros, etc. ! precision: 16 ! rounding: half_up ! maxExponent: 384 ! minExponent: -383 ! divx731 divide 5.00 1E-3 -> 5.00E+3 divx732 divide 00.00 0.000 -> NaN Division_undefined *************** *** 576,591 **** divx781 divide Inf -1000 -> -Infinity divx782 divide Inf -1 -> -Infinity ! divx783 divide Inf -0 -> -Infinity Division_by_zero ! divx784 divide Inf 0 -> Infinity Division_by_zero divx785 divide Inf 1 -> Infinity divx786 divide Inf 1000 -> Infinity divx787 divide Inf Inf -> NaN Invalid_operation ! divx788 divide -1000 Inf -> -0E-1007 Clamped divx789 divide -Inf Inf -> NaN Invalid_operation ! divx790 divide -1 Inf -> -0E-1007 Clamped ! divx791 divide -0 Inf -> -0E-1007 Clamped ! divx792 divide 0 Inf -> 0E-1007 Clamped ! divx793 divide 1 Inf -> 0E-1007 Clamped ! divx794 divide 1000 Inf -> 0E-1007 Clamped divx795 divide Inf Inf -> NaN Invalid_operation --- 591,606 ---- divx781 divide Inf -1000 -> -Infinity divx782 divide Inf -1 -> -Infinity ! divx783 divide Inf -0 -> -Infinity ! divx784 divide Inf 0 -> Infinity divx785 divide Inf 1 -> Infinity divx786 divide Inf 1000 -> Infinity divx787 divide Inf Inf -> NaN Invalid_operation ! divx788 divide -1000 Inf -> -0E-398 Clamped divx789 divide -Inf Inf -> NaN Invalid_operation ! divx790 divide -1 Inf -> -0E-398 Clamped ! divx791 divide -0 Inf -> -0E-398 Clamped ! divx792 divide 0 Inf -> 0E-398 Clamped ! divx793 divide 1 Inf -> 0E-398 Clamped ! divx794 divide 1000 Inf -> 0E-398 Clamped divx795 divide Inf Inf -> NaN Invalid_operation *************** *** 593,608 **** divx801 divide -Inf -1000 -> Infinity divx802 divide -Inf -1 -> Infinity ! divx803 divide -Inf -0 -> Infinity Division_by_zero ! divx804 divide -Inf 0 -> -Infinity Division_by_zero divx805 divide -Inf 1 -> -Infinity divx806 divide -Inf 1000 -> -Infinity divx807 divide -Inf Inf -> NaN Invalid_operation ! divx808 divide -1000 Inf -> -0E-1007 Clamped divx809 divide -Inf -Inf -> NaN Invalid_operation ! divx810 divide -1 -Inf -> 0E-1007 Clamped ! divx811 divide -0 -Inf -> 0E-1007 Clamped ! divx812 divide 0 -Inf -> -0E-1007 Clamped ! divx813 divide 1 -Inf -> -0E-1007 Clamped ! divx814 divide 1000 -Inf -> -0E-1007 Clamped divx815 divide Inf -Inf -> NaN Invalid_operation --- 608,623 ---- divx801 divide -Inf -1000 -> Infinity divx802 divide -Inf -1 -> Infinity ! divx803 divide -Inf -0 -> Infinity ! divx804 divide -Inf 0 -> -Infinity divx805 divide -Inf 1 -> -Infinity divx806 divide -Inf 1000 -> -Infinity divx807 divide -Inf Inf -> NaN Invalid_operation ! divx808 divide -1000 Inf -> -0E-398 Clamped divx809 divide -Inf -Inf -> NaN Invalid_operation ! divx810 divide -1 -Inf -> 0E-398 Clamped ! divx811 divide -0 -Inf -> 0E-398 Clamped ! divx812 divide 0 -Inf -> -0E-398 Clamped ! divx813 divide 1 -Inf -> -0E-398 Clamped ! divx814 divide 1000 -Inf -> -0E-398 Clamped divx815 divide Inf -Inf -> NaN Invalid_operation *************** *** 645,648 **** --- 660,700 ---- divx859 divide NaN sNaN -> NaN Invalid_operation + -- propagating NaNs + divx861 divide NaN9 -Inf -> NaN9 + divx862 divide NaN8 1000 -> NaN8 + divx863 divide NaN7 Inf -> NaN7 + divx864 divide NaN6 NaN5 -> NaN6 + divx865 divide -Inf NaN4 -> NaN4 + divx866 divide -1000 NaN3 -> NaN3 + divx867 divide Inf NaN2 -> NaN2 + + divx871 divide sNaN99 -Inf -> NaN99 Invalid_operation + divx872 divide sNaN98 -1 -> NaN98 Invalid_operation + divx873 divide sNaN97 NaN -> NaN97 Invalid_operation + divx874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation + divx875 divide NaN95 sNaN93 -> NaN93 Invalid_operation + divx876 divide -Inf sNaN92 -> NaN92 Invalid_operation + divx877 divide 0 sNaN91 -> NaN91 Invalid_operation + divx878 divide Inf sNaN90 -> NaN90 Invalid_operation + divx879 divide NaN sNaN89 -> NaN89 Invalid_operation + + divx881 divide -NaN9 -Inf -> -NaN9 + divx882 divide -NaN8 1000 -> -NaN8 + divx883 divide -NaN7 Inf -> -NaN7 + divx884 divide -NaN6 -NaN5 -> -NaN6 + divx885 divide -Inf -NaN4 -> -NaN4 + divx886 divide -1000 -NaN3 -> -NaN3 + divx887 divide Inf -NaN2 -> -NaN2 + + divx891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation + divx892 divide -sNaN98 -1 -> -NaN98 Invalid_operation + divx893 divide -sNaN97 NaN -> -NaN97 Invalid_operation + divx894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation + divx895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation + divx896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation + divx897 divide 0 -sNaN91 -> -NaN91 Invalid_operation + divx898 divide Inf -sNaN90 -> -NaN90 Invalid_operation + divx899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation + maxexponent: 999999999 minexponent: -999999999 *************** *** 689,692 **** --- 741,745 ---- -- overflow and underflow tests + precision: 9 maxexponent: 999999999 minexponent: -999999999 *************** *** 751,754 **** --- 804,816 ---- divx1003 divide 1.52446E-80 1 -> 1.524E-80 Inexact Rounded Subnormal Underflow + -- a rounding problem in one implementation + precision: 34 + rounding: half_up + maxExponent: 6144 + minExponent: -6143 + -- Unbounded answer to 40 digits: + -- 1.465811965811965811965811965811965811966E+7000 + divx1010 divide 343E6000 234E-1000 -> Infinity Overflow Inexact Rounded + -- Null tests divx9998 divide 10 # -> NaN Invalid_operation Index: divideint.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/divideint.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** divideint.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- divideint.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 337,342 **** dvix581 divideint Inf -1000 -> -Infinity dvix582 divideint Inf -1 -> -Infinity ! dvix583 divideint Inf -0 -> -Infinity Division_by_zero ! dvix584 divideint Inf 0 -> Infinity Division_by_zero dvix585 divideint Inf 1 -> Infinity dvix586 divideint Inf 1000 -> Infinity --- 337,342 ---- dvix581 divideint Inf -1000 -> -Infinity dvix582 divideint Inf -1 -> -Infinity ! dvix583 divideint Inf -0 -> -Infinity ! dvix584 divideint Inf 0 -> Infinity dvix585 divideint Inf 1 -> Infinity dvix586 divideint Inf 1000 -> Infinity *************** *** 354,359 **** dvix601 divideint -Inf -1000 -> Infinity dvix602 divideint -Inf -1 -> Infinity ! dvix603 divideint -Inf -0 -> Infinity Division_by_zero ! dvix604 divideint -Inf 0 -> -Infinity Division_by_zero dvix605 divideint -Inf 1 -> -Infinity dvix606 divideint -Inf 1000 -> -Infinity --- 354,359 ---- dvix601 divideint -Inf -1000 -> Infinity dvix602 divideint -Inf -1 -> Infinity ! dvix603 divideint -Inf -0 -> Infinity ! dvix604 divideint -Inf 0 -> -Infinity dvix605 divideint -Inf 1 -> -Infinity dvix606 divideint -Inf 1000 -> -Infinity *************** *** 406,447 **** dvix659 divideint NaN sNaN -> NaN Invalid_operation -- some long operand cases again precision: 8 ! dvix660 divideint 100000001 1 -> NaN Division_impossible ! dvix661 divideint 100000000.4 1 -> NaN Division_impossible ! dvix662 divideint 100000000.5 1 -> NaN Division_impossible ! dvix663 divideint 100000000.9 1 -> NaN Division_impossible ! dvix664 divideint 100000000.999 1 -> NaN Division_impossible precision: 6 ! dvix690 divideint 100000000 1 -> NaN Division_impossible ! dvix691 divideint 10000000 1 -> NaN Division_impossible ! dvix692 divideint 1000000 1 -> NaN Division_impossible ! dvix693 divideint 100000 1 -> 100000 ! dvix694 divideint 10000 1 -> 10000 ! dvix695 divideint 1000 1 -> 1000 ! dvix696 divideint 100 1 -> 100 ! dvix697 divideint 10 1 -> 10 ! dvix698 divideint 1 1 -> 1 precision: 9 maxexponent: 999999999 minexponent: -999999999 ! dvix672 divideint 1 0.99e999999999 -> 0 ! dvix673 divideint 1 0.999999999e999999999 -> 0 ! dvix674 divideint 9e999999999 1 -> NaN Division_impossible ! dvix675 divideint 9.9e999999999 1 -> NaN Division_impossible ! dvix676 divideint 9.99e999999999 1 -> NaN Division_impossible ! dvix677 divideint 9.99999999e999999999 1 -> NaN Division_impossible ! dvix680 divideint 0.1 9e-999999999 -> NaN Division_impossible ! dvix681 divideint 0.1 99e-999999999 -> NaN Division_impossible ! dvix682 divideint 0.1 999e-999999999 -> NaN Division_impossible ! dvix683 divideint 0.1 9e-999999998 -> NaN Division_impossible ! dvix684 divideint 0.1 99e-999999998 -> NaN Division_impossible ! dvix685 divideint 0.1 999e-999999998 -> NaN Division_impossible ! dvix686 divideint 0.1 999e-999999997 -> NaN Division_impossible ! dvix687 divideint 0.1 9999e-999999997 -> NaN Division_impossible ! dvix688 divideint 0.1 99999e-999999997 -> NaN Division_impossible --- 406,467 ---- dvix659 divideint NaN sNaN -> NaN Invalid_operation + -- propagating NaNs + dvix661 divideint NaN9 -Inf -> NaN9 + dvix662 divideint NaN8 1000 -> NaN8 + dvix663 divideint NaN7 Inf -> NaN7 + dvix664 divideint -NaN6 NaN5 -> -NaN6 + dvix665 divideint -Inf NaN4 -> NaN4 + dvix666 divideint -1000 NaN3 -> NaN3 + dvix667 divideint Inf -NaN2 -> -NaN2 + + dvix671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation + dvix672 divideint sNaN98 -1 -> NaN98 Invalid_operation + dvix673 divideint sNaN97 NaN -> NaN97 Invalid_operation + dvix674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation + dvix675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation + dvix676 divideint -Inf sNaN92 -> NaN92 Invalid_operation + dvix677 divideint 0 sNaN91 -> NaN91 Invalid_operation + dvix678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation + dvix679 divideint NaN sNaN89 -> NaN89 Invalid_operation + -- some long operand cases again precision: 8 ! dvix710 divideint 100000001 1 -> NaN Division_impossible ! dvix711 divideint 100000000.4 1 -> NaN Division_impossible ! dvix712 divideint 100000000.5 1 -> NaN Division_impossible ! dvix713 divideint 100000000.9 1 -> NaN Division_impossible ! dvix714 divideint 100000000.999 1 -> NaN Division_impossible precision: 6 ! dvix720 divideint 100000000 1 -> NaN Division_impossible ! dvix721 divideint 10000000 1 -> NaN Division_impossible ! dvix722 divideint 1000000 1 -> NaN Division_impossible ! dvix723 divideint 100000 1 -> 100000 ! dvix724 divideint 10000 1 -> 10000 ! dvix725 divideint 1000 1 -> 1000 ! dvix726 divideint 100 1 -> 100 ! dvix727 divideint 10 1 -> 10 ! dvix728 divideint 1 1 -> 1 ! dvix729 divideint 1 10 -> 0 precision: 9 maxexponent: 999999999 minexponent: -999999999 ! dvix732 divideint 1 0.99e999999999 -> 0 ! dvix733 divideint 1 0.999999999e999999999 -> 0 ! dvix734 divideint 9e999999999 1 -> NaN Division_impossible ! dvix735 divideint 9.9e999999999 1 -> NaN Division_impossible ! dvix736 divideint 9.99e999999999 1 -> NaN Division_impossible ! dvix737 divideint 9.99999999e999999999 1 -> NaN Division_impossible ! dvix740 divideint 0.1 9e-999999999 -> NaN Division_impossible ! dvix741 divideint 0.1 99e-999999999 -> NaN Division_impossible ! dvix742 divideint 0.1 999e-999999999 -> NaN Division_impossible ! dvix743 divideint 0.1 9e-999999998 -> NaN Division_impossible ! dvix744 divideint 0.1 99e-999999998 -> NaN Division_impossible ! dvix745 divideint 0.1 999e-999999998 -> NaN Division_impossible ! dvix746 divideint 0.1 999e-999999997 -> NaN Division_impossible ! dvix747 divideint 0.1 9999e-999999997 -> NaN Division_impossible ! dvix748 divideint 0.1 99999e-999999997 -> NaN Division_impossible Index: inexact.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/inexact.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** inexact.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- inexact.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 Index: max.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/max.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** max.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- max.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- we assume that base comparison is tested in compare.decTest, so --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- we assume that base comparison is tested in compare.decTest, so *************** *** 154,162 **** maxx179 max NaN sNaN -> NaN Invalid_operation ! -- from examples ! maxx180 max '3' '2' -> '3' ! maxx181 max '-10' '3' -> '3' ! maxx182 max '1.0' '1' -> '1.0' ! maxx183 max '1' '1.0' -> '1' -- rounding checks --- 154,175 ---- maxx179 max NaN sNaN -> NaN Invalid_operation ! -- propagating NaNs ! maxx181 max NaN9 -Inf -> NaN9 ! maxx182 max NaN8 9 -> NaN8 ! maxx183 max -NaN7 Inf -> -NaN7 ! maxx184 max NaN6 NaN5 -> NaN6 ! maxx185 max -Inf NaN4 -> NaN4 ! maxx186 max -9 -NaN3 -> -NaN3 ! maxx187 max Inf NaN2 -> NaN2 ! ! maxx191 max sNaN99 -Inf -> NaN99 Invalid_operation ! maxx192 max sNaN98 -1 -> NaN98 Invalid_operation ! maxx193 max -sNaN97 NaN -> -NaN97 Invalid_operation ! maxx194 max sNaN96 sNaN94 -> NaN96 Invalid_operation ! maxx195 max NaN95 sNaN93 -> NaN93 Invalid_operation ! maxx196 max -Inf sNaN92 -> NaN92 Invalid_operation ! maxx197 max 0 sNaN91 -> NaN91 Invalid_operation ! maxx198 max Inf -sNaN90 -> -NaN90 Invalid_operation ! maxx199 max NaN sNaN89 -> NaN89 Invalid_operation -- rounding checks *************** *** 203,206 **** --- 216,225 ---- maxx238 max 1 -1234567896 -> 1 + -- from examples + maxx280 max '3' '2' -> '3' + maxx281 max '-10' '3' -> '3' + maxx282 max '1.0' '1' -> '1.0' + maxx283 max '1' '1.0' -> '1' + -- overflow and underflow tests ... maxExponent: 999999999 Index: min.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/min.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** min.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- min.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- we assume that base comparison is tested in compare.decTest, so --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- we assume that base comparison is tested in compare.decTest, so *************** *** 126,132 **** mnmx150 min -Inf NaN -> NaN mnmx151 min -1000 NaN -> NaN ! mnmx152 min -1 NaN -> NaN mnmx153 min -0 NaN -> NaN ! mnmx154 min 0 NaN -> NaN mnmx155 min 1 NaN -> NaN mnmx156 min 1000 NaN -> NaN --- 126,132 ---- mnmx150 min -Inf NaN -> NaN mnmx151 min -1000 NaN -> NaN ! mnmx152 min -1 -NaN -> -NaN mnmx153 min -0 NaN -> NaN ! mnmx154 min 0 -NaN -> -NaN mnmx155 min 1 NaN -> NaN mnmx156 min 1000 NaN -> NaN *************** *** 137,142 **** mnmx163 min sNaN -1 -> NaN Invalid_operation mnmx164 min sNaN -0 -> NaN Invalid_operation ! mnmx165 min sNaN 0 -> NaN Invalid_operation ! mnmx166 min sNaN 1 -> NaN Invalid_operation mnmx167 min sNaN 1000 -> NaN Invalid_operation mnmx168 min sNaN NaN -> NaN Invalid_operation --- 137,142 ---- mnmx163 min sNaN -1 -> NaN Invalid_operation mnmx164 min sNaN -0 -> NaN Invalid_operation ! mnmx165 min -sNaN 0 -> -NaN Invalid_operation ! mnmx166 min -sNaN 1 -> -NaN Invalid_operation mnmx167 min sNaN 1000 -> NaN Invalid_operation mnmx168 min sNaN NaN -> NaN Invalid_operation *************** *** 153,162 **** mnmx179 min NaN sNaN -> NaN Invalid_operation ! -- from examples ! mnmx180 min '3' '2' -> '2' ! mnmx181 min '-10' '3' -> '-10' ! mnmx182 min '1.0' '1' -> '1.0' ! mnmx183 min '1' '1.0' -> '1' -- rounding checks -- chosen is rounded, or not --- 153,174 ---- mnmx179 min NaN sNaN -> NaN Invalid_operation ! -- propagating NaNs ! mnmx181 min NaN9 -Inf -> NaN9 ! mnmx182 min -NaN8 9990 -> -NaN8 ! mnmx183 min NaN71 Inf -> NaN71 ! mnmx184 min NaN6 NaN51 -> NaN6 ! mnmx185 min -Inf NaN41 -> NaN41 ! mnmx186 min -9999 -NaN33 -> -NaN33 ! mnmx187 min Inf NaN2 -> NaN2 + mnmx191 min sNaN99 -Inf -> NaN99 Invalid_operation + mnmx192 min sNaN98 -11 -> NaN98 Invalid_operation + mnmx193 min -sNaN97 NaN -> -NaN97 Invalid_operation + mnmx194 min sNaN69 sNaN94 -> NaN69 Invalid_operation + mnmx195 min NaN95 sNaN93 -> NaN93 Invalid_operation + mnmx196 min -Inf sNaN92 -> NaN92 Invalid_operation + mnmx197 min 088 sNaN91 -> NaN91 Invalid_operation + mnmx198 min Inf -sNaN90 -> -NaN90 Invalid_operation + mnmx199 min NaN sNaN86 -> NaN86 Invalid_operation -- rounding checks -- chosen is rounded, or not *************** *** 203,206 **** --- 215,224 ---- mnmx238 min 1 1234567896 -> 1 + -- from examples + mnmx280 min '3' '2' -> '2' + mnmx281 min '-10' '3' -> '-10' + mnmx282 min '1.0' '1' -> '1.0' + mnmx283 min '1' '1.0' -> '1' + -- overflow and underflow tests .. subnormal results [inputs] now allowed maxExponent: 999999999 Index: minus.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/minus.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** minus.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- minus.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests primarily tests the existence of the operator. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- This set of tests primarily tests the existence of the operator. *************** *** 170,174 **** minx421 minus '-Inf' -> 'Infinity' minx422 minus NaN -> NaN ! minx423 minus sNaN -> NaN Invalid_operation -- Null tests --- 170,180 ---- minx421 minus '-Inf' -> 'Infinity' minx422 minus NaN -> NaN ! minx423 minus sNaN -> NaN Invalid_operation ! minx424 minus NaN255 -> NaN255 ! minx425 minus sNaN256 -> NaN256 Invalid_operation ! minx426 minus -NaN -> -NaN ! minx427 minus -sNaN -> -NaN Invalid_operation ! minx428 minus -NaN255 -> -NaN255 ! minx429 minus -sNaN256 -> -NaN256 Invalid_operation -- Null tests Index: multiply.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/multiply.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** multiply.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- multiply.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 403,406 **** --- 403,461 ---- mulx659 multiply NaN sNaN -> NaN Invalid_operation + -- propagating NaNs + mulx661 multiply NaN9 -Inf -> NaN9 + mulx662 multiply NaN8 999 -> NaN8 + mulx663 multiply NaN71 Inf -> NaN71 + mulx664 multiply NaN6 NaN5 -> NaN6 + mulx665 multiply -Inf NaN4 -> NaN4 + mulx666 multiply -999 NaN33 -> NaN33 + mulx667 multiply Inf NaN2 -> NaN2 + + mulx671 multiply sNaN99 -Inf -> NaN99 Invalid_operation + mulx672 multiply sNaN98 -11 -> NaN98 Invalid_operation + mulx673 multiply sNaN97 NaN -> NaN97 Invalid_operation + mulx674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation + mulx675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation + mulx676 multiply -Inf sNaN92 -> NaN92 Invalid_operation + mulx677 multiply 088 sNaN91 -> NaN91 Invalid_operation + mulx678 multiply Inf sNaN90 -> NaN90 Invalid_operation + mulx679 multiply NaN sNaN89 -> NaN89 Invalid_operation + + mulx681 multiply -NaN9 -Inf -> -NaN9 + mulx682 multiply -NaN8 999 -> -NaN8 + mulx683 multiply -NaN71 Inf -> -NaN71 + mulx684 multiply -NaN6 -NaN5 -> -NaN6 + mulx685 multiply -Inf -NaN4 -> -NaN4 + mulx686 multiply -999 -NaN33 -> -NaN33 + mulx687 multiply Inf -NaN2 -> -NaN2 + + mulx691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation + mulx692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation + mulx693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation + mulx694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation + mulx695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation + mulx696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation + mulx697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation + mulx698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation + mulx699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation + + mulx701 multiply -NaN -Inf -> -NaN + mulx702 multiply -NaN 999 -> -NaN + mulx703 multiply -NaN Inf -> -NaN + mulx704 multiply -NaN -NaN -> -NaN + mulx705 multiply -Inf -NaN0 -> -NaN + mulx706 multiply -999 -NaN -> -NaN + mulx707 multiply Inf -NaN -> -NaN + + mulx711 multiply -sNaN -Inf -> -NaN Invalid_operation + mulx712 multiply -sNaN -11 -> -NaN Invalid_operation + mulx713 multiply -sNaN00 NaN -> -NaN Invalid_operation + mulx714 multiply -sNaN -sNaN -> -NaN Invalid_operation + mulx715 multiply -NaN -sNaN -> -NaN Invalid_operation + mulx716 multiply -Inf -sNaN -> -NaN Invalid_operation + mulx717 multiply 088 -sNaN -> -NaN Invalid_operation + mulx718 multiply Inf -sNaN -> -NaN Invalid_operation + mulx719 multiply -NaN -sNaN -> -NaN Invalid_operation + -- overflow and underflow tests .. note subnormal results maxexponent: 999999999 Index: normalize.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/normalize.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** normalize.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- normalize.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 214,218 **** nrmx821 normalize '-Inf' -> '-Infinity' nrmx822 normalize NaN -> NaN ! nrmx823 normalize sNaN -> NaN Invalid_operation -- Null test --- 214,224 ---- nrmx821 normalize '-Inf' -> '-Infinity' nrmx822 normalize NaN -> NaN ! nrmx823 normalize sNaN -> NaN Invalid_operation ! nrmx824 normalize NaN101 -> NaN101 ! nrmx825 normalize sNaN010 -> NaN10 Invalid_operation ! nrmx827 normalize -NaN -> -NaN ! nrmx828 normalize -sNaN -> -NaN Invalid_operation ! nrmx829 normalize -NaN101 -> -NaN101 ! nrmx830 normalize -sNaN010 -> -NaN10 Invalid_operation -- Null test Index: plus.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/plus.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** plus.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- plus.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests primarily tests the existence of the operator. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- This set of tests primarily tests the existence of the operator. *************** *** 111,115 **** plux151 plus '-Inf' -> '-Infinity' plux152 plus NaN -> NaN ! plux153 plus sNaN -> NaN Invalid_operation -- overflow tests --- 111,121 ---- plux151 plus '-Inf' -> '-Infinity' plux152 plus NaN -> NaN ! plux153 plus sNaN -> NaN Invalid_operation ! plux154 plus NaN77 -> NaN77 ! plux155 plus sNaN88 -> NaN88 Invalid_operation ! plux156 plus -NaN -> -NaN ! plux157 plus -sNaN -> -NaN Invalid_operation ! plux158 plus -NaN77 -> -NaN77 ! plux159 plus -sNaN88 -> -NaN88 Invalid_operation -- overflow tests Index: power.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/power.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** power.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- power.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of testcases tests raising numbers to an integer power only. --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- This set of testcases tests raising numbers to an integer power only. *************** *** 574,589 **** powx659 power NaN sNaN -> NaN Invalid_operation -- Examples from extended specification ! powx660 power Inf -2 -> 0 ! powx661 power Inf -1 -> 0 ! powx662 power Inf 0 -> 1 ! powx663 power Inf 1 -> Infinity ! powx664 power Inf 2 -> Infinity ! powx665 power -Inf -2 -> 0 ! powx666 power -Inf -1 -> -0 ! powx667 power -Inf 0 -> 1 ! powx668 power -Inf 1 -> -Infinity ! powx669 power -Inf 2 -> Infinity ! powx670 power 0 0 -> NaN Invalid_operation -- long operand and RHS range checks --- 574,609 ---- powx659 power NaN sNaN -> NaN Invalid_operation + -- NaN propagation + powx660 power NaN3 sNaN7 -> NaN7 Invalid_operation + powx661 power sNaN8 NaN6 -> NaN8 Invalid_operation + powx662 power 1 sNaN7 -> NaN7 Invalid_operation + powx663 power sNaN8 1 -> NaN8 Invalid_operation + powx664 power Inf sNaN7 -> NaN7 Invalid_operation + powx665 power sNaN8 Inf -> NaN Invalid_operation + powx666 power Inf NaN9 -> NaN9 + powx667 power NaN6 Inf -> NaN Invalid_operation + powx668 power 1 NaN5 -> NaN5 + powx669 power NaN2 1 -> NaN2 + powx670 power NaN2 Nan4 -> NaN2 + powx671 power NaN Nan4 -> NaN + powx672 power NaN345 Nan -> NaN345 + powx673 power Inf -sNaN7 -> -NaN7 Invalid_operation + powx674 power -sNaN8 Inf -> NaN Invalid_operation + powx675 power Inf -NaN9 -> -NaN9 + powx676 power -NaN6 Inf -> NaN Invalid_operation + powx677 power -NaN2 -Nan4 -> -NaN2 + -- Examples from extended specification ! powx690 power Inf -2 -> 0 ! powx691 power Inf -1 -> 0 ! powx692 power Inf 0 -> 1 ! powx693 power Inf 1 -> Infinity ! powx694 power Inf 2 -> Infinity ! powx695 power -Inf -2 -> 0 ! powx696 power -Inf -1 -> -0 ! powx697 power -Inf 0 -> 1 ! powx698 power -Inf 1 -> -Infinity ! powx699 power -Inf 2 -> Infinity ! powx700 power 0 0 -> NaN Invalid_operation -- long operand and RHS range checks Index: quantize.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/quantize.decTest,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** quantize.decTest 12 Aug 2003 23:05:30 -0000 1.2 --- quantize.decTest 6 Feb 2004 16:56:03 -0000 1.3 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- Most of the tests here assume a "regular pattern", where the --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- Most of the tests here assume a "regular pattern", where the *************** *** 78,90 **** quax063 quantize 2.17 1e+0 -> 2 Inexact Rounded quax064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded ! quax065 quantize 2 Inf -> NaN Invalid_operation ! quax066 quantize -0.1 1 -> -0 Inexact Rounded ! quax067 quantize -0 1e+5 -> -0E+5 ! quax068 quantize +35236450.6 1e-2 -> NaN Invalid_operation ! quax069 quantize -35236450.6 1e-2 -> NaN Invalid_operation ! quax070 quantize 217 1e-1 -> 217.0 ! quax071 quantize 217 1e+0 -> 217 ! quax072 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded ! quax073 quantize 217 1e+2 -> 2E+2 Inexact Rounded -- general tests .. --- 78,91 ---- quax063 quantize 2.17 1e+0 -> 2 Inexact Rounded quax064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded ! quax065 quantize -Inf Inf -> -Infinity ! quax066 quantize 2 Inf -> NaN Invalid_operation ! quax067 quantize -0.1 1 -> -0 Inexact Rounded ! quax068 quantize -0 1e+5 -> -0E+5 ! quax069 quantize +35236450.6 1e-2 -> NaN Invalid_operation ! quax070 quantize -35236450.6 1e-2 -> NaN Invalid_operation ! quax071 quantize 217 1e-1 -> 217.0 ! quax072 quantize 217 1e+0 -> 217 ! quax073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded ! quax074 quantize 217 1e+2 -> 2E+2 Inexact Rounded -- general tests .. *************** *** 539,543 **** -- Specials ! quax580 quantize Inf -Inf -> NaN Invalid_operation quax581 quantize Inf 1e-1000 -> NaN Invalid_operation quax582 quantize Inf 1e-1 -> NaN Invalid_operation --- 540,544 ---- -- Specials ! quax580 quantize Inf -Inf -> Infinity quax581 quantize Inf 1e-1000 -> NaN Invalid_operation quax582 quantize Inf 1e-1 -> NaN Invalid_operation *************** *** 545,560 **** quax584 quantize Inf 1e1 -> NaN Invalid_operation quax585 quantize Inf 1e1000 -> NaN Invalid_operation ! quax586 quantize Inf Inf -> NaN Invalid_operation quax587 quantize -1000 Inf -> NaN Invalid_operation ! quax588 quantize -Inf Inf -> NaN Invalid_operation quax589 quantize -1 Inf -> NaN Invalid_operation quax590 quantize 0 Inf -> NaN Invalid_operation quax591 quantize 1 Inf -> NaN Invalid_operation quax592 quantize 1000 Inf -> NaN Invalid_operation ! quax593 quantize Inf Inf -> NaN Invalid_operation quax594 quantize Inf 1e-0 -> NaN Invalid_operation quax595 quantize -0 Inf -> NaN Invalid_operation ! quax600 quantize -Inf -Inf -> NaN Invalid_operation quax601 quantize -Inf 1e-1000 -> NaN Invalid_operation quax602 quantize -Inf 1e-1 -> NaN Invalid_operation --- 546,561 ---- quax584 quantize Inf 1e1 -> NaN Invalid_operation quax585 quantize Inf 1e1000 -> NaN Invalid_operation ! quax586 quantize Inf Inf -> Infinity quax587 quantize -1000 Inf -> NaN Invalid_operation ! quax588 quantize -Inf Inf -> -Infinity quax589 quantize -1 Inf -> NaN Invalid_operation quax590 quantize 0 Inf -> NaN Invalid_operation quax591 quantize 1 Inf -> NaN Invalid_operation quax592 quantize 1000 Inf -> NaN Invalid_operation ! quax593 quantize Inf Inf -> Infinity quax594 quantize Inf 1e-0 -> NaN Invalid_operation quax595 quantize -0 Inf -> NaN Invalid_operation ! quax600 quantize -Inf -Inf -> -Infinity quax601 quantize -Inf 1e-1000 -> NaN Invalid_operation quax602 quantize -Inf 1e-1 -> NaN Invalid_operation *************** *** 562,577 **** quax604 quantize -Inf 1e1 -> NaN Invalid_operation quax605 quantize -Inf 1e1000 -> NaN Invalid_operation ! quax606 quantize -Inf Inf -> NaN Invalid_operation quax607 quantize -1000 Inf -> NaN Invalid_operation ! quax608 quantize -Inf -Inf -> NaN Invalid_operation quax609 quantize -1 -Inf -> NaN Invalid_operation quax610 quantize 0 -Inf -> NaN Invalid_operation quax611 quantize 1 -Inf -> NaN Invalid_operation quax612 quantize 1000 -Inf -> NaN Invalid_operation ! quax613 quantize Inf -Inf -> NaN Invalid_operation quax614 quantize -Inf 1e-0 -> NaN Invalid_operation quax615 quantize -0 -Inf -> NaN Invalid_operation ! quax621 quantize NaN -Inf -> NaN Invalid_operation quax622 quantize NaN 1e-1000 -> NaN quax623 quantize NaN 1e-1 -> NaN --- 563,578 ---- quax604 quantize -Inf 1e1 -> NaN Invalid_operation quax605 quantize -Inf 1e1000 -> NaN Invalid_operation ! quax606 quantize -Inf Inf -> -Infinity quax607 quantize -1000 Inf -> NaN Invalid_operation ! quax608 quantize -Inf -Inf -> -Infinity quax609 quantize -1 -Inf -> NaN Invalid_operation quax610 quantize 0 -Inf -> NaN Invalid_operation quax611 quantize 1 -Inf -> NaN Invalid_operation quax612 quantize 1000 -Inf -> NaN Invalid_operation ! quax613 quantize Inf -Inf -> Infinity quax614 quantize -Inf 1e-0 -> NaN Invalid_operation quax615 quantize -0 -Inf -> NaN Invalid_operation ! quax621 quantize NaN -Inf -> NaN quax622 quantize NaN 1e-1000 -> NaN quax623 quantize NaN 1e-1 -> NaN *************** *** 579,585 **** quax625 quantize NaN 1e1 -> NaN quax626 quantize NaN 1e1000 -> NaN ! quax627 quantize NaN Inf -> NaN Invalid_operation quax628 quantize NaN NaN -> NaN ! quax629 quantize -Inf NaN -> NaN Invalid_operation quax630 quantize -1000 NaN -> NaN quax631 quantize -1 NaN -> NaN --- 580,586 ---- quax625 quantize NaN 1e1 -> NaN quax626 quantize NaN 1e1000 -> NaN ! quax627 quantize NaN Inf -> NaN quax628 quantize NaN NaN -> NaN ! quax629 quantize -Inf NaN -> NaN quax630 quantize -1000 NaN -> NaN quax631 quantize -1 NaN -> NaN *************** *** 587,591 **** quax633 quantize 1 NaN -> NaN quax634 quantize 1000 NaN -> NaN ! quax635 quantize Inf NaN -> NaN Invalid_operation quax636 quantize NaN 1e-0 -> NaN quax637 quantize -0 NaN -> NaN --- 588,592 ---- quax633 quantize 1 NaN -> NaN quax634 quantize 1000 NaN -> NaN ! quax635 quantize Inf NaN -> NaN quax636 quantize NaN 1e-0 -> NaN quax637 quantize -0 NaN -> NaN *************** *** 611,614 **** --- 612,652 ---- quax659 quantize -0 sNaN -> NaN Invalid_operation + -- propagating NaNs + quax661 quantize NaN9 -Inf -> NaN9 + quax662 quantize NaN8 919 -> NaN8 + quax663 quantize NaN71 Inf -> NaN71 + quax664 quantize NaN6 NaN5 -> NaN6 + quax665 quantize -Inf NaN4 -> NaN4 + quax666 quantize -919 NaN31 -> NaN31 + quax667 quantize Inf NaN2 -> NaN2 + + quax671 quantize sNaN99 -Inf -> NaN99 Invalid_operation + quax672 quantize sNaN98 -11 -> NaN98 Invalid_operation + quax673 quantize sNaN97 NaN -> NaN97 Invalid_operation + quax674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation + quax675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation + quax676 quantize -Inf sNaN92 -> NaN92 Invalid_operation + quax677 quantize 088 sNaN91 -> NaN91 Invalid_operation + quax678 quantize Inf sNaN90 -> NaN90 Invalid_operation + quax679 quantize NaN sNaN88 -> NaN88 Invalid_operation + + quax681 quantize -NaN9 -Inf -> -NaN9 + quax682 quantize -NaN8 919 -> -NaN8 + quax683 quantize -NaN71 Inf -> -NaN71 + quax684 quantize -NaN6 -NaN5 -> -NaN6 + quax685 quantize -Inf -NaN4 -> -NaN4 + quax686 quantize -919 -NaN31 -> -NaN31 + quax687 quantize Inf -NaN2 -> -NaN2 + + quax691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation + quax692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation + quax693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation + quax694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation + quax695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation + quax696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation + quax697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation + quax698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation + quax699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation + -- subnormals and underflow precision: 4 Index: randomBound32.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/randomBound32.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** randomBound32.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- randomBound32.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- These testcases test calculations at precisions 31, 32, and 33, to --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- These testcases test calculations at precisions 31, 32, and 33, to Index: randoms.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/randoms.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** randoms.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- randoms.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 1298,1302 **** xmul159 multiply -18861647. 99794586.7 -> -1.88229027E+15 Inexact Rounded xpow159 power -18861647. 99794587 -> -4.28957460E+726063462 Inexact Rounded ! xrem159 remainder -18861647. 99794586.7 -> -18861647 xsub159 subtract -18861647. 99794586.7 -> -118656234 Inexact Rounded xadd160 add 322192.407 461.67044 -> 322654.077 Inexact Rounded --- 1298,1302 ---- xmul159 multiply -18861647. 99794586.7 -> -1.88229027E+15 Inexact Rounded xpow159 power -18861647. 99794587 -> -4.28957460E+726063462 Inexact Rounded ! xrem159 remainder -18861647. 99794586.7 -> -18861647.0 xsub159 subtract -18861647. 99794586.7 -> -118656234 Inexact Rounded xadd160 add 322192.407 461.67044 -> 322654.077 Inexact Rounded *************** *** 2226,2230 **** xmul275 multiply -1156008.8 -8870382.36 -> 1.02542401E+13 Inexact Rounded xpow275 power -1156008.8 -8870382 -> 4.32494996E-53780782 Inexact Rounded ! xrem275 remainder -1156008.8 -8870382.36 -> -1156008.8 xsub275 subtract -1156008.8 -8870382.36 -> 7714373.56 xadd276 add 880097928. -52455011.1E+204538218 -> -5.24550111E+204538225 Inexact Rounded --- 2226,2230 ---- xmul275 multiply -1156008.8 -8870382.36 -> 1.02542401E+13 Inexact Rounded xpow275 power -1156008.8 -8870382 -> 4.32494996E-53780782 Inexact Rounded ! xrem275 remainder -1156008.8 -8870382.36 -> -1156008.80 xsub275 subtract -1156008.8 -8870382.36 -> 7714373.56 xadd276 add 880097928. -52455011.1E+204538218 -> -5.24550111E+204538225 Inexact Rounded *************** *** 2890,2894 **** xmul358 multiply -1546783 -51935370.4 -> 8.03327480E+13 Inexact Rounded xpow358 power -1546783 -51935370 -> 3.36022461E-321450306 Inexact Rounded ! xrem358 remainder -1546783 -51935370.4 -> -1546783 xsub358 subtract -1546783 -51935370.4 -> 50388587.4 xadd359 add 61302486.8 205.490417 -> 61302692.3 Inexact Rounded --- 2890,2894 ---- xmul358 multiply -1546783 -51935370.4 -> 8.03327480E+13 Inexact Rounded xpow358 power -1546783 -51935370 -> 3.36022461E-321450306 Inexact Rounded ! xrem358 remainder -1546783 -51935370.4 -> -1546783.0 xsub358 subtract -1546783 -51935370.4 -> 50388587.4 xadd359 add 61302486.8 205.490417 -> 61302692.3 Inexact Rounded Index: remainder.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/remainder.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** remainder.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- remainder.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 52,57 **** remx022 remainder 5 2.0 -> 1.0 remx023 remainder 5 2.000 -> 1.000 ! remx024 remainder 5 0.200 -> 0 ! remx025 remainder 5 0.200 -> 0 remx030 remainder 1 2 -> 1 --- 52,57 ---- remx022 remainder 5 2.0 -> 1.0 remx023 remainder 5 2.000 -> 1.000 ! remx024 remainder 5 0.200 -> 0.000 ! remx025 remainder 5 0.200 -> 0.000 remx030 remainder 1 2 -> 1 *************** *** 157,165 **** remx143 remainder 0.5 2 -> 0.5 remx144 remainder 0.5 2.1 -> 0.5 ! remx145 remainder 0.5 2.01 -> 0.5 ! remx146 remainder 0.5 2.001 -> 0.5 remx147 remainder 0.50 2 -> 0.50 remx148 remainder 0.50 2.01 -> 0.50 ! remx149 remainder 0.50 2.001 -> 0.50 -- steadies --- 157,165 ---- remx143 remainder 0.5 2 -> 0.5 remx144 remainder 0.5 2.1 -> 0.5 ! remx145 remainder 0.5 2.01 -> 0.50 ! remx146 remainder 0.5 2.001 -> 0.500 remx147 remainder 0.50 2 -> 0.50 remx148 remainder 0.50 2.01 -> 0.50 ! remx149 remainder 0.50 2.001 -> 0.500 -- steadies *************** *** 186,194 **** -- some differences from remainderNear ! remx171 remainder 0.4 1.020 -> 0.4 ! remx172 remainder 0.50 1.020 -> 0.50 ! remx173 remainder 0.51 1.020 -> 0.51 ! remx174 remainder 0.52 1.020 -> 0.52 ! remx175 remainder 0.6 1.020 -> 0.6 --- 186,194 ---- -- some differences from remainderNear ! remx171 remainder 0.4 1.020 -> 0.400 ! remx172 remainder 0.50 1.020 -> 0.500 ! remx173 remainder 0.51 1.020 -> 0.510 ! remx174 remainder 0.52 1.020 -> 0.520 ! remx175 remainder 0.6 1.020 -> 0.600 *************** *** 209,217 **** -- some differences from remainderNear ! remx231 remainder 0.4 1.020 -> 0.4 ! remx232 remainder 0.50 1.020 -> 0.50 ! remx233 remainder 0.51 1.020 -> 0.51 ! remx234 remainder 0.52 1.020 -> 0.52 ! remx235 remainder 0.6 1.020 -> 0.6 -- test some cases that are close to exponent overflow --- 209,221 ---- -- some differences from remainderNear ! remx231 remainder -0.4 1.020 -> -0.400 ! remx232 remainder -0.50 1.020 -> -0.500 ! remx233 remainder -0.51 1.020 -> -0.510 ! remx234 remainder -0.52 1.020 -> -0.520 ! remx235 remainder -0.6 1.020 -> -0.600 ! ! -- high Xs ! remx240 remainder 1E+2 1.00 -> 0.00 ! -- test some cases that are close to exponent overflow *************** *** 256,260 **** remx316 remainder 1033 50 -> 33 remx317 remainder 101.0 3 -> 2.0 ! remx318 remainder 102.0 3 -> 0 remx319 remainder 103.0 3 -> 1.0 remx320 remainder 2.40 1 -> 0.40 --- 260,264 ---- remx316 remainder 1033 50 -> 33 remx317 remainder 101.0 3 -> 2.0 ! remx318 remainder 102.0 3 -> 0.0 remx319 remainder 103.0 3 -> 1.0 remx320 remainder 2.40 1 -> 0.40 *************** *** 273,287 **** remx333 remainder 0.5 2 -> 0.5 remx334 remainder 0.5 2.1 -> 0.5 ! remx335 remainder 0.5 2.01 -> 0.5 ! remx336 remainder 0.5 2.001 -> 0.5 remx337 remainder 0.50 2 -> 0.50 remx338 remainder 0.50 2.01 -> 0.50 ! remx339 remainder 0.50 2.001 -> 0.50 ! remx340 remainder 0.5 0.5000001 -> 0.5 ! remx341 remainder 0.5 0.50000001 -> 0.5 ! remx342 remainder 0.5 0.500000001 -> 0.5 ! remx343 remainder 0.5 0.5000000001 -> 0.5 ! remx344 remainder 0.5 0.50000000001 -> 0.5 remx345 remainder 0.5 0.4999999 -> 1E-7 remx346 remainder 0.5 0.49999999 -> 1E-8 --- 277,291 ---- remx333 remainder 0.5 2 -> 0.5 remx334 remainder 0.5 2.1 -> 0.5 ! remx335 remainder 0.5 2.01 -> 0.50 ! remx336 remainder 0.5 2.001 -> 0.500 remx337 remainder 0.50 2 -> 0.50 remx338 remainder 0.50 2.01 -> 0.50 ! remx339 remainder 0.50 2.001 -> 0.500 ! remx340 remainder 0.5 0.5000001 -> 0.5000000 ! remx341 remainder 0.5 0.50000001 -> 0.50000000 ! remx342 remainder 0.5 0.500000001 -> 0.500000000 ! remx343 remainder 0.5 0.5000000001 -> 0.500000000 Rounded ! remx344 remainder 0.5 0.50000000001 -> 0.500000000 Rounded remx345 remainder 0.5 0.4999999 -> 1E-7 remx346 remainder 0.5 0.49999999 -> 1E-8 *************** *** 303,307 **** remx360 remainder 1.2 0.7345 -> 0.4655 remx361 remainder 0.8 12 -> 0.8 ! remx362 remainder 0.8 0.2 -> 0 remx363 remainder 0.8 0.3 -> 0.2 remx364 remainder 0.800 12 -> 0.800 --- 307,311 ---- remx360 remainder 1.2 0.7345 -> 0.4655 remx361 remainder 0.8 12 -> 0.8 ! remx362 remainder 0.8 0.2 -> 0.0 remx363 remainder 0.8 0.3 -> 0.2 remx364 remainder 0.800 12 -> 0.800 *************** *** 312,317 **** remx371 remainder 2.400 2 -> 0.400 precision: 3 ! -- long operand case remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded precision: 5 --- 316,322 ---- remx371 remainder 2.400 2 -> 0.400 precision: 3 ! -- long operand, rounded, case remx372 remainder 12345678900000 12e+12 -> 3.46E+11 Inexact Rounded + -- 12000000000000 precision: 5 *************** *** 387,401 **** remx723 remainder NaN -1 -> NaN remx724 remainder NaN -0 -> NaN ! remx725 remainder NaN 0 -> NaN remx726 remainder NaN 1 -> NaN remx727 remainder NaN 1000 -> NaN remx728 remainder NaN Inf -> NaN ! remx729 remainder NaN NaN -> NaN remx730 remainder -Inf NaN -> NaN remx731 remainder -1000 NaN -> NaN remx732 remainder -1 NaN -> NaN ! remx733 remainder -0 NaN -> NaN remx734 remainder 0 NaN -> NaN ! remx735 remainder 1 NaN -> NaN remx736 remainder 1000 NaN -> NaN remx737 remainder Inf NaN -> NaN --- 392,406 ---- remx723 remainder NaN -1 -> NaN remx724 remainder NaN -0 -> NaN ! remx725 remainder -NaN 0 -> -NaN remx726 remainder NaN 1 -> NaN remx727 remainder NaN 1000 -> NaN remx728 remainder NaN Inf -> NaN ! remx729 remainder NaN -NaN -> NaN remx730 remainder -Inf NaN -> NaN remx731 remainder -1000 NaN -> NaN remx732 remainder -1 NaN -> NaN ! remx733 remainder -0 -NaN -> -NaN remx734 remainder 0 NaN -> NaN ! remx735 remainder 1 -NaN -> -NaN remx736 remainder 1000 NaN -> NaN remx737 remainder Inf NaN -> NaN *************** *** 403,407 **** remx741 remainder sNaN -Inf -> NaN Invalid_operation remx742 remainder sNaN -1000 -> NaN Invalid_operation ! remx743 remainder sNaN -1 -> NaN Invalid_operation remx744 remainder sNaN -0 -> NaN Invalid_operation remx745 remainder sNaN 0 -> NaN Invalid_operation --- 408,412 ---- remx741 remainder sNaN -Inf -> NaN Invalid_operation remx742 remainder sNaN -1000 -> NaN Invalid_operation ! remx743 remainder -sNaN -1 -> -NaN Invalid_operation remx744 remainder sNaN -0 -> NaN Invalid_operation remx745 remainder sNaN 0 -> NaN Invalid_operation *************** *** 418,423 **** remx757 remainder 1 sNaN -> NaN Invalid_operation remx758 remainder 1000 sNaN -> NaN Invalid_operation ! remx759 remainder Inf sNaN -> NaN Invalid_operation ! remx760 remainder NaN sNaN -> NaN Invalid_operation -- test some cases that are close to exponent overflow --- 423,439 ---- remx757 remainder 1 sNaN -> NaN Invalid_operation remx758 remainder 1000 sNaN -> NaN Invalid_operation ! remx759 remainder Inf -sNaN -> -NaN Invalid_operation ! ! -- propaging NaNs ! remx760 remainder NaN1 NaN7 -> NaN1 ! remx761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation ! remx762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation ! remx763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation ! remx764 remainder 15 NaN11 -> NaN11 ! remx765 remainder NaN6 NaN12 -> NaN6 ! remx766 remainder Inf NaN13 -> NaN13 ! remx767 remainder NaN14 -Inf -> NaN14 ! remx768 remainder 0 NaN15 -> NaN15 ! remx769 remainder NaN16 -0 -> NaN16 -- test some cases that are close to exponent overflow Index: remainderNear.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/remainderNear.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** remainderNear.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- remainderNear.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 51,56 **** rmnx022 remaindernear 5 2.0 -> 1.0 rmnx023 remaindernear 5 2.000 -> 1.000 ! rmnx024 remaindernear 5 0.200 -> 0 ! rmnx025 remaindernear 5 0.200 -> 0 rmnx030 remaindernear 1 2 -> 1 --- 51,56 ---- rmnx022 remaindernear 5 2.0 -> 1.0 rmnx023 remaindernear 5 2.000 -> 1.000 ! rmnx024 remaindernear 5 0.200 -> 0.000 ! rmnx025 remaindernear 5 0.200 -> 0.000 rmnx030 remaindernear 1 2 -> 1 *************** *** 158,171 **** rmmx143 remaindernear 0.5 2 -> 0.5 rmmx144 remaindernear 0.5 2.1 -> 0.5 ! rmmx145 remaindernear 0.5 2.01 -> 0.5 ! rmmx146 remaindernear 0.5 2.001 -> 0.5 rmmx147 remaindernear 0.50 2 -> 0.50 rmmx148 remaindernear 0.50 2.01 -> 0.50 ! rmmx149 remaindernear 0.50 2.001 -> 0.50 -- some differences from remainder ! rmnx150 remaindernear 0.4 1.020 -> 0.4 ! rmnx151 remaindernear 0.50 1.020 -> 0.50 ! rmnx152 remaindernear 0.51 1.020 -> 0.51 rmnx153 remaindernear 0.52 1.020 -> -0.500 rmnx154 remaindernear 0.6 1.020 -> -0.420 --- 158,171 ---- rmmx143 remaindernear 0.5 2 -> 0.5 rmmx144 remaindernear 0.5 2.1 -> 0.5 ! rmmx145 remaindernear 0.5 2.01 -> 0.50 ! rmmx146 remaindernear 0.5 2.001 -> 0.500 rmmx147 remaindernear 0.50 2 -> 0.50 rmmx148 remaindernear 0.50 2.01 -> 0.50 ! rmmx149 remaindernear 0.50 2.001 -> 0.500 -- some differences from remainder ! rmnx150 remaindernear 0.4 1.020 -> 0.400 ! rmnx151 remaindernear 0.50 1.020 -> 0.500 ! rmnx152 remaindernear 0.51 1.020 -> 0.510 rmnx153 remaindernear 0.52 1.020 -> -0.500 rmnx154 remaindernear 0.6 1.020 -> -0.420 *************** *** 246,252 **** -- some differences from remainder ! rmnx231 remaindernear 0.4 1.020 -> 0.4 ! rmnx232 remaindernear 0.50 1.020 -> 0.50 ! rmnx233 remaindernear 0.51 1.020 -> 0.51 rmnx234 remaindernear 0.52 1.020 -> -0.500 rmnx235 remaindernear 0.6 1.020 -> -0.420 --- 246,252 ---- -- some differences from remainder ! rmnx231 remaindernear 0.4 1.020 -> 0.400 ! rmnx232 remaindernear 0.50 1.020 -> 0.500 ! rmnx233 remaindernear 0.51 1.020 -> 0.510 rmnx234 remaindernear 0.52 1.020 -> -0.500 rmnx235 remaindernear 0.6 1.020 -> -0.420 *************** *** 293,297 **** rmnx316 remaindernear 1033 50 -> -17 rmnx317 remaindernear 101.0 3 -> -1.0 ! rmnx318 remaindernear 102.0 3 -> 0 rmnx319 remaindernear 103.0 3 -> 1.0 rmnx320 remaindernear 2.40 1 -> 0.40 --- 293,297 ---- rmnx316 remaindernear 1033 50 -> -17 rmnx317 remaindernear 101.0 3 -> -1.0 ! rmnx318 remaindernear 102.0 3 -> 0.0 rmnx319 remaindernear 103.0 3 -> 1.0 rmnx320 remaindernear 2.40 1 -> 0.40 *************** *** 310,318 **** rmnx333 remaindernear 0.5 2 -> 0.5 rmnx334 remaindernear 0.5 2.1 -> 0.5 ! rmnx335 remaindernear 0.5 2.01 -> 0.5 ! rmnx336 remaindernear 0.5 2.001 -> 0.5 rmnx337 remaindernear 0.50 2 -> 0.50 rmnx338 remaindernear 0.50 2.01 -> 0.50 ! rmnx339 remaindernear 0.50 2.001 -> 0.50 rmnx340 remaindernear 0.5 0.5000001 -> -1E-7 --- 310,318 ---- rmnx333 remaindernear 0.5 2 -> 0.5 rmnx334 remaindernear 0.5 2.1 -> 0.5 ! rmnx335 remaindernear 0.5 2.01 -> 0.50 ! rmnx336 remaindernear 0.5 2.001 -> 0.500 rmnx337 remaindernear 0.50 2 -> 0.50 rmnx338 remaindernear 0.50 2.01 -> 0.50 ! rmnx339 remaindernear 0.50 2.001 -> 0.500 rmnx340 remaindernear 0.5 0.5000001 -> -1E-7 *************** *** 339,343 **** rmnx360 remaindernear 1.2 0.7345 -> -0.2690 rmnx361 remaindernear 0.8 12 -> 0.8 ! rmnx362 remaindernear 0.8 0.2 -> 0 rmnx363 remaindernear 0.8 0.3 -> -0.1 rmnx364 remaindernear 0.800 12 -> 0.800 --- 339,343 ---- rmnx360 remaindernear 1.2 0.7345 -> -0.2690 rmnx361 remaindernear 0.8 12 -> 0.8 ! rmnx362 remaindernear 0.8 0.2 -> 0.0 rmnx363 remaindernear 0.8 0.3 -> -0.1 rmnx364 remaindernear 0.800 12 -> 0.800 *************** *** 460,464 **** rmnx730 remaindernear -Inf NaN -> NaN rmnx731 remaindernear -1000 NaN -> NaN ! rmnx732 remaindernear -1 NaN -> NaN rmnx733 remaindernear -0 NaN -> NaN rmnx734 remaindernear 0 NaN -> NaN --- 460,464 ---- rmnx730 remaindernear -Inf NaN -> NaN rmnx731 remaindernear -1000 NaN -> NaN ! rmnx732 remaindernear -1 -NaN -> -NaN rmnx733 remaindernear -0 NaN -> NaN rmnx734 remaindernear 0 NaN -> NaN *************** *** 469,473 **** rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation ! rmnx743 remaindernear sNaN -1 -> NaN Invalid_operation rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation --- 469,473 ---- rmnx741 remaindernear sNaN -Inf -> NaN Invalid_operation rmnx742 remaindernear sNaN -1000 -> NaN Invalid_operation ! rmnx743 remaindernear -sNaN -1 -> -NaN Invalid_operation rmnx744 remaindernear sNaN -0 -> NaN Invalid_operation rmnx745 remaindernear sNaN 0 -> NaN Invalid_operation *************** *** 480,484 **** rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation ! rmnx755 remaindernear -0 sNaN -> NaN Invalid_operation rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation --- 480,484 ---- rmnx753 remaindernear -1000 sNaN -> NaN Invalid_operation rmnx754 remaindernear -1 sNaN -> NaN Invalid_operation ! rmnx755 remaindernear -0 -sNaN -> -NaN Invalid_operation rmnx756 remaindernear 0 sNaN -> NaN Invalid_operation rmnx757 remaindernear 1 sNaN -> NaN Invalid_operation *************** *** 487,501 **** rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation -- test some cases that are close to exponent overflow maxexponent: 999999999 minexponent: -999999999 ! rmnx770 remaindernear 1 1e999999999 -> 1 ! rmnx771 remaindernear 1 0.9e999999999 -> 1 ! rmnx772 remaindernear 1 0.99e999999999 -> 1 ! rmnx773 remaindernear 1 0.999999999e999999999 -> 1 ! rmnx774 remaindernear 9e999999999 1 -> NaN Division_impossible ! rmnx775 remaindernear 9.9e999999999 1 -> NaN Division_impossible ! rmnx776 remaindernear 9.99e999999999 1 -> NaN Division_impossible ! rmnx777 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible --- 487,513 ---- rmnx760 remaindernear NaN sNaN -> NaN Invalid_operation + -- propaging NaNs + rmnx761 remaindernear NaN1 NaN7 -> NaN1 + rmnx762 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation + rmnx763 remaindernear NaN3 -sNaN9 -> -NaN9 Invalid_operation + rmnx764 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation + rmnx765 remaindernear 15 NaN11 -> NaN11 + rmnx766 remaindernear NaN6 NaN12 -> NaN6 + rmnx767 remaindernear Inf -NaN13 -> -NaN13 + rmnx768 remaindernear NaN14 -Inf -> NaN14 + rmnx769 remaindernear 0 NaN15 -> NaN15 + rmnx770 remaindernear -NaN16 -0 -> -NaN16 + -- test some cases that are close to exponent overflow maxexponent: 999999999 minexponent: -999999999 ! rmnx780 remaindernear 1 1e999999999 -> 1 ! rmnx781 remaindernear 1 0.9e999999999 -> 1 ! rmnx782 remaindernear 1 0.99e999999999 -> 1 ! rmnx783 remaindernear 1 0.999999999e999999999 -> 1 ! rmnx784 remaindernear 9e999999999 1 -> NaN Division_impossible ! rmnx785 remaindernear 9.9e999999999 1 -> NaN Division_impossible ! rmnx786 remaindernear 9.99e999999999 1 -> NaN Division_impossible ! rmnx787 remaindernear 9.99999999e999999999 1 -> NaN Division_impossible *************** *** 504,515 **** maxexponent: 999999999 minexponent: -999999999 ! rmnx780 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded ! rmnx781 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible ! rmnx782 remaindernear +0.100 9E+999999999 -> 0.100 ! rmnx783 remaindernear 9E-999999999 +9.100 -> 9E-999999999 ! rmnx785 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded ! rmnx786 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible ! rmnx787 remaindernear -0.100 9E+999999999 -> -0.100 ! rmnx788 remaindernear 9E-999999999 -9.100 -> 9E-999999999 -- long operands checks --- 516,527 ---- maxexponent: 999999999 minexponent: -999999999 ! rmnx790 remaindernear +1.23456789012345E-0 9E+999999999 -> 1.23456789 Inexact Rounded ! rmnx791 remaindernear 9E+999999999 +0.23456789012345E-0 -> NaN Division_impossible ! rmnx792 remaindernear +0.100 9E+999999999 -> 0.100 ! rmnx793 remaindernear 9E-999999999 +9.100 -> 9E-999999999 ! rmnx795 remaindernear -1.23456789012345E-0 9E+999999999 -> -1.23456789 Inexact Rounded ! rmnx796 remaindernear 9E+999999999 -0.83456789012345E-0 -> NaN Division_impossible ! rmnx797 remaindernear -0.100 9E+999999999 -> -0.100 ! rmnx798 remaindernear 9E-999999999 -9.100 -> 9E-999999999 -- long operands checks Index: rescale.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/rescale.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rescale.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- rescale.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- [obsolete] Quantize.decTest has the improved version --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- [obsolete] Quantize.decTest has the improved version *************** *** 525,529 **** -- Specials ! resx580 rescale Inf -Inf -> NaN Invalid_operation resx581 rescale Inf -1000 -> NaN Invalid_operation resx582 rescale Inf -1 -> NaN Invalid_operation --- 525,529 ---- -- Specials ! resx580 rescale Inf -Inf -> Infinity resx581 rescale Inf -1000 -> NaN Invalid_operation resx582 rescale Inf -1 -> NaN Invalid_operation *************** *** 531,546 **** resx584 rescale Inf 1 -> NaN Invalid_operation resx585 rescale Inf 1000 -> NaN Invalid_operation ! resx586 rescale Inf Inf -> NaN Invalid_operation resx587 rescale -1000 Inf -> NaN Invalid_operation ! resx588 rescale -Inf Inf -> NaN Invalid_operation resx589 rescale -1 Inf -> NaN Invalid_operation resx590 rescale 0 Inf -> NaN Invalid_operation resx591 rescale 1 Inf -> NaN Invalid_operation resx592 rescale 1000 Inf -> NaN Invalid_operation ! resx593 rescale Inf Inf -> NaN Invalid_operation resx594 rescale Inf -0 -> NaN Invalid_operation resx595 rescale -0 Inf -> NaN Invalid_operation ! resx600 rescale -Inf -Inf -> NaN Invalid_operation resx601 rescale -Inf -1000 -> NaN Invalid_operation resx602 rescale -Inf -1 -> NaN Invalid_operation --- 531,546 ---- resx584 rescale Inf 1 -> NaN Invalid_operation resx585 rescale Inf 1000 -> NaN Invalid_operation ! resx586 rescale Inf Inf -> Infinity resx587 rescale -1000 Inf -> NaN Invalid_operation ! resx588 rescale -Inf Inf -> -Infinity resx589 rescale -1 Inf -> NaN Invalid_operation resx590 rescale 0 Inf -> NaN Invalid_operation resx591 rescale 1 Inf -> NaN Invalid_operation resx592 rescale 1000 Inf -> NaN Invalid_operation ! resx593 rescale Inf Inf -> Infinity resx594 rescale Inf -0 -> NaN Invalid_operation resx595 rescale -0 Inf -> NaN Invalid_operation ! resx600 rescale -Inf -Inf -> -Infinity resx601 rescale -Inf -1000 -> NaN Invalid_operation resx602 rescale -Inf -1 -> NaN Invalid_operation *************** *** 548,563 **** resx604 rescale -Inf 1 -> NaN Invalid_operation resx605 rescale -Inf 1000 -> NaN Invalid_operation ! resx606 rescale -Inf Inf -> NaN Invalid_operation resx607 rescale -1000 Inf -> NaN Invalid_operation ! resx608 rescale -Inf -Inf -> NaN Invalid_operation resx609 rescale -1 -Inf -> NaN Invalid_operation resx610 rescale 0 -Inf -> NaN Invalid_operation resx611 rescale 1 -Inf -> NaN Invalid_operation resx612 rescale 1000 -Inf -> NaN Invalid_operation ! resx613 rescale Inf -Inf -> NaN Invalid_operation resx614 rescale -Inf -0 -> NaN Invalid_operation resx615 rescale -0 -Inf -> NaN Invalid_operation ! resx621 rescale NaN -Inf -> NaN Invalid_operation resx622 rescale NaN -1000 -> NaN resx623 rescale NaN -1 -> NaN --- 548,563 ---- resx604 rescale -Inf 1 -> NaN Invalid_operation resx605 rescale -Inf 1000 -> NaN Invalid_operation ! resx606 rescale -Inf Inf -> -Infinity resx607 rescale -1000 Inf -> NaN Invalid_operation ! resx608 rescale -Inf -Inf -> -Infinity resx609 rescale -1 -Inf -> NaN Invalid_operation resx610 rescale 0 -Inf -> NaN Invalid_operation resx611 rescale 1 -Inf -> NaN Invalid_operation resx612 rescale 1000 -Inf -> NaN Invalid_operation ! resx613 rescale Inf -Inf -> Infinity resx614 rescale -Inf -0 -> NaN Invalid_operation resx615 rescale -0 -Inf -> NaN Invalid_operation ! resx621 rescale NaN -Inf -> NaN resx622 rescale NaN -1000 -> NaN resx623 rescale NaN -1 -> NaN *************** *** 565,577 **** resx625 rescale NaN 1 -> NaN resx626 rescale NaN 1000 -> NaN ! resx627 rescale NaN Inf -> NaN Invalid_operation resx628 rescale NaN NaN -> NaN ! resx629 rescale -Inf NaN -> NaN Invalid_operation resx630 rescale -1000 NaN -> NaN resx631 rescale -1 NaN -> NaN resx632 rescale 0 NaN -> NaN ! resx633 rescale 1 NaN -> NaN resx634 rescale 1000 NaN -> NaN ! resx635 rescale Inf NaN -> NaN Invalid_operation resx636 rescale NaN -0 -> NaN resx637 rescale -0 NaN -> NaN --- 565,577 ---- resx625 rescale NaN 1 -> NaN resx626 rescale NaN 1000 -> NaN ! resx627 rescale NaN Inf -> NaN resx628 rescale NaN NaN -> NaN ! resx629 rescale -Inf NaN -> NaN resx630 rescale -1000 NaN -> NaN resx631 rescale -1 NaN -> NaN resx632 rescale 0 NaN -> NaN ! resx633 rescale 1 -NaN -> -NaN resx634 rescale 1000 NaN -> NaN ! resx635 rescale Inf NaN -> NaN resx636 rescale NaN -0 -> NaN resx637 rescale -0 NaN -> NaN *************** *** 583,588 **** resx645 rescale sNaN 1 -> NaN Invalid_operation resx646 rescale sNaN 1000 -> NaN Invalid_operation ! resx647 rescale sNaN NaN -> NaN Invalid_operation ! resx648 rescale sNaN sNaN -> NaN Invalid_operation resx649 rescale NaN sNaN -> NaN Invalid_operation resx650 rescale -Inf sNaN -> NaN Invalid_operation --- 583,588 ---- resx645 rescale sNaN 1 -> NaN Invalid_operation resx646 rescale sNaN 1000 -> NaN Invalid_operation ! resx647 rescale -sNaN NaN -> -NaN Invalid_operation ! resx648 rescale sNaN -sNaN -> NaN Invalid_operation resx649 rescale NaN sNaN -> NaN Invalid_operation resx650 rescale -Inf sNaN -> NaN Invalid_operation *************** *** 590,594 **** resx652 rescale -1 sNaN -> NaN Invalid_operation resx653 rescale 0 sNaN -> NaN Invalid_operation ! resx654 rescale 1 sNaN -> NaN Invalid_operation resx655 rescale 1000 sNaN -> NaN Invalid_operation resx656 rescale Inf sNaN -> NaN Invalid_operation --- 590,594 ---- resx652 rescale -1 sNaN -> NaN Invalid_operation resx653 rescale 0 sNaN -> NaN Invalid_operation ! resx654 rescale 1 -sNaN -> -NaN Invalid_operation resx655 rescale 1000 sNaN -> NaN Invalid_operation resx656 rescale Inf sNaN -> NaN Invalid_operation *************** *** 597,600 **** --- 597,619 ---- resx659 rescale -0 sNaN -> NaN Invalid_operation + -- propagating NaNs + resx661 rescale NaN9 -Inf -> NaN9 + resx662 rescale NaN81 919 -> NaN81 + resx663 rescale NaN72 Inf -> NaN72 + resx664 rescale -NaN66 NaN5 -> -NaN66 + resx665 rescale -Inf NaN4 -> NaN4 + resx666 rescale -919 NaN32 -> NaN32 + resx667 rescale Inf NaN2 -> NaN2 + + resx671 rescale sNaN99 -Inf -> NaN99 Invalid_operation + resx672 rescale -sNaN98 -11 -> -NaN98 Invalid_operation + resx673 rescale sNaN97 NaN -> NaN97 Invalid_operation + resx674 rescale sNaN16 sNaN94 -> NaN16 Invalid_operation + resx675 rescale NaN95 sNaN93 -> NaN93 Invalid_operation + resx676 rescale -Inf sNaN92 -> NaN92 Invalid_operation + resx677 rescale 088 -sNaN91 -> -NaN91 Invalid_operation + resx678 rescale Inf -sNaN90 -> -NaN90 Invalid_operation + resx679 rescale NaN sNaN87 -> NaN87 Invalid_operation + -- subnormals and underflow precision: 4 Index: rounding.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/rounding.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rounding.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- rounding.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- These tests require that implementations take account of residues in --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- These tests require that implementations take account of residues in Index: squareroot.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/squareroot.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** squareroot.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- squareroot.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 2948,2951 **** --- 2948,2957 ---- sqtx822 squareroot NaN -> NaN sqtx823 squareroot sNaN -> NaN Invalid_operation + -- propagating NaNs + sqtx824 squareroot sNaN123 -> NaN123 Invalid_operation + sqtx825 squareroot -sNaN321 -> -NaN321 Invalid_operation + sqtx826 squareroot NaN456 -> NaN456 + sqtx827 squareroot -NaN654 -> -NaN654 + sqtx828 squareroot NaN1 -> NaN1 -- Null test Index: subtract.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/subtract.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** subtract.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- subtract.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 724,728 **** subx821 subtract NaN Inf -> NaN ! subx822 subtract NaN 1000 -> NaN subx823 subtract NaN 1 -> NaN subx824 subtract NaN 0 -> NaN --- 724,728 ---- subx821 subtract NaN Inf -> NaN ! subx822 subtract -NaN 1000 -> -NaN subx823 subtract NaN 1 -> NaN subx824 subtract NaN 0 -> NaN *************** *** 731,735 **** subx827 subtract NaN -1000 -> NaN subx828 subtract NaN -Inf -> NaN ! subx829 subtract NaN NaN -> NaN subx830 subtract -Inf NaN -> NaN subx831 subtract -1000 NaN -> NaN --- 731,735 ---- subx827 subtract NaN -1000 -> NaN subx828 subtract NaN -Inf -> NaN ! subx829 subtract -NaN NaN -> -NaN subx830 subtract -Inf NaN -> NaN subx831 subtract -1000 NaN -> NaN *************** *** 738,746 **** subx834 subtract 0 NaN -> NaN subx835 subtract 1 NaN -> NaN ! subx836 subtract 1000 NaN -> NaN subx837 subtract Inf NaN -> NaN subx841 subtract sNaN Inf -> NaN Invalid_operation ! subx842 subtract sNaN 1000 -> NaN Invalid_operation subx843 subtract sNaN 1 -> NaN Invalid_operation subx844 subtract sNaN 0 -> NaN Invalid_operation --- 738,746 ---- subx834 subtract 0 NaN -> NaN subx835 subtract 1 NaN -> NaN ! subx836 subtract 1000 -NaN -> -NaN subx837 subtract Inf NaN -> NaN subx841 subtract sNaN Inf -> NaN Invalid_operation ! subx842 subtract -sNaN 1000 -> -NaN Invalid_operation subx843 subtract sNaN 1 -> NaN Invalid_operation subx844 subtract sNaN 0 -> NaN Invalid_operation *************** *** 751,755 **** subx849 subtract sNaN sNaN -> NaN Invalid_operation subx850 subtract NaN sNaN -> NaN Invalid_operation ! subx851 subtract -Inf sNaN -> NaN Invalid_operation subx852 subtract -1000 sNaN -> NaN Invalid_operation subx853 subtract -1 sNaN -> NaN Invalid_operation --- 751,755 ---- subx849 subtract sNaN sNaN -> NaN Invalid_operation subx850 subtract NaN sNaN -> NaN Invalid_operation ! subx851 subtract -Inf -sNaN -> -NaN Invalid_operation subx852 subtract -1000 sNaN -> NaN Invalid_operation subx853 subtract -1 sNaN -> NaN Invalid_operation *************** *** 761,764 **** --- 761,786 ---- subx859 subtract NaN sNaN -> NaN Invalid_operation + -- propagating NaNs + subx861 subtract NaN01 -Inf -> NaN1 + subx862 subtract -NaN02 -1000 -> -NaN2 + subx863 subtract NaN03 1000 -> NaN3 + subx864 subtract NaN04 Inf -> NaN4 + subx865 subtract NaN05 NaN61 -> NaN5 + subx866 subtract -Inf -NaN71 -> -NaN71 + subx867 subtract -1000 NaN81 -> NaN81 + subx868 subtract 1000 NaN91 -> NaN91 + subx869 subtract Inf NaN101 -> NaN101 + subx871 subtract sNaN011 -Inf -> NaN11 Invalid_operation + subx872 subtract sNaN012 -1000 -> NaN12 Invalid_operation + subx873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation + subx874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation + subx875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation + subx876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation + subx877 subtract -Inf sNaN201 -> NaN201 Invalid_operation + subx878 subtract -1000 sNaN211 -> NaN211 Invalid_operation + subx879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation + subx880 subtract Inf sNaN231 -> NaN231 Invalid_operation + subx881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation + -- subnormals and underflows precision: 3 Index: testall.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/testall.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testall.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- testall.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- core tests (using Extended: 1) -------------------------------------- --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- core tests (using Extended: 1) -------------------------------------- *************** *** 42,45 **** --- 42,46 ---- dectest: rescale -- [obsolete] dectest: rounding + dectest: samequantum dectest: squareroot dectest: subtract Index: tointegral.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/tointegral.decTest,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tointegral.decTest 12 Aug 2003 23:05:30 -0000 1.1 --- tointegral.decTest 6 Feb 2004 16:56:03 -0000 1.2 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 -- This set of tests tests the extended specification 'round-to-integral --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 -- This set of tests tests the extended specification 'round-to-integral *************** *** 24,28 **** -- All non-zero results are defined as being those from either copy or -- quantize, so those are assumed to have been tested. ! -- Note that 754r requires that not be set, and we similarly -- assume Rounded is not set. --- 24,28 ---- -- All non-zero results are defined as being those from either copy or -- quantize, so those are assumed to have been tested. ! -- Note that 754r requires that Inexact not be set, and we similarly -- assume Rounded is not set. *************** *** 149,152 **** --- 149,159 ---- intx150 tointegral -0E+4 -> -0E+4 intx151 tointegral -0E+5 -> -0E+5 + -- propagating NaNs + intx152 tointegral NaN808 -> NaN808 + intx153 tointegral sNaN080 -> NaN80 Invalid_operation + intx154 tointegral -NaN808 -> -NaN808 + intx155 tointegral -sNaN080 -> -NaN80 Invalid_operation + intx156 tointegral -NaN -> -NaN + intx157 tointegral -sNaN -> -NaN Invalid_operation -- examples Index: trim.decTest =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/decimal/tests/trim.decTest,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** trim.decTest 12 Aug 2003 23:05:30 -0000 1.4 --- trim.decTest 6 Feb 2004 16:56:03 -0000 1.5 *************** *** 18,22 **** -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.28 extended: 1 --- 18,22 ---- -- mfc@uk.ibm.com -- ------------------------------------------------------------------------ ! version: 2.35 extended: 1 *************** *** 142,145 **** --- 142,151 ---- trmx322 trim NaN -> NaN trmx323 trim sNaN -> sNaN + trmx324 trim NaN999 -> NaN999 + trmx325 trim sNaN777 -> sNaN777 + trmx326 trim -NaN -> -NaN + trmx327 trim -sNaN -> -sNaN + trmx328 trim -NaN999 -> -NaN999 + trmx329 trim -sNaN777 -> -sNaN777 -- Null test From doerwalter at users.sourceforge.net Fri Feb 6 13:30:43 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Feb 6 13:33:24 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_types.py,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8301/Lib/test Modified Files: test_types.py Log Message: Fix test failure message (from SF patch #885008) Index: test_types.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** test_types.py 8 Dec 2003 11:38:45 -0000 1.56 --- test_types.py 6 Feb 2004 18:30:31 -0000 1.57 *************** *** 29,33 **** if 0 or 0: raise TestFailed, '0 or 0 is true instead of false' if 1 and 1: pass ! else: raise TestFailed, '1 and 1 is false instead of false' if not 1: raise TestFailed, 'not 1 is true instead of false' --- 29,33 ---- if 0 or 0: raise TestFailed, '0 or 0 is true instead of false' if 1 and 1: pass ! else: raise TestFailed, '1 and 1 is false instead of true' if not 1: raise TestFailed, 'not 1 is true instead of false' From rhettinger at users.sourceforge.net Fri Feb 6 13:32:38 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 13:35:18 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.373,2.374 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8122 Modified Files: ceval.c Log Message: SF patch #864059: optimize eval_frame Simplified version of Neal Norwitz's patch which adds gotos for opcodes that set "why". This skips a number of tests where the outcome of the tests are known in advance. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.373 retrieving revision 2.374 diff -C2 -d -r2.373 -r2.374 *** ceval.c 20 Nov 2003 01:44:58 -0000 2.373 --- ceval.c 6 Feb 2004 18:32:33 -0000 2.374 *************** *** 1579,1588 **** case BREAK_LOOP: why = WHY_BREAK; ! break; case CONTINUE_LOOP: retval = PyInt_FromLong(oparg); why = WHY_CONTINUE; ! break; case RAISE_VARARGS: --- 1579,1588 ---- case BREAK_LOOP: why = WHY_BREAK; ! goto fast_block_end; case CONTINUE_LOOP: retval = PyInt_FromLong(oparg); why = WHY_CONTINUE; ! goto fast_block_end; case RAISE_VARARGS: *************** *** 1621,1625 **** retval = POP(); why = WHY_RETURN; ! break; case YIELD_VALUE: --- 1621,1625 ---- retval = POP(); why = WHY_RETURN; ! goto fast_block_end; case YIELD_VALUE: *************** *** 1627,1632 **** f->f_stacktop = stack_pointer; why = WHY_YIELD; ! break; ! case EXEC_STMT: --- 1627,1631 ---- f->f_stacktop = stack_pointer; why = WHY_YIELD; ! goto fast_yield; case EXEC_STMT: *************** *** 2328,2331 **** --- 2327,2331 ---- /* Unwind stacks if a (pseudo) exception occurred */ + fast_block_end: while (why != WHY_NOT && why != WHY_YIELD && f->f_iblock > 0) { PyTryBlock *b = PyFrame_BlockPop(f); *************** *** 2411,2414 **** --- 2411,2415 ---- retval = NULL; + fast_yield: if (tstate->use_tracing) { if (tstate->c_tracefunc From doerwalter at users.sourceforge.net Fri Feb 6 13:33:14 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Fri Feb 6 13:35:52 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_types.py, 1.55, 1.55.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8790/Lib/test Modified Files: Tag: release23-maint test_types.py Log Message: Backport checkin: Fix test failure message (from SF patch #885008) Index: test_types.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v retrieving revision 1.55 retrieving revision 1.55.8.1 diff -C2 -d -r1.55 -r1.55.8.1 *** test_types.py 17 Jun 2003 19:27:39 -0000 1.55 --- test_types.py 6 Feb 2004 18:33:11 -0000 1.55.8.1 *************** *** 33,37 **** if 0 or 0: raise TestFailed, '0 or 0 is true instead of false' if 1 and 1: pass ! else: raise TestFailed, '1 and 1 is false instead of false' if not 1: raise TestFailed, 'not 1 is true instead of false' --- 33,37 ---- if 0 or 0: raise TestFailed, '0 or 0 is true instead of false' if 1 and 1: pass ! else: raise TestFailed, '1 and 1 is false instead of true' if not 1: raise TestFailed, 'not 1 is true instead of false' From rhettinger at users.sourceforge.net Fri Feb 6 14:04:59 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 14:07:38 2004 Subject: [Python-checkins] python/dist/src/Modules collectionsmodule.c, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15523/Modules Modified Files: collectionsmodule.c Log Message: Have deques support high volume loads. Index: collectionsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/collectionsmodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** collectionsmodule.c 29 Jan 2004 07:29:32 -0000 1.2 --- collectionsmodule.c 6 Feb 2004 19:04:56 -0000 1.3 *************** *** 175,178 **** --- 175,244 ---- PyDoc_STRVAR(popleft_doc, "Remove and return the leftmost element."); + static PyObject * + deque_extend(dequeobject *deque, PyObject *iterable) + { + PyObject *it, *item; + + it = PyObject_GetIter(iterable); + if (it == NULL) + return NULL; + + while ((item = PyIter_Next(it)) != NULL) { + deque->rightindex++; + deque->len++; + if (deque->rightindex == BLOCKLEN) { + block *b = newblock(deque->rightblock, NULL); + if (b == NULL) + return NULL; + assert(deque->rightblock->rightlink == NULL); + deque->rightblock->rightlink = b; + deque->rightblock = b; + deque->rightindex = 0; + } + Py_INCREF(item); + deque->rightblock->data[deque->rightindex] = item; + } + Py_DECREF(it); + if (PyErr_Occurred()) + return NULL; + Py_RETURN_NONE; + } + + PyDoc_STRVAR(extend_doc, + "Extend the right side of the deque with elements from the iterable"); + + static PyObject * + deque_extendleft(dequeobject *deque, PyObject *iterable) + { + PyObject *it, *item; + + it = PyObject_GetIter(iterable); + if (it == NULL) + return NULL; + + while ((item = PyIter_Next(it)) != NULL) { + deque->leftindex--; + deque->len++; + if (deque->leftindex == -1) { + block *b = newblock(NULL, deque->leftblock); + if (b == NULL) + return NULL; + assert(deque->leftblock->leftlink == NULL); + deque->leftblock->leftlink = b; + deque->leftblock = b; + deque->leftindex = BLOCKLEN - 1; + } + Py_INCREF(item); + deque->leftblock->data[deque->leftindex] = item; + } + Py_DECREF(it); + if (PyErr_Occurred()) + return NULL; + Py_RETURN_NONE; + } + + PyDoc_STRVAR(extendleft_doc, + "Extend the left side of the deque with elements from the iterable"); + static int deque_len(dequeobject *deque) *************** *** 357,361 **** deque_init(dequeobject *deque, PyObject *args, PyObject *kwds) { ! PyObject *iterable = NULL, *it, *item; if (!PyArg_UnpackTuple(args, "deque", 0, 1, &iterable)) --- 423,427 ---- deque_init(dequeobject *deque, PyObject *args, PyObject *kwds) { ! PyObject *iterable = NULL; if (!PyArg_UnpackTuple(args, "deque", 0, 1, &iterable)) *************** *** 363,389 **** if (iterable != NULL) { ! it = PyObject_GetIter(iterable); ! if (it == NULL) ! return -1; ! ! while ((item = PyIter_Next(it)) != NULL) { ! deque->rightindex++; ! deque->len++; ! if (deque->rightindex == BLOCKLEN) { ! block *b = newblock(deque->rightblock, NULL); ! if (b == NULL) { ! Py_DECREF(it); ! Py_DECREF(item); ! return -1; ! } ! deque->rightblock->rightlink = b; ! deque->rightblock = b; ! deque->rightindex = 0; ! } ! deque->rightblock->data[deque->rightindex] = item; ! } ! Py_DECREF(it); ! if (PyErr_Occurred()) return -1; } return 0; --- 429,436 ---- if (iterable != NULL) { ! PyObject *rv = deque_extend(deque, iterable); ! if (rv == NULL) return -1; + Py_DECREF(rv); } return 0; *************** *** 414,417 **** --- 461,468 ---- {"__reduce__", (PyCFunction)deque_reduce, METH_NOARGS, reduce_doc}, + {"extend", (PyCFunction)deque_extend, + METH_O, extend_doc}, + {"extendleft", (PyCFunction)deque_extendleft, + METH_O, extendleft_doc}, {NULL, NULL} /* sentinel */ }; From rhettinger at users.sourceforge.net Fri Feb 6 14:04:59 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 14:07:40 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_deque.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15523/Lib/test Modified Files: test_deque.py Log Message: Have deques support high volume loads. Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_deque.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_deque.py 29 Jan 2004 06:37:49 -0000 1.1 --- test_deque.py 6 Feb 2004 19:04:56 -0000 1.2 *************** *** 29,32 **** --- 29,44 ---- self.assertEqual(list(d), range(50, 150)) + def test_extend(self): + d = deque('a') + self.assertRaises(TypeError, d.extend, 1) + d.extend('bcd') + self.assertEqual(list(d), list('abcd')) + + def test_extendleft(self): + d = deque('a') + self.assertRaises(TypeError, d.extendleft, 1) + d.extendleft('bcd') + self.assertEqual(list(d), list(reversed('abcd'))) + def test_len(self): d = deque('ab') From rhettinger at users.sourceforge.net Fri Feb 6 14:04:59 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 14:07:42 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcollections.tex, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15523/Doc/lib Modified Files: libcollections.tex Log Message: Have deques support high volume loads. Index: libcollections.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcollections.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** libcollections.tex 29 Jan 2004 07:27:45 -0000 1.1 --- libcollections.tex 6 Feb 2004 19:04:56 -0000 1.2 *************** *** 38,41 **** --- 38,52 ---- \end{methoddesc} + \begin{methoddesc}{extend}{iterable} + Extend the right side of the deque by appending elements from + the iterable argument. + \end{methoddesc} + + \begin{methoddesc}{extendleft}{iterable} + Extend the left side of the deque by appending elements from + \var{iterable}. Note, the series of left appends results in + reversing the order of elements in the iterable argument. + \end{methoddesc} + \begin{methoddesc}{pop}{} Remove and return an element from the right side of the deque. *************** *** 76,84 **** >>> 'h' in d # search the deque True ! >>> d.__init__('jkl') # use __init__ to append many elements at once >>> d deque(['g', 'h', 'i', 'j', 'k', 'l']) >>> d.clear() # empty the deque ! >>> d.pop() # try to pop from an empty deque Traceback (most recent call last): --- 87,95 ---- >>> 'h' in d # search the deque True ! >>> d.extend('jkl') # extend() will append many elements at once >>> d deque(['g', 'h', 'i', 'j', 'k', 'l']) >>> d.clear() # empty the deque ! >>> d.pop() # cannot pop from an empty deque Traceback (most recent call last): *************** *** 86,88 **** --- 97,104 ---- d.pop() LookupError: pop from an empty deque + + >>> d.extendleft('abc') # extendleft() reverses the element order + >>> d + deque(['c', 'b', 'a']) + \end{verbatim} From rhettinger at users.sourceforge.net Fri Feb 6 21:16:27 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 21:19:09 2004 Subject: [Python-checkins] python/dist/src/Lib mailbox.py,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13831 Modified Files: mailbox.py Log Message: Lists work better when popping from the right. Index: mailbox.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mailbox.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** mailbox.py 12 Sep 2002 05:08:00 -0000 1.40 --- mailbox.py 7 Feb 2004 02:16:24 -0000 1.41 *************** *** 200,203 **** --- 200,204 ---- # before that str() added 'L': self.boxes = map(str, list) + self.boxes.reverse() self.factory = factory *************** *** 208,212 **** if not self.boxes: return None ! fn = self.boxes.pop(0) fp = open(os.path.join(self.dirname, fn)) msg = self.factory(fp) --- 209,213 ---- if not self.boxes: return None ! fn = self.boxes.pop() fp = open(os.path.join(self.dirname, fn)) msg = self.factory(fp) *************** *** 234,238 **** boxes += [os.path.join(curdir, f) for f in os.listdir(curdir) if f[0] != '.'] ! self.boxes = boxes --- 235,239 ---- boxes += [os.path.join(curdir, f) for f in os.listdir(curdir) if f[0] != '.'] ! boxes.reverse() self.boxes = boxes *************** *** 243,247 **** if not self.boxes: return None ! fn = self.boxes.pop(0) fp = open(fn) return self.factory(fp) --- 244,248 ---- if not self.boxes: return None ! fn = self.boxes.pop() fp = open(fn) return self.factory(fp) From rhettinger at users.sourceforge.net Fri Feb 6 21:45:24 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 21:48:07 2004 Subject: [Python-checkins] python/dist/src/Modules collectionsmodule.c, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18663/Modules Modified Files: collectionsmodule.c Log Message: * Fix ref counting in extend() and extendleft(). * Let deques support reversed(). Index: collectionsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/collectionsmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** collectionsmodule.c 6 Feb 2004 19:04:56 -0000 1.3 --- collectionsmodule.c 7 Feb 2004 02:45:22 -0000 1.4 *************** *** 189,194 **** if (deque->rightindex == BLOCKLEN) { block *b = newblock(deque->rightblock, NULL); ! if (b == NULL) return NULL; assert(deque->rightblock->rightlink == NULL); deque->rightblock->rightlink = b; --- 189,197 ---- if (deque->rightindex == BLOCKLEN) { block *b = newblock(deque->rightblock, NULL); ! if (b == NULL) { ! Py_DECREF(item); ! Py_DECREF(it); return NULL; + } assert(deque->rightblock->rightlink == NULL); deque->rightblock->rightlink = b; *************** *** 196,200 **** deque->rightindex = 0; } - Py_INCREF(item); deque->rightblock->data[deque->rightindex] = item; } --- 199,202 ---- *************** *** 222,227 **** if (deque->leftindex == -1) { block *b = newblock(NULL, deque->leftblock); ! if (b == NULL) return NULL; assert(deque->leftblock->leftlink == NULL); deque->leftblock->leftlink = b; --- 224,232 ---- if (deque->leftindex == -1) { block *b = newblock(NULL, deque->leftblock); ! if (b == NULL) { ! Py_DECREF(item); ! Py_DECREF(it); return NULL; + } assert(deque->leftblock->leftlink == NULL); deque->leftblock->leftlink = b; *************** *** 229,233 **** deque->leftindex = BLOCKLEN - 1; } - Py_INCREF(item); deque->leftblock->data[deque->leftindex] = item; } --- 234,237 ---- *************** *** 445,448 **** --- 449,455 ---- static PyObject *deque_iter(dequeobject *deque); + static PyObject *deque_reviter(dequeobject *deque); + PyDoc_STRVAR(reversed_doc, + "D.__reversed__() -- return a reverse iterator over the deque"); static PyMethodDef deque_methods[] = { *************** *** 461,464 **** --- 468,473 ---- {"__reduce__", (PyCFunction)deque_reduce, METH_NOARGS, reduce_doc}, + {"__reversed__", (PyCFunction)deque_reviter, + METH_NOARGS, reversed_doc}, {"extend", (PyCFunction)deque_extend, METH_O, extend_doc}, *************** *** 609,612 **** --- 618,698 ---- }; + /*********************** Deque Reverse Iterator **************************/ + + PyTypeObject dequereviter_type; + + static PyObject * + deque_reviter(dequeobject *deque) + { + dequeiterobject *it; + + it = PyObject_New(dequeiterobject, &dequereviter_type); + if (it == NULL) + return NULL; + it->b = deque->rightblock; + it->index = deque->rightindex; + Py_INCREF(deque); + it->deque = deque; + it->len = deque->len; + return (PyObject *)it; + } + + static PyObject * + dequereviter_next(dequeiterobject *it) + { + PyObject *item; + if (it->b == it->deque->leftblock && it->index < it->deque->leftindex) + return NULL; + + if (it->len != it->deque->len) { + it->len = -1; /* Make this state sticky */ + PyErr_SetString(PyExc_RuntimeError, + "deque changed size during iteration"); + return NULL; + } + + item = it->b->data[it->index]; + it->index--; + if (it->index == -1 && it->b->leftlink != NULL) { + it->b = it->b->leftlink; + it->index = BLOCKLEN - 1; + } + Py_INCREF(item); + return item; + } + + PyTypeObject dequereviter_type = { + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ + "deque_reverse_iterator", /* tp_name */ + sizeof(dequeiterobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)dequeiter_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (iternextfunc)dequereviter_next, /* tp_iternext */ + 0, + }; + /* module level code ********************************************************/ *************** *** 630,633 **** --- 716,722 ---- return; + if (PyType_Ready(&dequereviter_type) < 0) + return; + return; } From rhettinger at users.sourceforge.net Fri Feb 6 21:45:23 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 21:48:09 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcollections.tex, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18663/Doc/lib Modified Files: libcollections.tex Log Message: * Fix ref counting in extend() and extendleft(). * Let deques support reversed(). Index: libcollections.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcollections.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** libcollections.tex 6 Feb 2004 19:04:56 -0000 1.2 --- libcollections.tex 7 Feb 2004 02:45:21 -0000 1.3 *************** *** 61,65 **** In addition to the above, deques support iteration, membership testing using the \keyword{in} operator, \samp{len(d)}, \samp{copy.copy(d)}, ! \samp{copy.deepcopy(d)}, and pickling. Example: --- 61,65 ---- In addition to the above, deques support iteration, membership testing using the \keyword{in} operator, \samp{len(d)}, \samp{copy.copy(d)}, ! \samp{copy.deepcopy(d)}, \samp{reversed(d)} and pickling. Example: *************** *** 85,88 **** --- 85,90 ---- >>> list(d) # list the contents of the deque ['g', 'h', 'i'] + >>> list(reversed(d)) # list the contents of a deque in reverse + ['i', 'h', 'g'] >>> 'h' in d # search the deque True From rhettinger at users.sourceforge.net Fri Feb 6 21:45:24 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 21:48:11 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_deque.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18663/Lib/test Modified Files: test_deque.py Log Message: * Fix ref counting in extend() and extendleft(). * Let deques support reversed(). Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_deque.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_deque.py 6 Feb 2004 19:04:56 -0000 1.2 --- test_deque.py 7 Feb 2004 02:45:21 -0000 1.3 *************** *** 183,186 **** --- 183,190 ---- self.assertEqual(list(d), list(e)) + def test_reversed(self): + for s in ('abcd', xrange(2000)): + self.assertEqual(list(reversed(deque(s))), list(reversed(s))) + def R(seqn): 'Regular generator' From rhettinger at users.sourceforge.net Fri Feb 6 22:19:12 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Fri Feb 6 22:21:56 2004 Subject: [Python-checkins] python/dist/src/Lib asynchat.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24421 Modified Files: asynchat.py Log Message: Use collection.deque() instead of a list for a FIFO queue. Index: asynchat.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asynchat.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** asynchat.py 10 Mar 2003 15:16:54 -0000 1.21 --- asynchat.py 7 Feb 2004 03:19:10 -0000 1.22 *************** *** 49,52 **** --- 49,53 ---- import socket import asyncore + from collections import deque class async_chat (asyncore.dispatcher): *************** *** 251,257 **** def __init__ (self, list=None): if not list: ! self.list = [] else: ! self.list = list def __len__ (self): --- 252,258 ---- def __init__ (self, list=None): if not list: ! self.list = deque() else: ! self.list = deque(list) def __len__ (self): *************** *** 262,273 **** def first (self): ! return self.list[0] def push (self, data): ! self.list.append (data) def pop (self): if self.list: ! return (1, self.list.pop(0)) else: return (0, None) --- 263,278 ---- def first (self): ! it = iter(self.list) ! try: ! return it.next() ! except StopIteration: ! raise IndexError def push (self, data): ! self.list.append(data) def pop (self): if self.list: ! return (1, self.list.popleft()) else: return (0, None) From rhettinger at users.sourceforge.net Fri Feb 6 21:45:24 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Feb 7 00:18:05 2004 Subject: [Python-checkins] python/dist/src/Objects enumobject.c,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18663/Objects Modified Files: enumobject.c Log Message: * Fix ref counting in extend() and extendleft(). * Let deques support reversed(). Index: enumobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/enumobject.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** enumobject.c 7 Nov 2003 15:38:08 -0000 1.10 --- enumobject.c 7 Feb 2004 02:45:22 -0000 1.11 *************** *** 175,180 **** return NULL; ! /* Special case optimization for xrange and lists */ ! if (PyRange_Check(seq) || PyList_Check(seq)) return PyObject_CallMethod(seq, "__reversed__", NULL); --- 175,179 ---- return NULL; ! if (PyObject_HasAttrString(seq, "__reversed__")) return PyObject_CallMethod(seq, "__reversed__", NULL); From montanaro at users.sourceforge.net Sat Feb 7 07:50:22 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 07:53:09 2004 Subject: [Python-checkins] python/dist/src setup.py,1.182,1.183 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14539 Modified Files: setup.py Log Message: a couple other sunos4 support items removed Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.182 retrieving revision 1.183 diff -C2 -d -r1.182 -r1.183 *** setup.py 29 Jan 2004 06:37:46 -0000 1.182 --- setup.py 7 Feb 2004 12:50:19 -0000 1.183 *************** *** 656,665 **** libraries = libs) ) ! # Curses support, requring the System V version of curses, often # provided by the ncurses library. - if platform == 'sunos4': - inc_dirs += ['/usr/5include'] - lib_dirs += ['/usr/5lib'] - if (self.compiler.find_library_file(lib_dirs, 'ncurses')): curses_libs = ['ncurses'] --- 656,661 ---- libraries = libs) ) ! # Curses support, requiring the System V version of curses, often # provided by the ncurses library. if (self.compiler.find_library_file(lib_dirs, 'ncurses')): curses_libs = ['ncurses'] From montanaro at users.sourceforge.net Sat Feb 7 07:50:22 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 07:53:10 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libsun.tex,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14539/Doc/lib Modified Files: libsun.tex Log Message: a couple other sunos4 support items removed Index: libsun.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsun.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** libsun.tex 19 Feb 1998 18:59:47 -0000 1.8 --- libsun.tex 7 Feb 2004 12:50:19 -0000 1.9 *************** *** 3,6 **** The modules described in this chapter provide interfaces to features ! that are unique to the SunOS operating system (versions 4 and 5; the ! latter is also known as Solaris version 2). --- 3,5 ---- The modules described in this chapter provide interfaces to features ! that are unique to SunOS 5 (also known as Solaris version 2). From montanaro at users.sourceforge.net Sat Feb 7 07:55:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 07:58:35 2004 Subject: [Python-checkins] python/dist/src configure, 1.438, 1.439 configure.in, 1.449, 1.450 pyconfig.h.in, 1.92, 1.93 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15587 Modified Files: configure configure.in pyconfig.h.in Log Message: Remove HAVE_STRPTIME - no longer necessary with the pure Python version of time.strptime(). Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.438 retrieving revision 1.439 diff -C2 -d -r1.438 -r1.439 *** configure 2 Feb 2004 06:05:23 -0000 1.438 --- configure 7 Feb 2004 12:55:44 -0000 1.439 *************** *** 12280,12284 **** - for ac_func in alarm chown clock confstr ctermid execv \ fork fpathconf ftime ftruncate \ --- 12280,12283 ---- *************** *** 12290,12294 **** select setegid seteuid setgid \ setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ ! sigaction siginterrupt sigrelse strftime strptime \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wcscoll _getpty --- 12289,12293 ---- select setegid seteuid setgid \ setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ ! sigaction siginterrupt sigrelse strftime \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wcscoll _getpty Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.449 retrieving revision 1.450 diff -C2 -d -r1.449 -r1.450 *** configure.in 2 Feb 2004 06:03:08 -0000 1.449 --- configure.in 7 Feb 2004 12:55:45 -0000 1.450 *************** *** 2013,2017 **** select setegid seteuid setgid \ setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ ! sigaction siginterrupt sigrelse strftime strptime \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wcscoll _getpty) --- 2013,2017 ---- select setegid seteuid setgid \ setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ ! sigaction siginterrupt sigrelse strftime \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wcscoll _getpty) Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** pyconfig.h.in 2 Feb 2004 06:05:24 -0000 1.92 --- pyconfig.h.in 7 Feb 2004 12:55:45 -0000 1.93 *************** *** 472,478 **** #undef HAVE_STROPTS_H - /* Define to 1 if you have the `strptime' function. */ - #undef HAVE_STRPTIME - /* Define to 1 if `st_blksize' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE --- 472,475 ---- From montanaro at users.sourceforge.net Sat Feb 7 07:55:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 07:58:36 2004 Subject: [Python-checkins] python/dist/src/PC/os2emx pyconfig.h,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2emx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15587/PC/os2emx Modified Files: pyconfig.h Log Message: Remove HAVE_STRPTIME - no longer necessary with the pure Python version of time.strptime(). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2emx/pyconfig.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pyconfig.h 16 Jul 2003 13:31:11 -0000 1.7 --- pyconfig.h 7 Feb 2004 12:55:46 -0000 1.8 *************** *** 240,246 **** #define HAVE_STRFTIME 1 - /* Define if you have the strptime function. */ - #define HAVE_STRPTIME 1 - /* Define if you have the tcgetpgrp function. */ #define HAVE_TCGETPGRP 1 --- 240,243 ---- From montanaro at users.sourceforge.net Sat Feb 7 07:55:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 07:58:39 2004 Subject: [Python-checkins] python/dist/src/PC/os2vacpp pyconfig.h,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2vacpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15587/PC/os2vacpp Modified Files: pyconfig.h Log Message: Remove HAVE_STRPTIME - no longer necessary with the pure Python version of time.strptime(). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2vacpp/pyconfig.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pyconfig.h 9 Jun 2002 13:41:37 -0000 1.4 --- pyconfig.h 7 Feb 2004 12:55:46 -0000 1.5 *************** *** 144,148 **** #define HAVE_CLOCK 1 /* clock() */ #define HAVE_STRFTIME 1 /* strftime() */ - #define HAVE_STRPTIME 1 /* strptime() */ #define HAVE_MKTIME 1 /* mktime() */ #define HAVE_TZNAME 1 /* No tm_zone but do have tzname[] */ --- 144,147 ---- From montanaro at users.sourceforge.net Sat Feb 7 07:55:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 07:58:42 2004 Subject: [Python-checkins] python/dist/src/RISCOS pyconfig.h,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15587/RISCOS Modified Files: pyconfig.h Log Message: Remove HAVE_STRPTIME - no longer necessary with the pure Python version of time.strptime(). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/pyconfig.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pyconfig.h 17 Jan 2004 14:19:44 -0000 1.10 --- pyconfig.h 7 Feb 2004 12:55:46 -0000 1.11 *************** *** 515,521 **** #define HAVE_STRFTIME 1 - /* Define if you have the strptime function. */ - #undef HAVE_STRPTIME - /* Define if you have the symlink function. */ #undef HAVE_SYMLINK --- 515,518 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:00:20 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 08:03:09 2004 Subject: [Python-checkins] python/dist/src/Python thread_pthread.h, 2.49, 2.50 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16650 Modified Files: thread_pthread.h Log Message: Remove support for systems defining Py_PTHREAD_D[467] in Python/thread_pthread.h. Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.49 retrieving revision 2.50 diff -C2 -d -r2.49 -r2.50 *** thread_pthread.h 17 Jan 2004 00:29:32 -0000 2.49 --- thread_pthread.h 7 Feb 2004 13:00:18 -0000 2.50 *************** *** 21,81 **** #endif - - /* try to determine what version of the Pthread Standard is installed. - * this is important, since all sorts of parameter types changed from - * draft to draft and there are several (incompatible) drafts in - * common use. these macros are a start, at least. - * 12 May 1997 -- david arnold - */ - - #if defined(__ultrix) && defined(__mips) && defined(_DECTHREADS_) - /* _DECTHREADS_ is defined in cma.h which is included by pthread.h */ - # define PY_PTHREAD_D4 - # error Systems with PY_PTHREAD_D4 are unsupported. See README. - - #elif defined(__osf__) && defined (__alpha) - /* _DECTHREADS_ is defined in cma.h which is included by pthread.h */ - # if !defined(_PTHREAD_ENV_ALPHA) || defined(_PTHREAD_USE_D4) || defined(PTHREAD_USE_D4) - # define PY_PTHREAD_D4 - # error Systems with PY_PTHREAD_D4 are unsupported. See README. - # else - # define PY_PTHREAD_STD - # endif - - #elif defined(_AIX) - /* SCHED_BG_NP is defined if using AIX DCE pthreads - * but it is unsupported by AIX 4 pthreads. Default - * attributes for AIX 4 pthreads equal to NULL. For - * AIX DCE pthreads they should be left unchanged. - */ - # if !defined(SCHED_BG_NP) - # define PY_PTHREAD_STD - # else - # define PY_PTHREAD_D7 - # error Systems with PY_PTHREAD_D7 are unsupported. See README. - # endif - - #elif defined(__hpux) && defined(_DECTHREADS_) - # define PY_PTHREAD_D4 - # error Systems with PY_PTHREAD_D4 are unsupported. See README. - - #else /* Default case */ - # define PY_PTHREAD_STD - - #endif - - /* set default attribute object for different versions */ - - #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D7) - #if !defined(pthread_attr_default) - # define pthread_attr_default pthread_attr_default - #endif - #if !defined(pthread_mutexattr_default) - # define pthread_mutexattr_default pthread_mutexattr_default - #endif - #if !defined(pthread_condattr_default) - # define pthread_condattr_default pthread_condattr_default - #endif - #elif defined(PY_PTHREAD_STD) #if !defined(pthread_attr_default) # define pthread_attr_default ((pthread_attr_t *)NULL) --- 21,24 ---- *************** *** 87,91 **** # define pthread_condattr_default ((pthread_condattr_t *)NULL) #endif - #endif --- 30,33 ---- *************** *** 204,216 **** status = pthread_create(&th, - #if defined(PY_PTHREAD_D4) - pthread_attr_default, - (pthread_startroutine_t)func, - (pthread_addr_t)arg - #elif defined(PY_PTHREAD_D7) - pthread_attr_default, - func, - arg - #elif defined(PY_PTHREAD_STD) #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) &attrs, --- 146,149 ---- *************** *** 220,224 **** (void* (*)(void *))func, (void *)arg - #endif ); --- 153,156 ---- *************** *** 232,240 **** return -1; - #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D7) - pthread_detach(&th); - #elif defined(PY_PTHREAD_STD) pthread_detach(th); - #endif #if SIZEOF_PTHREAD_T <= SIZEOF_LONG --- 164,168 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:53:47 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 08:56:38 2004 Subject: [Python-checkins] python/dist/src/Include fileobject.h,2.33,2.34 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/Include Modified Files: fileobject.h Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: fileobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/fileobject.h,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** fileobject.h 4 Sep 2003 19:01:45 -0000 2.33 --- fileobject.h 7 Feb 2004 13:53:45 -0000 2.34 *************** *** 21,29 **** char* f_bufptr; /* Current buffer position */ char *f_setbuf; /* Buffer for setbuf(3) and setvbuf(3) */ - #ifdef WITH_UNIVERSAL_NEWLINES int f_univ_newline; /* Handle any newline convention */ int f_newlinetypes; /* Types of newlines seen */ int f_skipnextlf; /* Skip next \n */ - #endif PyObject *f_encoding; } PyFileObject; --- 21,27 ---- *************** *** 52,56 **** PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding; - #ifdef WITH_UNIVERSAL_NEWLINES /* Routines to replace fread() and fgets() which accept any of \r, \n or \r\n as line terminators. --- 50,53 ---- *************** *** 59,68 **** char *Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); size_t Py_UniversalNewlineFread(char *, size_t, FILE *, PyObject *); ! #else ! #define PY_STDIOTEXTMODE "" ! #define Py_UniversalNewlineFgets(buf, len, fp, obj) fgets((buf), (len), (fp)) ! #define Py_UniversalNewlineFread(buf, len, fp, obj) \ ! fread((buf), 1, (len), (fp)) ! #endif /* WITH_UNIVERSAL_NEWLINES */ #ifdef __cplusplus } --- 56,60 ---- char *Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *); size_t Py_UniversalNewlineFread(char *, size_t, FILE *, PyObject *); ! #ifdef __cplusplus } From montanaro at users.sourceforge.net Sat Feb 7 08:53:47 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 08:56:39 2004 Subject: [Python-checkins] python/dist/src configure, 1.439, 1.440 configure.in, 1.450, 1.451 pyconfig.h.in, 1.93, 1.94 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111 Modified Files: configure configure.in pyconfig.h.in Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.439 retrieving revision 1.440 diff -C2 -d -r1.439 -r1.440 *** configure 7 Feb 2004 12:55:44 -0000 1.439 --- configure 7 Feb 2004 13:53:44 -0000 1.440 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.449 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.450 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 867,872 **** deprecated; use --with(out)-threads --with-pth use GNU pth threading libraries - --with(out)-universal-newlines - disable/enable foreign newlines --with(out)-doc-strings disable/enable documentation strings --with(out)-pymalloc disable/enable specialized mallocs --- 867,870 ---- *************** *** 11962,11992 **** fi - # Check for universal newline support - echo "$as_me:$LINENO: checking for --with-universal-newlines" >&5 - echo $ECHO_N "checking for --with-universal-newlines... $ECHO_C" >&6 - - # Check whether --with-universal-newlines or --without-universal-newlines was given. - if test "${with_universal_newlines+set}" = set; then - withval="$with_universal_newlines" - - fi; - - if test -z "$with_universal_newlines" - then with_universal_newlines="yes" - fi - if test "$with_universal_newlines" = "no" - then - echo --without-universal-newlines is unsupported, see README - exit 1 - else - - cat >>confdefs.h <<\_ACEOF - #define WITH_UNIVERSAL_NEWLINES 1 - _ACEOF - - fi - echo "$as_me:$LINENO: result: $with_universal_newlines" >&5 - echo "${ECHO_T}$with_universal_newlines" >&6 - # Check for --with-doc-strings echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 --- 11960,11963 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.450 retrieving revision 1.451 diff -C2 -d -r1.450 -r1.451 *** configure.in 7 Feb 2004 12:55:45 -0000 1.450 --- configure.in 7 Feb 2004 13:53:45 -0000 1.451 *************** *** 1886,1907 **** fi - # Check for universal newline support - AC_MSG_CHECKING(for --with-universal-newlines) - AC_ARG_WITH(universal-newlines, - AC_HELP_STRING(--with(out)-universal-newlines, disable/enable foreign newlines)) - - if test -z "$with_universal_newlines" - then with_universal_newlines="yes" - fi - if test "$with_universal_newlines" = "no" - then - echo --without-universal-newlines is unsupported, see README - exit 1 - else - AC_DEFINE(WITH_UNIVERSAL_NEWLINES, 1, - [Define if you want to read files with foreign newlines.]) - fi - AC_MSG_RESULT($with_universal_newlines) - # Check for --with-doc-strings AC_MSG_CHECKING(for --with-doc-strings) --- 1886,1889 ---- Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** pyconfig.h.in 7 Feb 2004 12:55:45 -0000 1.93 --- pyconfig.h.in 7 Feb 2004 13:53:45 -0000 1.94 *************** *** 793,799 **** #undef WITH_THREAD - /* Define if you want to read files with foreign newlines. */ - #undef WITH_UNIVERSAL_NEWLINES - /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ --- 793,796 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:53:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 08:56:41 2004 Subject: [Python-checkins] python/dist/src/Modules bz2module.c,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/Modules Modified Files: bz2module.c Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: bz2module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/bz2module.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** bz2module.c 1 Jul 2003 20:15:21 -0000 1.20 --- bz2module.c 7 Feb 2004 13:53:45 -0000 1.21 *************** *** 74,78 **** #endif - #ifdef WITH_UNIVERSAL_NEWLINES /* Bits in f_newlinetypes */ #define NEWLINE_UNKNOWN 0 /* No newline seen, yet */ --- 74,77 ---- *************** *** 80,84 **** #define NEWLINE_LF 2 /* \n newline seen */ #define NEWLINE_CRLF 4 /* \r\n newline seen */ - #endif /* ===================================================================== */ --- 79,82 ---- *************** *** 95,103 **** int f_softspace; /* Flag used by 'print' command */ - #ifdef WITH_UNIVERSAL_NEWLINES int f_univ_newline; /* Handle any newline convention */ int f_newlinetypes; /* Types of newlines seen */ int f_skipnextlf; /* Skip next \n */ - #endif BZFILE *fp; --- 93,99 ---- *************** *** 228,236 **** PyObject *v; int bzerror; - #ifdef WITH_UNIVERSAL_NEWLINES int newlinetypes = f->f_newlinetypes; int skipnextlf = f->f_skipnextlf; int univ_newline = f->f_univ_newline; - #endif total_v_size = n > 0 ? n : 100; --- 224,230 ---- *************** *** 244,248 **** for (;;) { Py_BEGIN_ALLOW_THREADS - #ifdef WITH_UNIVERSAL_NEWLINES if (univ_newline) { while (1) { --- 238,241 ---- *************** *** 278,282 **** newlinetypes |= NEWLINE_CR; } else /* If not universal newlines use the normal loop */ - #endif do { BZ2_bzRead(&bzerror, f->fp, &c, 1); --- 271,274 ---- *************** *** 285,292 **** } while (bzerror == BZ_OK && c != '\n' && buf != end); Py_END_ALLOW_THREADS - #ifdef WITH_UNIVERSAL_NEWLINES f->f_newlinetypes = newlinetypes; f->f_skipnextlf = skipnextlf; - #endif if (bzerror == BZ_STREAM_END) { f->size = f->pos; --- 277,282 ---- *************** *** 324,330 **** } - #ifndef WITH_UNIVERSAL_NEWLINES - #define Util_UnivNewlineRead(a,b,c,d,e) BZ2_bzRead(a,b,c,d) - #else /* This is a hacked version of Python's * fileobject.c:Py_UniversalNewlineFread(). */ --- 314,317 ---- *************** *** 394,398 **** return dst - buf; } - #endif /* This is a hacked version of Python's fileobject.c:drop_readahead(). */ --- 381,384 ---- *************** *** 1191,1195 **** /* Getters and setters of BZ2File. */ - #ifdef WITH_UNIVERSAL_NEWLINES /* This is a hacked version of Python's fileobject.c:get_newlines(). */ static PyObject * --- 1177,1180 ---- *************** *** 1221,1225 **** } } - #endif static PyObject * --- 1206,1209 ---- *************** *** 1244,1251 **** {"closed", (getter)BZ2File_get_closed, NULL, "True if the file is closed"}, - #ifdef WITH_UNIVERSAL_NEWLINES {"newlines", (getter)BZ2File_get_newlines, NULL, "end-of-line convention used in this file"}, - #endif {"mode", (getter)BZ2File_get_mode, NULL, "file mode ('r', 'w', or 'U')"}, --- 1228,1233 ---- *************** *** 1310,1316 **** case 'U': - #ifdef WITH_UNIVERSAL_NEWLINES self->f_univ_newline = 1; - #endif break; --- 1292,1296 ---- *************** *** 1442,1446 **** is given, must be a number between 1 and 9.\n\ ") - #ifdef WITH_UNIVERSAL_NEWLINES PyDoc_STR( "\n\ --- 1422,1425 ---- *************** *** 1452,1456 **** newlines are available only when reading.\n\ ") - #endif ; --- 1431,1434 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:53:49 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 08:56:43 2004 Subject: [Python-checkins] python/dist/src/RISCOS pyconfig.h,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/RISCOS Modified Files: pyconfig.h Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/pyconfig.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pyconfig.h 7 Feb 2004 12:55:46 -0000 1.11 --- pyconfig.h 7 Feb 2004 13:53:46 -0000 1.12 *************** *** 227,233 **** #undef WANT_WCTYPE_FUNCTIONS - /* Define if you want to read files with foreign newlines. */ - #define WITH_UNIVERSAL_NEWLINES 1 - /* Define if you want documentation strings in extension modules */ #define WITH_DOC_STRINGS 1 --- 227,230 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:53:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 09:30:04 2004 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/PC Modified Files: pyconfig.h Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** pyconfig.h 17 Jan 2004 14:19:44 -0000 1.24 --- pyconfig.h 7 Feb 2004 13:53:46 -0000 1.25 *************** *** 398,404 **** #define WITH_PYMALLOC 1 - /* Enable \n, \r, \r\n line ends on import; also the 'U' mode flag for open. */ - #define WITH_UNIVERSAL_NEWLINES 1 - /* Define if you have clock. */ /* #define HAVE_CLOCK */ --- 398,401 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:53:49 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 09:30:06 2004 Subject: [Python-checkins] python/dist/src/Parser pgenmain.c,2.30,2.31 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/Parser Modified Files: pgenmain.c Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: pgenmain.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/pgenmain.c,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -d -r2.30 -r2.31 *** pgenmain.c 20 Nov 2003 13:33:48 -0000 2.30 --- pgenmain.c 7 Feb 2004 13:53:46 -0000 2.31 *************** *** 146,150 **** } - #ifdef WITH_UNIVERSAL_NEWLINES /* No-nonsense fgets */ char * --- 146,149 ---- *************** *** 153,157 **** return fgets(buf, n, stream); } - #endif --- 152,155 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:53:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 12:24:46 2004 Subject: [Python-checkins] python/dist/src/Objects fileobject.c,2.186,2.187 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/Objects Modified Files: fileobject.c Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.186 retrieving revision 2.187 diff -C2 -d -r2.186 -r2.187 *** fileobject.c 19 Nov 2003 22:52:23 -0000 2.186 --- fileobject.c 7 Feb 2004 13:53:46 -0000 2.187 *************** *** 42,46 **** #endif - #ifdef WITH_UNIVERSAL_NEWLINES /* Bits in f_newlinetypes */ #define NEWLINE_UNKNOWN 0 /* No newline seen, yet */ --- 42,45 ---- *************** *** 48,52 **** #define NEWLINE_LF 2 /* \n newline seen */ #define NEWLINE_CRLF 4 /* \r\n newline seen */ - #endif FILE * --- 47,50 ---- *************** *** 120,128 **** f->f_binary = strchr(mode,'b') != NULL; f->f_buf = NULL; - #ifdef WITH_UNIVERSAL_NEWLINES f->f_univ_newline = (strchr(mode, 'U') != NULL); f->f_newlinetypes = NEWLINE_UNKNOWN; f->f_skipnextlf = 0; - #endif Py_INCREF(Py_None); f->f_encoding = Py_None; --- 118,124 ---- *************** *** 166,180 **** #endif { - #ifdef WITH_UNIVERSAL_NEWLINES if (strcmp(mode, "U") == 0 || strcmp(mode, "rU") == 0) mode = "rb"; - #else - /* Compatibility: specifying U in a Python without universal - ** newlines is allowed, and the file is opened as a normal text - ** file. - */ - if (strcmp(mode, "U") == 0 || strcmp(mode, "rU") == 0) - mode = "r"; - #endif #ifdef MS_WINDOWS if (PyUnicode_Check(f->f_name)) { --- 162,167 ---- *************** *** 495,501 **** return NULL; } - #ifdef WITH_UNIVERSAL_NEWLINES f->f_skipnextlf = 0; - #endif Py_INCREF(Py_None); return Py_None; --- 482,486 ---- *************** *** 630,634 **** return NULL; } - #ifdef WITH_UNIVERSAL_NEWLINES if (f->f_skipnextlf) { int c; --- 615,618 ---- *************** *** 639,643 **** } else if (c != EOF) ungetc(c, f->f_fp); } - #endif #if !defined(HAVE_LARGEFILE_SUPPORT) return PyInt_FromLong(pos); --- 623,626 ---- *************** *** 1071,1086 **** size_t increment; /* amount to increment the buffer */ PyObject *v; - #ifdef WITH_UNIVERSAL_NEWLINES int newlinetypes = f->f_newlinetypes; int skipnextlf = f->f_skipnextlf; int univ_newline = f->f_univ_newline; - #endif #if defined(USE_FGETS_IN_GETLINE) - #ifdef WITH_UNIVERSAL_NEWLINES if (n <= 0 && !univ_newline ) - #else - if (n <= 0) - #endif return getline_via_fgets(fp); #endif --- 1054,1063 ---- *************** *** 1095,1099 **** Py_BEGIN_ALLOW_THREADS FLOCKFILE(fp); - #ifdef WITH_UNIVERSAL_NEWLINES if (univ_newline) { c = 'x'; /* Shut up gcc warning */ --- 1072,1075 ---- *************** *** 1124,1128 **** newlinetypes |= NEWLINE_CR; } else /* If not universal newlines use the normal loop */ - #endif while ((c = GETC(fp)) != EOF && (*buf++ = c) != '\n' && --- 1100,1103 ---- *************** *** 1131,1138 **** FUNLOCKFILE(fp); Py_END_ALLOW_THREADS - #ifdef WITH_UNIVERSAL_NEWLINES f->f_newlinetypes = newlinetypes; f->f_skipnextlf = skipnextlf; - #endif if (c == '\n') break; --- 1106,1111 ---- *************** *** 1678,1682 **** return PyBool_FromLong((long)(f->f_fp == 0)); } - #ifdef WITH_UNIVERSAL_NEWLINES static PyObject * get_newlines(PyFileObject *f, void *closure) --- 1651,1654 ---- *************** *** 1707,1718 **** } } - #endif static PyGetSetDef file_getsetlist[] = { {"closed", (getter)get_closed, NULL, "True if the file is closed"}, - #ifdef WITH_UNIVERSAL_NEWLINES {"newlines", (getter)get_newlines, NULL, "end-of-line convention used in this file"}, - #endif {0}, }; --- 1679,1687 ---- *************** *** 1932,1936 **** "buffered, and larger numbers specify the buffer size.\n" ) - #ifdef WITH_UNIVERSAL_NEWLINES PyDoc_STR( "Add a 'U' to mode to open the file for input with universal newline\n" --- 1901,1904 ---- *************** *** 1942,1946 **** "'U' cannot be combined with 'w' or '+' mode.\n" ) - #endif /* WITH_UNIVERSAL_NEWLINES */ PyDoc_STR( "\n" --- 1910,1913 ---- *************** *** 2182,2186 **** } - #ifdef WITH_UNIVERSAL_NEWLINES /* From here on we need access to the real fgets and fread */ #undef fgets --- 2149,2152 ---- *************** *** 2360,2362 **** return dst - buf; } - #endif --- 2326,2327 ---- From montanaro at users.sourceforge.net Sat Feb 7 08:53:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 13:28:36 2004 Subject: [Python-checkins] python/dist/src/PC/os2emx pyconfig.h,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2emx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/PC/os2emx Modified Files: pyconfig.h Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2emx/pyconfig.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pyconfig.h 7 Feb 2004 12:55:46 -0000 1.8 --- pyconfig.h 7 Feb 2004 13:53:46 -0000 1.9 *************** *** 54,60 **** #define WITH_CYCLE_GC 1 - /* Define if you want to read files with foreign newlines. */ - #define WITH_UNIVERSAL_NEWLINES 1 - /* Define if you want documentation strings in extension modules */ #define WITH_DOC_STRINGS 1 --- 54,57 ---- From montanaro at users.sourceforge.net Sat Feb 7 15:01:13 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 15:04:04 2004 Subject: [Python-checkins] python/dist/src/Lib/plat-sunos4 IN.py, 1.2, NONE SUNAUDIODEV.py, 1.2, NONE WAIT.py, 1.1, NONE regen, 1.3, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-sunos4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28040/plat-sunos4 Removed Files: IN.py SUNAUDIODEV.py WAIT.py regen Log Message: no longer support sunos4 platform --- IN.py DELETED --- --- SUNAUDIODEV.py DELETED --- --- WAIT.py DELETED --- --- regen DELETED --- From montanaro at users.sourceforge.net Sat Feb 7 15:03:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 15:06:27 2004 Subject: [Python-checkins] python/dist/src/Lib/plat-linux1 IN.py, 1.2, NONE regen, 1.2, NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-linux1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28472 Removed Files: IN.py regen Log Message: no longer support linux1 platform --- IN.py DELETED --- --- regen DELETED --- From rhettinger at users.sourceforge.net Sat Feb 7 16:13:02 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Feb 7 16:15:55 2004 Subject: [Python-checkins] python/dist/src/Modules collectionsmodule.c, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8513/Modules Modified Files: collectionsmodule.c Log Message: * Incorporate Skip's suggestions for documentation (explain the word deque comes from and show the differences from lists). * Add a rotate() method. Index: collectionsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/collectionsmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** collectionsmodule.c 7 Feb 2004 02:45:22 -0000 1.4 --- collectionsmodule.c 7 Feb 2004 21:13:00 -0000 1.5 *************** *** 245,248 **** --- 245,286 ---- "Extend the left side of the deque with elements from the iterable"); + static PyObject * + deque_rotate(dequeobject *deque, PyObject *args) + { + int i, n; + PyObject *item, *rv; + + if (!PyArg_ParseTuple(args, "i:rotate", &n)) + return NULL; + + if (n == 0 || deque->len == 0) + Py_RETURN_NONE; + + for (i=0 ; in ; i--) { + item = deque_popleft(deque, NULL); + if (item == NULL) + return NULL; + rv = deque_append(deque, item); + Py_DECREF(item); + if (rv == NULL) + return NULL; + Py_DECREF(rv); + } + Py_RETURN_NONE; + } + + PyDoc_STRVAR(rotate_doc, + "Rotate the deque n steps to the right. If n is negative, rotates left."); + static int deque_len(dequeobject *deque) *************** *** 462,465 **** --- 500,507 ---- {"__copy__", (PyCFunction)deque_copy, METH_NOARGS, copy_doc}, + {"extend", (PyCFunction)deque_extend, + METH_O, extend_doc}, + {"extendleft", (PyCFunction)deque_extendleft, + METH_O, extendleft_doc}, {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc}, *************** *** 470,477 **** {"__reversed__", (PyCFunction)deque_reviter, METH_NOARGS, reversed_doc}, ! {"extend", (PyCFunction)deque_extend, ! METH_O, extend_doc}, ! {"extendleft", (PyCFunction)deque_extendleft, ! METH_O, extendleft_doc}, {NULL, NULL} /* sentinel */ }; --- 512,517 ---- {"__reversed__", (PyCFunction)deque_reviter, METH_NOARGS, reversed_doc}, ! {"rotate", (PyCFunction)deque_rotate, ! METH_VARARGS, rotate_doc}, {NULL, NULL} /* sentinel */ }; From rhettinger at users.sourceforge.net Sat Feb 7 16:13:02 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Feb 7 16:15:57 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_deque.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8513/Lib/test Modified Files: test_deque.py Log Message: * Incorporate Skip's suggestions for documentation (explain the word deque comes from and show the differences from lists). * Add a rotate() method. Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_deque.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_deque.py 7 Feb 2004 02:45:21 -0000 1.3 --- test_deque.py 7 Feb 2004 21:12:59 -0000 1.4 *************** *** 41,44 **** --- 41,56 ---- self.assertEqual(list(d), list(reversed('abcd'))) + def test_rotate(self): + s = 'abcde' + d = deque(s) + d.rotate(2) + self.assertEqual(''.join(d), 'deabc') + d.rotate(3) + self.assertEqual(''.join(d), s) + d.rotate(-3) + self.assertEqual(''.join(d), 'deabc') + d.rotate(-15) + self.assertEqual(''.join(d), 'deabc') + def test_len(self): d = deque('ab') From rhettinger at users.sourceforge.net Sat Feb 7 16:13:02 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Feb 7 16:15:59 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcollections.tex, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8513/Doc/lib Modified Files: libcollections.tex Log Message: * Incorporate Skip's suggestions for documentation (explain the word deque comes from and show the differences from lists). * Add a rotate() method. Index: libcollections.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcollections.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libcollections.tex 7 Feb 2004 02:45:21 -0000 1.3 --- libcollections.tex 7 Feb 2004 21:12:59 -0000 1.4 *************** *** 1,4 **** \section{\module{collections} --- ! High-performance datatypes} \declaremodule{standard}{collections} --- 1,4 ---- \section{\module{collections} --- ! High-performance container datatypes} \declaremodule{standard}{collections} *************** *** 9,13 **** ! This module implements high-performance datatypes. Currently, the only datatype is a deque. Future additions may include B-trees and Fibonacci heaps. --- 9,13 ---- ! This module implements high-performance container datatypes. Currently, the only datatype is a deque. Future additions may include B-trees and Fibonacci heaps. *************** *** 18,24 **** is not specified, the new deque is empty. ! Deques are a generalization of stacks and queues. They support ! thread-safe, memory efficient appends and pops from either side of the ! deque with approximately the same performance in either direction. \versionadded{2.4} \end{funcdesc} --- 18,30 ---- is not specified, the new deque is empty. ! Deques are a generalization of stacks and queues (the name is pronounced ! ``deck'' and is short for ``double-ended queue''). Deques support ! thread-safe, memory efficient appends and pops from either side of the deque ! with approximately the same \code{O(1)} performance in either direction. ! ! Though \class{list} objects support similar operations, they are optimized ! for fast fixed-length operations and incur \code{O(n)} memory movement costs ! for \samp{pop(0)} and \samp{insert(0, v)} operations which change both the ! size and position of the underlying data representation. \versionadded{2.4} \end{funcdesc} *************** *** 59,65 **** \end{methoddesc} ! In addition to the above, deques support iteration, membership testing ! using the \keyword{in} operator, \samp{len(d)}, \samp{copy.copy(d)}, ! \samp{copy.deepcopy(d)}, \samp{reversed(d)} and pickling. Example: --- 65,77 ---- \end{methoddesc} ! \begin{methoddesc}{rotate}{n} ! Rotate the deque \var{n} steps to the right. If \var{n} is ! negative, rotate to the left. Rotating one step to the right ! is equivalent to: \samp{d.appendleft(d.pop())}. ! \end{methoddesc} ! ! In addition to the above, deques support iteration, pickling, \samp{len(d)}, ! \samp{reversed(d)}, \samp{copy.copy(d)}, \samp{copy.deepcopy(d)}, and ! membership testing with the \keyword{in} operator. Example: *************** *** 67,72 **** \begin{verbatim} >>> from collections import deque ! >>> d = deque('ghi') # make a new deque with three items ! >>> for elem in d: # iterate over the deque's elements print elem.upper() --- 79,84 ---- \begin{verbatim} >>> from collections import deque ! >>> d = deque('ghi') # make a new deque with three items ! >>> for elem in d: # iterate over the deque's elements print elem.upper() *************** *** 75,97 **** H I ! >>> d.append('j') # add a new entry to the right side ! >>> d.appendleft('f') # add a new entry to the left side ! >>> d # show the representation of the deque deque(['f', 'g', 'h', 'i', 'j']) ! >>> d.pop() # return and remove the rightmost item 'j' ! >>> d.popleft() # return and remove the leftmost item 'f' ! >>> list(d) # list the contents of the deque ['g', 'h', 'i'] ! >>> list(reversed(d)) # list the contents of a deque in reverse ['i', 'h', 'g'] ! >>> 'h' in d # search the deque True ! >>> d.extend('jkl') # extend() will append many elements at once >>> d deque(['g', 'h', 'i', 'j', 'k', 'l']) ! >>> d.clear() # empty the deque ! >>> d.pop() # cannot pop from an empty deque Traceback (most recent call last): --- 87,117 ---- H I ! >>> d.append('j') # add a new entry to the right side ! >>> d.appendleft('f') # add a new entry to the left side ! >>> d # show the representation of the deque deque(['f', 'g', 'h', 'i', 'j']) ! >>> d.pop() # return and remove the rightmost item 'j' ! >>> d.popleft() # return and remove the leftmost item 'f' ! >>> list(d) # list the contents of the deque ['g', 'h', 'i'] ! >>> list(reversed(d)) # list the contents of a deque in reverse ['i', 'h', 'g'] ! >>> 'h' in d # search the deque True ! >>> d.extend('jkl') # add multiple elements at once >>> d deque(['g', 'h', 'i', 'j', 'k', 'l']) ! >>> d.rotate(1) # right rotation ! >>> d ! deque(['l', 'g', 'h', 'i', 'j', 'k']) ! >>> d.rotate(-1) # left rotation ! >>> d ! deque(['g', 'h', 'i', 'j', 'k', 'l']) ! >>> deque(reversed(d)) # make a new deque in reverse order ! deque(['l', 'k', 'j', 'i', 'h', 'g']) ! >>> d.clear() # empty the deque ! >>> d.pop() # cannot pop from an empty deque Traceback (most recent call last): *************** *** 100,104 **** LookupError: pop from an empty deque ! >>> d.extendleft('abc') # extendleft() reverses the element order >>> d deque(['c', 'b', 'a']) --- 120,124 ---- LookupError: pop from an empty deque ! >>> d.extendleft('abc') # extendleft() reverses the input order >>> d deque(['c', 'b', 'a']) From bwarsaw at users.sourceforge.net Sat Feb 7 17:43:06 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sat Feb 7 17:45:58 2004 Subject: [Python-checkins] python/dist/src/Lib/test regrtest.py,1.151,1.152 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26424 Modified Files: regrtest.py Log Message: Patch #868499, adds -T option for code coverage. The implementation is a fairly simpleminded adaptation of Zope3's test.py -T flag. I also changed some booleans to use True/False where appropriate. Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** regrtest.py 17 Jan 2004 14:29:28 -0000 1.151 --- regrtest.py 7 Feb 2004 22:43:03 -0000 1.152 *************** *** 20,23 **** --- 20,24 ---- -h: help -- print this text and exit -t: threshold -- call gc.set_threshold(N) + -T: coverage -- turn on code coverage using the trace module If non-option arguments are present, they are names for tests to run, *************** *** 27,30 **** --- 28,33 ---- -v is incompatible with -g and does not compare test output files. + -T turns on code coverage tracing with the trace module. + -s means to run only a single test and exit. This is useful when doing memory analysis on the Python interpreter (which tend to consume *************** *** 69,79 **** """ - import sys import os import getopt - import traceback import random - import cStringIO import warnings # I see no other way to suppress these warnings; --- 72,82 ---- """ import os + import sys import getopt import random import warnings + import cStringIO + import traceback # I see no other way to suppress these warnings; *************** *** 114,120 **** ! def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, ! exclude=0, single=0, randomize=0, fromfile=None, findleaks=0, ! use_resources=None): """Execute a test suite. --- 117,123 ---- ! def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False, ! exclude=False, single=False, randomize=False, fromfile=None, ! findleaks=False, use_resources=None, trace=False): """Execute a test suite. *************** *** 133,149 **** files beginning with test_ will be used. ! The other default arguments (verbose, quiet, generate, exclude, ! single, randomize, findleaks, and use_resources) allow programmers ! calling main() directly to set the values that would normally be ! set by flags on the command line. ! """ test_support.record_original_stdout(sys.stdout) try: ! opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', ! 'findleaks', 'use=', 'threshold=']) except getopt.error, msg: usage(2, msg) --- 136,152 ---- files beginning with test_ will be used. ! The other default arguments (verbose, quiet, generate, exclude, single, ! randomize, findleaks, use_resources, and trace) allow programmers calling ! main() directly to set the values that would normally be set by flags on ! the command line. """ test_support.record_original_stdout(sys.stdout) try: ! opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsrf:lu:t:T', ['help', 'verbose', 'quiet', 'generate', 'exclude', 'single', 'random', 'fromfile', ! 'findleaks', 'use=', 'threshold=', 'trace', ! ]) except getopt.error, msg: usage(2, msg) *************** *** 158,178 **** verbose += 1 elif o in ('-q', '--quiet'): ! quiet = 1; verbose = 0 elif o in ('-g', '--generate'): ! generate = 1 elif o in ('-x', '--exclude'): ! exclude = 1 elif o in ('-s', '--single'): ! single = 1 elif o in ('-r', '--randomize'): ! randomize = 1 elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): ! findleaks = 1 elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] --- 161,183 ---- verbose += 1 elif o in ('-q', '--quiet'): ! quiet = True; verbose = 0 elif o in ('-g', '--generate'): ! generate = True elif o in ('-x', '--exclude'): ! exclude = True elif o in ('-s', '--single'): ! single = True elif o in ('-r', '--randomize'): ! randomize = True elif o in ('-f', '--fromfile'): fromfile = a elif o in ('-l', '--findleaks'): ! findleaks = True elif o in ('-t', '--threshold'): import gc gc.set_threshold(int(a)) + elif o in ('-T', '--coverage'): + trace = True elif o in ('-u', '--use'): u = [x.lower() for x in a.split(',')] *************** *** 207,211 **** except ImportError: print 'No GC available, disabling findleaks.' ! findleaks = 0 else: # Uncomment the line below to report garbage that is not --- 212,216 ---- except ImportError: print 'No GC available, disabling findleaks.' ! findleaks = False else: # Uncomment the line below to report garbage that is not *************** *** 254,257 **** --- 259,267 ---- if randomize: random.shuffle(tests) + if trace: + import trace + tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], + trace=False, count=True) + coverdir = os.path.join(os.getcwd(), 'coverage') test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources *************** *** 261,273 **** print test sys.stdout.flush() ! ok = runtest(test, generate, verbose, quiet, testdir) ! if ok > 0: ! good.append(test) ! elif ok == 0: ! bad.append(test) else: ! skipped.append(test) ! if ok == -2: ! resource_denieds.append(test) if findleaks: gc.collect() --- 271,289 ---- print test sys.stdout.flush() ! if trace: ! # If we're tracing code coverage, then we don't exit with status ! # if on a false return value from main. ! tracer.runctx('runtest(test, generate, verbose, quiet, testdir)', ! globals=globals(), locals=vars()) else: ! ok = runtest(test, generate, verbose, quiet, testdir) ! if ok > 0: ! good.append(test) ! elif ok == 0: ! bad.append(test) ! else: ! skipped.append(test) ! if ok == -2: ! resource_denieds.append(test) if findleaks: gc.collect() *************** *** 331,334 **** --- 347,354 ---- os.unlink(filename) + if trace: + r = tracer.results() + r.write_results(show_missing=True, summary=True, coverdir=coverdir) + sys.exit(len(bad) > 0) *************** *** 363,367 **** return stdtests + tests ! def runtest(test, generate, verbose, quiet, testdir = None): """Run a single test. test -- the name of the test --- 383,387 ---- return stdtests + tests ! def runtest(test, generate, verbose, quiet, testdir=None): """Run a single test. test -- the name of the test *************** *** 373,377 **** """ test_support.unload(test) ! if not testdir: testdir = findtestdir() outputdir = os.path.join(testdir, "output") outputfile = os.path.join(outputdir, test) --- 393,398 ---- """ test_support.unload(test) ! if not testdir: ! testdir = findtestdir() outputdir = os.path.join(testdir, "output") outputfile = os.path.join(outputdir, test) From montanaro at users.sourceforge.net Sat Feb 7 08:53:48 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Feb 7 20:34:40 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.927,1.928 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25111/Misc Modified Files: NEWS Log Message: Remove support for --without-universal-newlines (see PEP 11). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.927 retrieving revision 1.928 diff -C2 -d -r1.927 -r1.928 *** NEWS 6 Feb 2004 04:15:22 -0000 1.927 --- NEWS 7 Feb 2004 13:53:45 -0000 1.928 *************** *** 331,334 **** --- 331,339 ---- ----- + - Systems requiring the D4, D6 or D7 variants of pthreads are no longer + supported (see PEP 11). + + - Universal newline support can no longer be disabled (see PEP 11). + - Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11). From rhettinger at users.sourceforge.net Sat Feb 7 23:05:28 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Feb 7 23:08:22 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_deque.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15559/Lib/test Modified Files: test_deque.py Log Message: Make deque.rotate() smarter. Beef-up related tests. Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_deque.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_deque.py 7 Feb 2004 21:12:59 -0000 1.4 --- test_deque.py 8 Feb 2004 04:05:26 -0000 1.5 *************** *** 42,55 **** def test_rotate(self): ! s = 'abcde' d = deque(s) ! d.rotate(2) ! self.assertEqual(''.join(d), 'deabc') ! d.rotate(3) ! self.assertEqual(''.join(d), s) ! d.rotate(-3) ! self.assertEqual(''.join(d), 'deabc') ! d.rotate(-15) ! self.assertEqual(''.join(d), 'deabc') def test_len(self): --- 42,89 ---- def test_rotate(self): ! s = tuple('abcde') ! n = len(s) ! d = deque(s) ! d.rotate(1) # verify rot(1) ! self.assertEqual(''.join(d), 'eabcd') ! ! d = deque(s) ! d.rotate(-1) # verify rot(-1) ! self.assertEqual(''.join(d), 'bcdea') ! d.rotate() # check default to 1 ! self.assertEqual(tuple(d), s) ! ! for i in xrange(n*3): ! d = deque(s) ! e = deque(d) ! d.rotate(i) # check vs. rot(1) n times ! for j in xrange(i): ! e.rotate(1) ! self.assertEqual(tuple(d), tuple(e)) ! d.rotate(-i) # check that it works in reverse ! self.assertEqual(tuple(d), s) ! e.rotate(n-i) # check that it wraps forward ! self.assertEqual(tuple(e), s) ! ! for i in xrange(n*3): ! d = deque(s) ! e = deque(d) ! d.rotate(-i) ! for j in xrange(i): ! e.rotate(-1) # check vs. rot(-1) n times ! self.assertEqual(tuple(d), tuple(e)) ! d.rotate(i) # check that it works in reverse ! self.assertEqual(tuple(d), s) ! e.rotate(i-n) # check that it wraps backaround ! self.assertEqual(tuple(e), s) ! ! d = deque(s) ! e = deque(s) ! e.rotate(BIG+17) # verify on long series of rotates ! dr = d.rotate ! for i in xrange(BIG+17): ! dr() ! self.assertEqual(tuple(d), tuple(e)) def test_len(self): From rhettinger at users.sourceforge.net Sat Feb 7 23:05:28 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Feb 7 23:08:23 2004 Subject: [Python-checkins] python/dist/src/Modules collectionsmodule.c, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15559/Modules Modified Files: collectionsmodule.c Log Message: Make deque.rotate() smarter. Beef-up related tests. Index: collectionsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/collectionsmodule.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** collectionsmodule.c 7 Feb 2004 21:13:00 -0000 1.5 --- collectionsmodule.c 8 Feb 2004 04:05:26 -0000 1.6 *************** *** 248,259 **** deque_rotate(dequeobject *deque, PyObject *args) { ! int i, n; PyObject *item, *rv; ! if (!PyArg_ParseTuple(args, "i:rotate", &n)) return NULL; ! if (n == 0 || deque->len == 0) Py_RETURN_NONE; for (i=0 ; ilen, halflen=(len+1)>>1; PyObject *item, *rv; ! if (!PyArg_ParseTuple(args, "|i:rotate", &n)) return NULL; ! if (len == 0) Py_RETURN_NONE; + if (n > halflen || n < -halflen) { + n %= len; + if (n > halflen) + n -= len; + else if (n < -halflen) + n += len; + } for (i=0 ; i Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18230/Misc Modified Files: NEWS Log Message: Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol 2. Failure to clear the error when attempts to get the __getstate__ attribute fail caused intermittent errors and odd behavior. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.928 retrieving revision 1.929 diff -C2 -d -r1.928 -r1.929 *** NEWS 7 Feb 2004 13:53:45 -0000 1.928 --- NEWS 8 Feb 2004 04:21:25 -0000 1.929 *************** *** 137,140 **** --- 137,144 ---- working towards the beginning. See SF feature request 801847. + - Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure + to clear the error when attempts to get the __getstate__ attribute + fail caused intermittent errors and odd behavior. + Extension modules ----------------- From dcjim at users.sourceforge.net Sat Feb 7 23:21:28 2004 From: dcjim at users.sourceforge.net (dcjim@users.sourceforge.net) Date: Sat Feb 7 23:24:23 2004 Subject: [Python-checkins] python/dist/src/Objects typeobject.c,2.255,2.256 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18230/Objects Modified Files: typeobject.c Log Message: Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol 2. Failure to clear the error when attempts to get the __getstate__ attribute fail caused intermittent errors and odd behavior. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.255 retrieving revision 2.256 diff -C2 -d -r2.255 -r2.256 *** typeobject.c 13 Dec 2003 15:21:55 -0000 2.255 --- typeobject.c 8 Feb 2004 04:21:26 -0000 2.256 *************** *** 2582,2585 **** --- 2582,2586 ---- } else { + PyErr_Clear(); state = PyObject_GetAttrString(obj, "__dict__"); if (state == NULL) { From rhettinger at users.sourceforge.net Sun Feb 8 05:49:44 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 05:52:43 2004 Subject: [Python-checkins] python/dist/src/Objects enumobject.c,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8935/Objects Modified Files: enumobject.c Log Message: Let reversed() work with itself. Index: enumobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/enumobject.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** enumobject.c 7 Feb 2004 02:45:22 -0000 1.11 --- enumobject.c 8 Feb 2004 10:49:42 -0000 1.12 *************** *** 231,234 **** --- 231,240 ---- } + static PyObject * + reversed_reverse(reversedobject *ro, PyObject *unused) + { + return PyObject_GetIter(ro->seq); + } + PyDoc_STRVAR(reversed_doc, "reverse(sequence) -> reverse iterator over values of the sequence\n" *************** *** 236,239 **** --- 242,250 ---- "Return a reverse iterator"); + static PyMethodDef reversed_methods[] = { + {"__reversed__", (PyCFunction)reversed_reverse, + METH_NOARGS, reversed_doc}, + }; + PyTypeObject PyReversed_Type = { PyObject_HEAD_INIT(&PyType_Type) *************** *** 267,271 **** PyObject_SelfIter, /* tp_iter */ (iternextfunc)reversed_next, /* tp_iternext */ ! 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ --- 278,282 ---- PyObject_SelfIter, /* tp_iter */ (iternextfunc)reversed_next, /* tp_iternext */ ! reversed_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ From rhettinger at users.sourceforge.net Sun Feb 8 05:49:44 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 05:52:45 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_enumerate.py, 1.8, 1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8935/Lib/test Modified Files: test_enumerate.py Log Message: Let reversed() work with itself. Index: test_enumerate.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_enumerate.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_enumerate.py 16 Nov 2003 16:17:48 -0000 1.8 --- test_enumerate.py 8 Feb 2004 10:49:41 -0000 1.9 *************** *** 142,145 **** --- 142,149 ---- self.assertEqual(type(reversed(x)), type(iter(x))) + def test_double_reverse(self): + s = 'hello' + self.assertEqual(list(reversed(reversed(s))), list(s)) + def test_main(verbose=None): testclasses = (EnumerateTestCase, SubclassTestCase, TestEmpty, TestBig, From rhettinger at users.sourceforge.net Sun Feb 8 05:49:44 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 05:52:47 2004 Subject: [Python-checkins] python/dist/src/Include listobject.h,2.24,2.25 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8935/Include Modified Files: listobject.h Log Message: Let reversed() work with itself. Index: listobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/listobject.h,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -d -r2.24 -r2.25 *** listobject.h 12 Aug 2002 07:21:57 -0000 2.24 --- listobject.h 8 Feb 2004 10:49:41 -0000 2.25 *************** *** 23,26 **** --- 23,27 ---- PyObject_VAR_HEAD PyObject **ob_item; + int allocated; } PyListObject; From rhettinger at users.sourceforge.net Sun Feb 8 06:08:55 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 06:11:51 2004 Subject: [Python-checkins] python/dist/src/Include listobject.h,2.25,2.26 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12541 Modified Files: listobject.h Log Message: Revert improvement to list.append() checked in before it was ready. Index: listobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/listobject.h,v retrieving revision 2.25 retrieving revision 2.26 diff -C2 -d -r2.25 -r2.26 *** listobject.h 8 Feb 2004 10:49:41 -0000 2.25 --- listobject.h 8 Feb 2004 11:08:52 -0000 2.26 *************** *** 23,27 **** PyObject_VAR_HEAD PyObject **ob_item; - int allocated; } PyListObject; --- 23,26 ---- From rhettinger at users.sourceforge.net Sun Feb 8 06:32:53 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 06:35:49 2004 Subject: [Python-checkins] python/dist/src/Lib asyncore.py,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17059 Modified Files: asyncore.py Log Message: SF bug #892492: Multiple close() for asyncore.dispatcher. (Contributed by Alexey Klimkin.) Don't keep the file descriptor after the channel is deleted. Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** asyncore.py 22 Oct 2003 14:38:27 -0000 1.43 --- asyncore.py 8 Feb 2004 11:32:50 -0000 1.44 *************** *** 223,226 **** --- 223,227 ---- #self.log_info('closing channel %d:%s' % (fd, self)) del map[fd] + self._fileno = None def create_socket(self, family, type): From pinedanv at cellularpia.co.kr Sun Feb 8 13:40:14 2004 From: pinedanv at cellularpia.co.kr (Rene Pineda) Date: Sun Feb 8 07:46:57 2004 Subject: [Python-checkins] Cheap Codeine Tylenol3 Online - USA Pharmacy Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040208/a7cc6bd9/attachment.html From rhettinger at users.sourceforge.net Sun Feb 8 13:09:34 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 13:12:36 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libtextwrap.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5914 Modified Files: libtextwrap.tex Log Message: SF bug #892854: typo in textwrap doc page (Reported by Drew Perttula.) Index: libtextwrap.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtextwrap.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libtextwrap.tex 8 May 2003 02:12:35 -0000 1.6 --- libtextwrap.tex 8 Feb 2004 18:09:32 -0000 1.7 *************** *** 48,52 **** \begin{funcdesc}{dedent}{text} ! Remove any whitespace than can be uniformly removed from the left of every line in \var{text}. --- 48,52 ---- \begin{funcdesc}{dedent}{text} ! Remove any whitespace that can be uniformly removed from the left of every line in \var{text}. From rhettinger at users.sourceforge.net Sun Feb 8 13:12:23 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 13:15:22 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libtextwrap.tex, 1.6, 1.6.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6566 Modified Files: Tag: release23-maint libtextwrap.tex Log Message: SF bug #892854: typo in textwrap doc page (Reported by Drew Perttula.) Index: libtextwrap.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtextwrap.tex,v retrieving revision 1.6 retrieving revision 1.6.10.1 diff -C2 -d -r1.6 -r1.6.10.1 *** libtextwrap.tex 8 May 2003 02:12:35 -0000 1.6 --- libtextwrap.tex 8 Feb 2004 18:12:20 -0000 1.6.10.1 *************** *** 48,52 **** \begin{funcdesc}{dedent}{text} ! Remove any whitespace than can be uniformly removed from the left of every line in \var{text}. --- 48,52 ---- \begin{funcdesc}{dedent}{text} ! Remove any whitespace that can be uniformly removed from the left of every line in \var{text}. From rhettinger at users.sourceforge.net Sun Feb 8 13:54:39 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 13:57:39 2004 Subject: [Python-checkins] python/dist/src/Misc ACKS,1.258,1.259 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15247/Misc Modified Files: ACKS Log Message: SF patch #875689: >100k alloc wasted on startup (Contributed by Mike Pall.) Make sure fill_free_list() is called only once rather than 106 times when pre-allocating small ints. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.258 retrieving revision 1.259 diff -C2 -d -r1.258 -r1.259 *** ACKS 31 Jan 2004 12:34:16 -0000 1.258 --- ACKS 8 Feb 2004 18:54:37 -0000 1.259 *************** *** 412,415 **** --- 412,416 ---- Denis S. Otkidach Russel Owen + Mike Pall Todd R. Palmer Alexandre Parenteau From rhettinger at users.sourceforge.net Sun Feb 8 13:54:40 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 13:57:41 2004 Subject: [Python-checkins] python/dist/src/Objects intobject.c,2.107,2.108 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15247/Objects Modified Files: intobject.c Log Message: SF patch #875689: >100k alloc wasted on startup (Contributed by Mike Pall.) Make sure fill_free_list() is called only once rather than 106 times when pre-allocating small ints. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.107 retrieving revision 2.108 diff -C2 -d -r2.107 -r2.108 *** intobject.c 29 Nov 2003 23:52:12 -0000 2.107 --- intobject.c 8 Feb 2004 18:54:37 -0000 2.108 *************** *** 1065,1069 **** #if NSMALLNEGINTS + NSMALLPOSINTS > 0 for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) { ! if ((free_list = fill_free_list()) == NULL) return 0; /* PyObject_New is inlined */ --- 1065,1069 ---- #if NSMALLNEGINTS + NSMALLPOSINTS > 0 for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) { ! if (!free_list && (free_list = fill_free_list()) == NULL) return 0; /* PyObject_New is inlined */ From rhettinger at users.sourceforge.net Sun Feb 8 13:56:09 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 13:59:09 2004 Subject: [Python-checkins] python/dist/src/Objects intobject.c, 2.105, 2.105.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15839 Modified Files: Tag: release23-maint intobject.c Log Message: SF patch #875689: >100k alloc wasted on startup (Contributed by Mike Pall.) Make sure fill_free_list() is called only once rather than 106 times when pre-allocating small ints. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.105 retrieving revision 2.105.8.1 diff -C2 -d -r2.105 -r2.105.8.1 *** intobject.c 28 Jun 2003 20:04:24 -0000 2.105 --- intobject.c 8 Feb 2004 18:56:07 -0000 2.105.8.1 *************** *** 1081,1085 **** #if NSMALLNEGINTS + NSMALLPOSINTS > 0 for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) { ! if ((free_list = fill_free_list()) == NULL) return 0; /* PyObject_New is inlined */ --- 1081,1085 ---- #if NSMALLNEGINTS + NSMALLPOSINTS > 0 for (ival = -NSMALLNEGINTS; ival < NSMALLPOSINTS; ival++) { ! if (!free_list && (free_list = fill_free_list()) == NULL) return 0; /* PyObject_New is inlined */ From rhettinger at users.sourceforge.net Sun Feb 8 14:24:20 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 14:27:20 2004 Subject: [Python-checkins] python/dist/src/Doc/tools prechm.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21476 Modified Files: prechm.py Log Message: SF patch #880552: Fix typo in usage message(prechm.py) (Contributed by George Yoshida.) * Also convert tabs to spaces. Index: prechm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/prechm.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** prechm.py 23 Sep 2003 20:50:47 -0000 1.16 --- prechm.py 8 Feb 2004 19:24:18 -0000 1.17 *************** *** 24,28 **** usage_mode = ''' ! Usage: make_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) --- 24,28 ---- usage_mode = ''' ! Usage: pre_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) *************** *** 94,99 **** ! !
    --- 94,99 ---- ! !
      From rhettinger at users.sourceforge.net Sun Feb 8 14:26:15 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 14:29:16 2004 Subject: [Python-checkins] python/dist/src/Doc/tools prechm.py, 1.15.18.2, 1.15.18.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21871 Modified Files: Tag: release23-maint prechm.py Log Message: SF patch #880552: Fix typo in usage message(prechm.py) (Contributed by George Yoshida.) Index: prechm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/prechm.py,v retrieving revision 1.15.18.2 retrieving revision 1.15.18.3 diff -C2 -d -r1.15.18.2 -r1.15.18.3 *** prechm.py 23 Sep 2003 20:34:40 -0000 1.15.18.2 --- prechm.py 8 Feb 2004 19:26:13 -0000 1.15.18.3 *************** *** 24,28 **** usage_mode = ''' ! Usage: make_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) --- 24,28 ---- usage_mode = ''' ! Usage: pre_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) *************** *** 94,99 **** ! !
        --- 94,99 ---- ! !
          From tim.one at comcast.net Sun Feb 8 14:37:43 2004 From: tim.one at comcast.net (Tim Peters) Date: Sun Feb 8 14:37:38 2004 Subject: [Python-checkins] python/dist/src/Doc/tools prechm.py, 1.15.18.2, 1.15.18.3 In-Reply-To: Message-ID: > Modified Files: > Tag: release23-maint > prechm.py > Log Message: > SF patch #880552: Fix typo in usage message(prechm.py) > (Contributed by George Yoshida.) ... > > Index: prechm.py > =================================================================== > RCS file: /cvsroot/python/python/dist/src/Doc/tools/prechm.py,v > retrieving revision 1.15.18.2 > retrieving revision 1.15.18.3 > diff -C2 -d -r1.15.18.2 -r1.15.18.3 > *** prechm.py 23 Sep 2003 20:34:40 -0000 1.15.18.2 > --- prechm.py 8 Feb 2004 19:26:13 -0000 1.15.18.3 > *************** > *** 24,28 **** > > usage_mode = ''' > ! Usage: make_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename > -c: does not build filename.hhc (Table of Contents) > -k: does not build filename.hhk (Index) > --- 24,28 ---- > > usage_mode = ''' > ! Usage: pre_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename > -c: does not build filename.hhc (Table of Contents) > -k: does not build filename.hhk (Index) > *************** If the name of the file is prechm.py, then saying pre_chm.py in the usage message appears just as wrong as saying make_chm.py . From rhettinger at users.sourceforge.net Sun Feb 8 14:59:30 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 15:02:31 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.374,2.375 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29206 Modified Files: ceval.c Log Message: SF patch #884022: dynamic execution profiling vs opcode prediction (Contributed by Andrew I MacIntyre.) disables opcode prediction when dynamic execution profiling is in effect, so the profiling counters at the top of the main interpreter loop in eval_frame() are updated for each opcode. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.374 retrieving revision 2.375 diff -C2 -d -r2.374 -r2.375 *** ceval.c 6 Feb 2004 18:32:33 -0000 2.374 --- ceval.c 8 Feb 2004 19:59:27 -0000 2.375 *************** *** 646,652 **** --- 646,661 ---- A successful prediction saves a trip through the eval-loop including its two unpredictable branches, the HASARG test and the switch-case. + + If collecting opcode statistics, turn off prediction so that + statistics are accurately maintained (the predictions bypass + the opcode frequency counter updates). */ + #ifdef DYNAMIC_EXECUTION_PROFILE + #define PREDICT(op) if (0) goto PRED_##op + #else #define PREDICT(op) if (*next_instr == op) goto PRED_##op + #endif + #define PREDICTED(op) PRED_##op: next_instr++ #define PREDICTED_WITH_ARG(op) PRED_##op: oparg = (next_instr[2]<<8) + \ From rhettinger at users.sourceforge.net Sun Feb 8 15:05:43 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 15:08:43 2004 Subject: [Python-checkins] python/dist/src/Doc/tools prechm.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30572 Modified Files: prechm.py Log Message: Fix typo Index: prechm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/prechm.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** prechm.py 8 Feb 2004 19:24:18 -0000 1.17 --- prechm.py 8 Feb 2004 20:05:40 -0000 1.18 *************** *** 24,28 **** usage_mode = ''' ! Usage: pre_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) --- 24,28 ---- usage_mode = ''' ! Usage: prechm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) From rhettinger at users.sourceforge.net Sun Feb 8 15:06:44 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 15:09:44 2004 Subject: [Python-checkins] python/dist/src/Doc/tools prechm.py, 1.15.18.3, 1.15.18.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30751 Modified Files: Tag: release23-maint prechm.py Log Message: Fix typo Index: prechm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/prechm.py,v retrieving revision 1.15.18.3 retrieving revision 1.15.18.4 diff -C2 -d -r1.15.18.3 -r1.15.18.4 *** prechm.py 8 Feb 2004 19:26:13 -0000 1.15.18.3 --- prechm.py 8 Feb 2004 20:06:42 -0000 1.15.18.4 *************** *** 24,28 **** usage_mode = ''' ! Usage: pre_chm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) --- 24,28 ---- usage_mode = ''' ! Usage: prechm.py [-c] [-k] [-p] [-v 1.5[.x]] filename -c: does not build filename.hhc (Table of Contents) -k: does not build filename.hhk (Index) From rhettinger at users.sourceforge.net Sun Feb 8 15:18:29 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 15:21:30 2004 Subject: [Python-checkins] python/dist/src/Doc/ref ref2.tex,1.50,1.51 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv718 Modified Files: ref2.tex Log Message: Fix misspelled name. Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** ref2.tex 29 Nov 2003 23:52:12 -0000 1.50 --- ref2.tex 8 Feb 2004 20:18:26 -0000 1.51 *************** *** 91,95 **** \end{verbatim} ! which is recognized by Bram Moolenar's VIM. In addition, if the first bytes of the file are the UTF-8 byte-order mark (\code{'\e xef\e xbb\e xbf'}), the declared file encoding is UTF-8 --- 91,95 ---- \end{verbatim} ! which is recognized by Bram Moolenaar's VIM. In addition, if the first bytes of the file are the UTF-8 byte-order mark (\code{'\e xef\e xbb\e xbf'}), the declared file encoding is UTF-8 From rhettinger at users.sourceforge.net Sun Feb 8 15:19:44 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 15:22:43 2004 Subject: [Python-checkins] python/dist/src/Doc/ref ref2.tex, 1.48.10.1, 1.48.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv964 Modified Files: Tag: release23-maint ref2.tex Log Message: Fix misspelled name. Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.48.10.1 retrieving revision 1.48.10.2 diff -C2 -d -r1.48.10.1 -r1.48.10.2 *** ref2.tex 6 Sep 2003 03:48:16 -0000 1.48.10.1 --- ref2.tex 8 Feb 2004 20:19:42 -0000 1.48.10.2 *************** *** 91,95 **** \end{verbatim} ! which is recognized by Bram Moolenar's VIM. In addition, if the first bytes of the file are the UTF-8 byte-order mark (\code{'\e xef\e xbb\e xbf'}), the declared file encoding is UTF-8 --- 91,95 ---- \end{verbatim} ! which is recognized by Bram Moolenaar's VIM. In addition, if the first bytes of the file are the UTF-8 byte-order mark (\code{'\e xef\e xbb\e xbf'}), the declared file encoding is UTF-8 From rhettinger at users.sourceforge.net Sun Feb 8 15:25:04 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 15:28:04 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liburllib2.tex,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2074 Modified Files: liburllib2.tex Log Message: SF patch #892821: example for urllib2 has SyntaxError (Contributed by George Yoshida.) Index: liburllib2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib2.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** liburllib2.tex 14 Dec 2003 05:27:34 -0000 1.14 --- liburllib2.tex 8 Feb 2004 20:25:01 -0000 1.15 *************** *** 682,686 **** import sys data = sys.stdin.read() ! print 'Content-type: text-plain\n\nGot Data: "%s"' % ! data \end{verbatim} --- 682,685 ---- import sys data = sys.stdin.read() ! print 'Content-type: text-plain\n\nGot Data: "%s"' % data \end{verbatim} From rhettinger at users.sourceforge.net Sun Feb 8 15:26:20 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Feb 8 15:29:20 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liburllib2.tex, 1.13, 1.13.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2386 Modified Files: Tag: release23-maint liburllib2.tex Log Message: SF patch #892821: example for urllib2 has SyntaxError (Contributed by George Yoshida.) Index: liburllib2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib2.tex,v retrieving revision 1.13 retrieving revision 1.13.8.1 diff -C2 -d -r1.13 -r1.13.8.1 *** liburllib2.tex 14 Jul 2003 21:07:05 -0000 1.13 --- liburllib2.tex 8 Feb 2004 20:26:17 -0000 1.13.8.1 *************** *** 652,656 **** import sys data = sys.stdin.read() ! print 'Content-type: text-plain\n\nGot Data: "%s"' % ! data \end{verbatim} --- 652,655 ---- import sys data = sys.stdin.read() ! print 'Content-type: text-plain\n\nGot Data: "%s"' % data \end{verbatim} From dcjim at users.sourceforge.net Sun Feb 8 21:57:21 2004 From: dcjim at users.sourceforge.net (dcjim@users.sourceforge.net) Date: Sun Feb 8 22:00:25 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.831.4.88,1.831.4.89 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17068/Misc Modified Files: Tag: release23-maint NEWS Log Message: Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol 2. Failure to clear the error when attempts to get the __getstate__ attribute fail caused intermittent errors and odd behavior. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.831.4.88 retrieving revision 1.831.4.89 diff -C2 -d -r1.831.4.88 -r1.831.4.89 *** NEWS 6 Feb 2004 04:14:41 -0000 1.831.4.88 --- NEWS 9 Feb 2004 02:57:14 -0000 1.831.4.89 *************** *** 28,31 **** --- 28,35 ---- a release build. + - Fixed a bug in object.__reduce_ex__ when using protocol 2. Failure + to clear the error when attempts to get the __getstate__ attribute + fail caused intermittent errors and odd behavior. + What's New in Python 2.3.3 (final)? =================================== From dcjim at users.sourceforge.net Sun Feb 8 21:57:23 2004 From: dcjim at users.sourceforge.net (dcjim@users.sourceforge.net) Date: Sun Feb 8 22:00:28 2004 Subject: [Python-checkins] python/dist/src/Objects typeobject.c, 2.241.6.6, 2.241.6.7 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17068/Objects Modified Files: Tag: release23-maint typeobject.c Log Message: Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol 2. Failure to clear the error when attempts to get the __getstate__ attribute fail caused intermittent errors and odd behavior. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.241.6.6 retrieving revision 2.241.6.7 diff -C2 -d -r2.241.6.6 -r2.241.6.7 *** typeobject.c 13 Nov 2003 22:48:42 -0000 2.241.6.6 --- typeobject.c 9 Feb 2004 02:57:18 -0000 2.241.6.7 *************** *** 2568,2571 **** --- 2568,2572 ---- } else { + PyErr_Clear(); state = PyObject_GetAttrString(obj, "__dict__"); if (state == NULL) { From theller at users.sourceforge.net Mon Feb 9 05:44:03 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Mon Feb 9 05:47:09 2004 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex, 1.25.10.4, 1.25.10.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3337 Modified Files: Tag: release23-maint concrete.tex Log Message: Documentation for PyDescr_NewClassMethod was missing - here's at least the function prototype. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.25.10.4 retrieving revision 1.25.10.5 diff -C2 -d -r1.25.10.4 -r1.25.10.5 *** concrete.tex 1 Jan 2004 05:46:29 -0000 1.25.10.4 --- concrete.tex 9 Feb 2004 10:44:00 -0000 1.25.10.5 *************** *** 2325,2328 **** --- 2325,2333 ---- \end{cfuncdesc} + \begin{cfuncdesc}{PyObject*}{PyDescr_NewClassMethod}{PyTypeObject *type, + PyMethodDef *method} + \versionadded{2.3} + \end{cfuncdesc} + \begin{cfuncdesc}{int}{PyDescr_IsData}{PyObject *descr} Returns true if the descriptor objects \var{descr} describes a data From theller at users.sourceforge.net Mon Feb 9 05:47:22 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Mon Feb 9 05:50:29 2004 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.37,1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3988 Modified Files: concrete.tex Log Message: Documentation for PyDescr_NewClassMethod was missing - here's at least the function prototype. Already backported to release23-maint. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** concrete.tex 1 Jan 2004 05:43:53 -0000 1.37 --- concrete.tex 9 Feb 2004 10:47:11 -0000 1.38 *************** *** 2363,2366 **** --- 2363,2371 ---- \end{cfuncdesc} + \begin{cfuncdesc}{PyObject*}{PyDescr_NewClassMethod}{PyTypeObject *type, + PyMethodDef *method} + \versionadded{2.3} + \end{cfuncdesc} + \begin{cfuncdesc}{int}{PyDescr_IsData}{PyObject *descr} Returns true if the descriptor objects \var{descr} describes a data From akuchling at users.sourceforge.net Mon Feb 9 08:23:38 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Mon Feb 9 08:26:47 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.29, 1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32441 Modified Files: whatsnew24.tex Log Message: Minor edits Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** whatsnew24.tex 29 Jan 2004 06:37:48 -0000 1.29 --- whatsnew24.tex 9 Feb 2004 13:23:34 -0000 1.30 *************** *** 323,330 **** \end{itemize} ! \item There is a new \module{collections} module which currently offers ! just one new datatype, \class{deque}, which offers high-performance, ! thread-safe, memory friendly appends and pops on either side of the ! deque resulting in efficient stacks and queues: \begin{verbatim} --- 323,331 ---- \end{itemize} ! \item There is a new \module{collections} module for ! various specialized collection datatypes. ! Currently it contains just one type, \class{deque}, ! a double-ended queue that supports efficiently adding and removing ! elements from either end. \begin{verbatim} *************** *** 345,354 **** \end{verbatim} ! Several modules now take advantage of \class{collections.deque()} for improved performance: \module{Queue}, \module{mutex}, \module{shlex} \module{threading}, and \module{pydoc}. \item The \module{heapq} module has been converted to C. The resulting ! ten-fold improvement in speed makes the module suitable for handling high volumes of data. --- 346,355 ---- \end{verbatim} ! Several modules now take advantage of \class{collections.deque} for improved performance: \module{Queue}, \module{mutex}, \module{shlex} \module{threading}, and \module{pydoc}. \item The \module{heapq} module has been converted to C. The resulting ! tenfold improvement in speed makes the module suitable for handling high volumes of data. From fdrake at users.sourceforge.net Mon Feb 9 15:58:12 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Feb 9 16:01:23 2004 Subject: [Python-checkins] python/dist/src/Doc/texinputs python.sty, 1.106, 1.107 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11178 Modified Files: python.sty Log Message: support \e in \file and \filenq; this is useful for Windows paths Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** python.sty 23 Jan 2004 08:52:28 -0000 1.106 --- python.sty 9 Feb 2004 20:58:08 -0000 1.107 *************** *** 850,854 **** % let's experiment with a new font: \newcommand{\file}[1]{`\filenq{#1}'} ! \newcommand{\filenq}[1]{{\py@smallsize\textsf{#1}}} % Use this def/redef approach for \url{} since hyperref defined this already, --- 850,854 ---- % let's experiment with a new font: \newcommand{\file}[1]{`\filenq{#1}'} ! \newcommand{\filenq}[1]{{\py@smallsize\textsf{\let\e=\textbackslash#1}}} % Use this def/redef approach for \url{} since hyperref defined this already, From fdrake at users.sourceforge.net Mon Feb 9 16:00:37 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Mon Feb 9 16:03:49 2004 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex,1.81,1.82 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11849 Modified Files: doc.tex Log Message: the \file macro is no longer a good example of where \e can't be used Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** doc.tex 23 Jan 2004 08:51:28 -0000 1.81 --- doc.tex 9 Feb 2004 21:00:29 -0000 1.82 *************** *** 790,797 **** \begin{macrodesc}{e}{} ! Produces a backslash. This is convenient in \macro{code} and ! similar macros, and is only defined there. To create a ! backslash in ordinary text (such as the contents of the ! \macro{file} macro), use the standard \macro{textbackslash} macro. \end{macrodesc} --- 790,798 ---- \begin{macrodesc}{e}{} ! Produces a backslash. This is convenient in \macro{code}, ! \macro{file}, and similar macros, and is only defined there. To ! create a backslash in ordinary text (such as the contents of the ! \macro{citetitle} macro), use the standard \macro{textbackslash} ! macro. \end{macrodesc} From nnorwitz at users.sourceforge.net Mon Feb 9 17:23:27 2004 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Mon Feb 9 17:26:41 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.69, 1.1.2.70 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1455/Python Modified Files: Tag: ast-branch newcompile.c Log Message: get augassign working Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.69 retrieving revision 1.1.2.70 diff -C2 -d -r1.1.2.69 -r1.1.2.70 *** newcompile.c 27 Jan 2004 23:21:38 -0000 1.1.2.69 --- newcompile.c 9 Feb 2004 22:23:25 -0000 1.1.2.70 *************** *** 25,30 **** Inappropriate Exceptions: #: problem with cell objects (closures still have bugs) - #: x = [1] ; x[0] += 1 - raises TypeError: object does not support item assignment #: Get this err msg: XXX rd_object called with exception set From Python/marshal.c::PyMarshal_ReadLastObjectFromFile() --- 25,28 ---- *************** *** 2081,2084 **** --- 2079,2084 ---- auge = Attribute(e->v.Attribute.value, e->v.Attribute.attr, AugLoad); + if (auge == NULL) + return 0; VISIT(c, expr, auge); VISIT(c, expr, s->v.AugAssign.value); *************** *** 2091,2098 **** auge = Subscript(e->v.Subscript.value, e->v.Subscript.slice, AugLoad); VISIT(c, expr, auge); VISIT(c, expr, s->v.AugAssign.value); ADDOP(c, inplace_binop(c, s->v.AugAssign.op)); ! auge->v.Subscript.ctx = AugStore; VISIT(c, expr, auge); free(auge); --- 2091,2100 ---- auge = Subscript(e->v.Subscript.value, e->v.Subscript.slice, AugLoad); + if (auge == NULL) + return 0; VISIT(c, expr, auge); VISIT(c, expr, s->v.AugAssign.value); ADDOP(c, inplace_binop(c, s->v.AugAssign.op)); ! auge->v.Subscript.ctx = AugStore; VISIT(c, expr, auge); free(auge); *************** *** 2232,2235 **** --- 2234,2238 ---- case 0: ADDOP(c, DUP_TOP); break; case 1: ADDOP_I(c, DUP_TOPX, 2); break; + case 2: ADDOP_I(c, DUP_TOPX, 3); break; } } *************** *** 2238,2241 **** --- 2241,2245 ---- case 0: ADDOP(c, ROT_TWO); break; case 1: ADDOP(c, ROT_THREE); break; + case 2: ADDOP(c, ROT_FOUR); break; } } *************** *** 2270,2274 **** break; case Index_kind: ! VISIT(c, expr, s->v.Index.value); return compiler_handle_subscr(c, "index", ctx); } --- 2274,2279 ---- break; case Index_kind: ! if (ctx != AugStore) ! VISIT(c, expr, s->v.Index.value); return compiler_handle_subscr(c, "index", ctx); } From bcannon at users.sourceforge.net Mon Feb 9 20:18:33 2004 From: bcannon at users.sourceforge.net (bcannon@users.sourceforge.net) Date: Mon Feb 9 20:21:46 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcolorsys.tex, 1.1, 1.1.48.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11853/Doc/lib Modified Files: Tag: release23-maint libcolorsys.tex Log Message: Update "more info" link to http://www.poynton.com/ColorFAQ.html . Index: libcolorsys.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcolorsys.tex,v retrieving revision 1.1 retrieving revision 1.1.48.1 diff -C2 -d -r1.1 -r1.1.48.1 *** libcolorsys.tex 19 Apr 1999 21:20:13 -0000 1.1 --- libcolorsys.tex 10 Feb 2004 01:18:30 -0000 1.1.48.1 *************** *** 16,20 **** More information about color spaces can be found at ! \url{http://www.inforamp.net/\%7epoynton/ColorFAQ.html}. The \module{colorsys} module defines the following functions: --- 16,20 ---- More information about color spaces can be found at ! \url{http://www.poynton.com/ColorFAQ.html}. The \module{colorsys} module defines the following functions: From rhettinger at users.sourceforge.net Tue Feb 10 04:25:43 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Feb 10 04:28:59 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.28, 1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29235/Lib/test Modified Files: test_itertools.py Log Message: Give itertools.repeat() a length method. Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** test_itertools.py 20 Jan 2004 20:04:31 -0000 1.28 --- test_itertools.py 10 Feb 2004 09:25:40 -0000 1.29 *************** *** 608,611 **** --- 608,617 ---- self.assertRaises(ZeroDivisionError, list, tee(E(s))[0]) + class LengthTransparency(unittest.TestCase): + + def test_repeat(self): + self.assertEqual(len(repeat(None, 50)), 50) + self.assertRaises(TypeError, len, repeat(None)) + class RegressionTests(unittest.TestCase): *************** *** 827,831 **** def test_main(verbose=None): test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC, ! RegressionTests) test_support.run_unittest(*test_classes) --- 833,837 ---- def test_main(verbose=None): test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC, ! RegressionTests, LengthTransparency) test_support.run_unittest(*test_classes) From rhettinger at users.sourceforge.net Tue Feb 10 04:25:43 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Feb 10 04:29:02 2004 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29235/Modules Modified Files: itertoolsmodule.c Log Message: Give itertools.repeat() a length method. Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** itertoolsmodule.c 6 Dec 2003 16:23:06 -0000 1.27 --- itertoolsmodule.c 10 Feb 2004 09:25:40 -0000 1.28 *************** *** 2348,2351 **** --- 2348,2364 ---- } + static int + repeat_len(repeatobject *ro) + { + if (ro->cnt == -1) + PyErr_SetString(PyExc_TypeError, "len() of unsized object"); + return (int)(ro->cnt); + } + + static PySequenceMethods repeat_as_sequence = { + (inquiry)repeat_len, /* sq_length */ + 0, /* sq_concat */ + }; + PyDoc_STRVAR(repeat_doc, "repeat(element [,times]) -> create an iterator which returns the element\n\ *************** *** 2367,2371 **** 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ --- 2380,2384 ---- 0, /* tp_repr */ 0, /* tp_as_number */ ! &repeat_as_sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ From rhettinger at users.sourceforge.net Tue Feb 10 04:33:41 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Feb 10 04:36:56 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_enumerate.py, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31188/Lib/test Modified Files: test_enumerate.py Log Message: Make reversed() transparent with respect to length. Index: test_enumerate.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_enumerate.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_enumerate.py 8 Feb 2004 10:49:41 -0000 1.9 --- test_enumerate.py 10 Feb 2004 09:33:39 -0000 1.10 *************** *** 146,149 **** --- 146,153 ---- self.assertEqual(list(reversed(reversed(s))), list(s)) + def test_len(self): + s = 'hello' + self.assertEqual(len(reversed(s)), len(s)) + def test_main(verbose=None): testclasses = (EnumerateTestCase, SubclassTestCase, TestEmpty, TestBig, From rhettinger at users.sourceforge.net Tue Feb 10 04:33:41 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Feb 10 04:36:58 2004 Subject: [Python-checkins] python/dist/src/Objects enumobject.c,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31188/Objects Modified Files: enumobject.c Log Message: Make reversed() transparent with respect to length. Index: enumobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/enumobject.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** enumobject.c 8 Feb 2004 10:49:42 -0000 1.12 --- enumobject.c 10 Feb 2004 09:33:39 -0000 1.13 *************** *** 231,234 **** --- 231,240 ---- } + static int + reversed_len(reversedobject *ro) + { + return PyObject_Size(ro->seq); + } + static PyObject * reversed_reverse(reversedobject *ro, PyObject *unused) *************** *** 245,248 **** --- 251,260 ---- {"__reversed__", (PyCFunction)reversed_reverse, METH_NOARGS, reversed_doc}, + {NULL, NULL} /* sentinel */ + }; + + static PySequenceMethods reversed_as_sequence = { + (inquiry)reversed_len, /* sq_length */ + 0, /* sq_concat */ }; *************** *** 261,265 **** 0, /* tp_repr */ 0, /* tp_as_number */ ! 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ --- 273,277 ---- 0, /* tp_repr */ 0, /* tp_as_number */ ! &reversed_as_sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ From montanaro at users.sourceforge.net Tue Feb 10 10:51:18 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 10:54:37 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_socket.py, 1.66, 1.67 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13305 Modified Files: test_socket.py Log Message: Fix indentation error in testGetServByName and rewrite loop to avoid clumsy sentinel variable Index: test_socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socket.py,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** test_socket.py 29 Jun 2003 04:40:22 -0000 1.66 --- test_socket.py 10 Feb 2004 15:51:15 -0000 1.67 *************** *** 274,282 **** # Testing getservbyname() # try a few protocols - not everyone has telnet enabled - found = 0 for proto in ("telnet", "ssh", "www", "ftp"): try: socket.getservbyname(proto, 'tcp') - found = 1 break except socket.error: --- 274,280 ---- *************** *** 284,293 **** try: socket.getservbyname(proto, 'udp') - found = 1 break except socket.error: pass ! if not found: ! raise socket.error def testDefaultTimeout(self): --- 282,290 ---- try: socket.getservbyname(proto, 'udp') break except socket.error: pass ! else: ! raise socket.error def testDefaultTimeout(self): From montanaro at users.sourceforge.net Tue Feb 10 11:50:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:01:00 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c, 2.375, 2.376 pythonrun.c, 2.202, 2.203 thread.c, 2.49, 2.50 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/Python Modified Files: ceval.c pythonrun.c thread.c Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.375 retrieving revision 2.376 diff -C2 -d -r2.375 -r2.376 *** ceval.c 8 Feb 2004 19:59:27 -0000 2.375 --- ceval.c 10 Feb 2004 16:50:20 -0000 2.376 *************** *** 807,821 **** } } - #if !defined(HAVE_SIGNAL_H) - /* If we have true signals, the signal handler - will call Py_AddPendingCall() so we don't - have to call PyErr_CheckSignals(). On the - Mac and DOS, alas, we have to call it. */ - if (PyErr_CheckSignals()) { - why = WHY_EXCEPTION; - goto on_error; - } - #endif - #ifdef WITH_THREAD if (interpreter_lock) { --- 807,810 ---- Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.202 retrieving revision 2.203 diff -C2 -d -r2.202 -r2.203 *** pythonrun.c 1 Dec 2003 21:35:27 -0000 2.202 --- pythonrun.c 10 Feb 2004 16:50:20 -0000 2.203 *************** *** 14,20 **** #include "marshal.h" - #ifdef HAVE_SIGNAL_H #include - #endif #ifdef HAVE_LANGINFO_H --- 14,18 ---- *************** *** 1564,1568 **** initsigs(void) { - #ifdef HAVE_SIGNAL_H #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); --- 1562,1565 ---- *************** *** 1574,1578 **** signal(SIGXFSZ, SIG_IGN); #endif - #endif /* HAVE_SIGNAL_H */ PyOS_InitInterrupts(); /* May imply initsignal() */ } --- 1571,1574 ---- Index: thread.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread.c,v retrieving revision 2.49 retrieving revision 2.50 diff -C2 -d -r2.49 -r2.50 *** thread.c 17 Jan 2004 00:29:32 -0000 2.49 --- thread.c 10 Feb 2004 16:50:20 -0000 2.50 *************** *** 12,22 **** #endif - #ifdef HAVE_STDLIB_H #include - #else - #ifdef Py_DEBUG - extern char *getenv(const char *); - #endif - #endif #ifdef __sgi --- 12,16 ---- From montanaro at users.sourceforge.net Tue Feb 10 11:50:23 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:07:23 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.929,1.930 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/Misc Modified Files: NEWS Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.929 retrieving revision 1.930 diff -C2 -d -r1.929 -r1.930 *** NEWS 8 Feb 2004 04:21:25 -0000 1.929 --- NEWS 10 Feb 2004 16:50:21 -0000 1.930 *************** *** 335,338 **** --- 335,341 ---- ----- + - Support for missing ANSI C header files (limits.h, stddef.h, etc) was + removed. + - Systems requiring the D4, D6 or D7 variants of pthreads are no longer supported (see PEP 11). From montanaro at users.sourceforge.net Tue Feb 10 11:50:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:12:36 2004 Subject: [Python-checkins] python/dist/src/PC/os2vacpp pyconfig.h,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2vacpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/PC/os2vacpp Modified Files: pyconfig.h Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2vacpp/pyconfig.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pyconfig.h 7 Feb 2004 12:55:46 -0000 1.5 --- pyconfig.h 10 Feb 2004 16:50:20 -0000 1.6 *************** *** 110,136 **** #define STDC_HEADERS 1 /* VAC++ is an ANSI C Compiler */ - #define HAVE_LIMITS_H 1 /* #include */ - #define HAVE_STDLIB_H 1 /* #include */ #define HAVE_HYPOT 1 /* hypot() */ #define HAVE_PUTENV 1 /* putenv() */ - #define HAVE_STDDEF_H 1 /* #include */ /* #define VA_LIST_IS_ARRAY 1 */ /* if va_list is an array of some kind */ /* Variable-Arguments/Prototypes */ #define HAVE_PROTOTYPES 1 /* VAC++ supports C Function Prototypes */ - #define HAVE_STDARG_H 1 /* #include */ #define HAVE_STDARG_PROTOTYPES 1 /* Our has prototypes */ /* String/Memory/Locale Operations */ - #define HAVE_STRDUP 1 /* strdup() */ #define HAVE_MEMMOVE 1 /* memmove() */ #define HAVE_STRERROR 1 /* strerror() */ #define HAVE_SETLOCALE 1 /* setlocale() */ - #define HAVE_LOCALE_H 1 /* #include */ #define MALLOC_ZERO_RETURNS_NULL 1 /* Our malloc(0) returns a NULL ptr */ /* Signal Handling */ #define RETSIGTYPE void /* Return type of handlers (int or void) */ - #define HAVE_SIGNAL_H 1 /* #include */ /* #undef WANT_SIGFPE_HANDLER */ /* Handle SIGFPE (see Include/pyfpe.h) */ /* #define HAVE_ALARM 1 */ /* alarm() */ --- 110,129 ---- From montanaro at users.sourceforge.net Tue Feb 10 11:50:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:33:45 2004 Subject: [Python-checkins] python/dist/src/RISCOS pyconfig.h,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/RISCOS Modified Files: pyconfig.h Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/pyconfig.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pyconfig.h 7 Feb 2004 13:53:46 -0000 1.12 --- pyconfig.h 10 Feb 2004 16:50:21 -0000 1.13 *************** *** 1,4 **** --- 1,7 ---- /* RISCOS/pyconfig.h: Python configuration for RISC OS */ + #ifndef Py_PYCONFIG_H + #define Py_PYCONFIG_H + /* Define if on AIX 3. System headers sometimes define this. *************** *** 578,587 **** #undef HAVE_LIBUTIL_H - /* Define if you have the header file. */ - #define HAVE_LIMITS_H 1 - - /* Define if you have the header file. */ - #define HAVE_LOCALE_H 1 - /* Define if you have the header file. */ #undef HAVE_NCURSES_H --- 581,584 ---- *************** *** 605,620 **** #undef HAVE_PTY_H - /* Define if you have the header file. */ - #define HAVE_SIGNAL_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDARG_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDDEF_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDLIB_H 1 - /* Define if you have the header file. */ #undef HAVE_SYS_AUDIOIO_H --- 602,605 ---- *************** *** 707,708 **** --- 692,695 ---- #define PLATFORM "riscos" + + #endif /* Py_PYCONFIG_H */ From montanaro at users.sourceforge.net Tue Feb 10 11:50:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:33:49 2004 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/PC Modified Files: pyconfig.h Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pyconfig.h 7 Feb 2004 13:53:46 -0000 1.25 --- pyconfig.h 10 Feb 2004 16:50:19 -0000 1.26 *************** *** 29,33 **** #include - #define HAVE_LIMITS_H #define HAVE_SYS_UTIME_H #define HAVE_HYPOT --- 29,32 ---- *************** *** 479,497 **** #define HAVE_FCNTL_H 1 - /* Define if you have the header file. */ - #define HAVE_SIGNAL_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDARG_H 1 - /* Define if you have the prototypes. */ #define HAVE_STDARG_PROTOTYPES - /* Define if you have the header file. */ - #define HAVE_STDDEF_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDLIB_H 1 - /* Define if you have the header file. */ /* #undef HAVE_SYS_AUDIOIO_H */ --- 478,484 ---- From montanaro at users.sourceforge.net Tue Feb 10 11:50:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:41:41 2004 Subject: [Python-checkins] python/dist/src/PC/os2emx pyconfig.h,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2emx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/PC/os2emx Modified Files: pyconfig.h Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2emx/pyconfig.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pyconfig.h 7 Feb 2004 13:53:46 -0000 1.9 --- pyconfig.h 10 Feb 2004 16:50:20 -0000 1.10 *************** *** 228,234 **** #define HAVE_SIGACTION 1 - /* Define if you have the strdup function. */ - #define HAVE_STRDUP 1 - /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 --- 228,231 ---- *************** *** 264,288 **** #define HAVE_FCNTL_H 1 - /* Define if you have the header file. */ - #define HAVE_LIMITS_H 1 - - /* Define if you have the header file. */ - #define HAVE_LOCALE_H 1 - /* Define if you have the header file. */ #define HAVE_NCURSES_H 1 - /* Define if you have the header file. */ - #define HAVE_SIGNAL_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDARG_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDDEF_H 1 - - /* Define if you have the header file. */ - #define HAVE_STDLIB_H 1 - /* Define if you have the header file. */ #define HAVE_SYS_FILE_H 1 --- 261,267 ---- From montanaro at users.sourceforge.net Tue Feb 10 11:50:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:41:56 2004 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.312, 2.313 readline.c, 2.66, 2.67 socketmodule.c, 1.283, 1.284 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/Modules Modified Files: posixmodule.c readline.c socketmodule.c Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.312 retrieving revision 2.313 diff -C2 -d -r2.312 -r2.313 *** posixmodule.c 17 Jan 2004 14:19:44 -0000 2.312 --- posixmodule.c 10 Feb 2004 16:50:18 -0000 2.313 *************** *** 54,60 **** #endif - #ifdef HAVE_SIGNAL_H #include - #endif #ifdef HAVE_FCNTL_H --- 54,58 ---- Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.66 retrieving revision 2.67 diff -C2 -d -r2.66 -r2.67 *** readline.c 13 Nov 2003 07:43:21 -0000 2.66 --- readline.c 10 Feb 2004 16:50:19 -0000 2.67 *************** *** 13,17 **** #include ! #if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE) /* GNU readline() mistakenly sets the LC_CTYPE locale. * This is evil. Only the user or the app's main() should do this! --- 13,17 ---- #include ! #if defined(HAVE_SETLOCALE) /* GNU readline() mistakenly sets the LC_CTYPE locale. * This is evil. Only the user or the app's main() should do this! Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.283 retrieving revision 1.284 diff -C2 -d -r1.283 -r1.284 *** socketmodule.c 2 Feb 2004 06:03:09 -0000 1.283 --- socketmodule.c 10 Feb 2004 16:50:19 -0000 1.284 *************** *** 248,254 **** #endif ! #ifdef HAVE_STDDEF_H ! # include ! #endif #ifndef offsetof --- 248,252 ---- #endif ! #include #ifndef offsetof From montanaro at users.sourceforge.net Tue Feb 10 11:50:36 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 12:43:04 2004 Subject: [Python-checkins] python/dist/src/Modules/expat macconfig.h, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/Modules/expat Modified Files: macconfig.h Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: macconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/macconfig.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** macconfig.h 21 Oct 2003 15:38:55 -0000 1.1 --- macconfig.h 10 Feb 2004 16:50:19 -0000 1.2 *************** *** 43,55 **** #undef HAVE_STDINT_H - /* Define to 1 if you have the header file. */ - #define HAVE_STDLIB_H - /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H - /* Define to 1 if you have the header file. */ - #define HAVE_STRING_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H --- 43,49 ---- From montanaro at users.sourceforge.net Tue Feb 10 11:50:51 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 13:00:34 2004 Subject: [Python-checkins] python/dist/src/Include Python.h, 2.60, 2.61 pyport.h, 2.65, 2.66 structmember.h, 2.21, 2.22 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540/Include Modified Files: Python.h pyport.h structmember.h Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: Python.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/Python.h,v retrieving revision 2.60 retrieving revision 2.61 diff -C2 -d -r2.60 -r2.61 *** Python.h 22 Dec 2003 18:10:51 -0000 2.60 --- Python.h 10 Feb 2004 16:50:18 -0000 2.61 *************** *** 16,24 **** #endif - #ifdef HAVE_LIMITS_H #include - #else - #error "limits.h is required by std C -- why isn't HAVE_LIMITS_H defined?" - #endif #ifndef UCHAR_MAX --- 16,20 ---- *************** *** 41,47 **** #include #include - #ifdef HAVE_STDLIB_H #include - #endif #ifdef HAVE_UNISTD_H #include --- 37,41 ---- Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.65 retrieving revision 2.66 diff -C2 -d -r2.65 -r2.66 *** pyport.h 17 Jan 2004 14:19:43 -0000 2.65 --- pyport.h 10 Feb 2004 16:50:18 -0000 2.66 *************** *** 86,92 **** #endif /* HAVE_UINTPTR_T */ - #ifdef HAVE_STDLIB_H #include - #endif #include /* Moved here from the math section, before extern "C" */ --- 86,90 ---- Index: structmember.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/structmember.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** structmember.h 20 Nov 2003 01:44:57 -0000 2.21 --- structmember.h 10 Feb 2004 16:50:18 -0000 2.22 *************** *** 8,14 **** /* Interface to map C struct members to Python object attributes */ - #ifdef HAVE_STDDEF_H #include /* For offsetof */ - #endif /* The offsetof() macro calculates the offset of a structure member --- 8,12 ---- From nnorwitz at users.sourceforge.net Tue Feb 10 13:07:20 2004 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Tue Feb 10 13:10:40 2004 Subject: [Python-checkins] python/dist/src/Doc/ext embedding.tex,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12251/Doc/ext Modified Files: embedding.tex Log Message: SF #894428, fix typo Index: embedding.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/embedding.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** embedding.tex 2 Dec 2002 04:42:58 -0000 1.8 --- embedding.tex 10 Feb 2004 18:07:16 -0000 1.9 *************** *** 132,136 **** script. Like in the section about the very high level interface, the Python interpreter does not directly interact with the ! application (but that will change in th next section). The code to run a function defined in a Python script is: --- 132,136 ---- script. Like in the section about the very high level interface, the Python interpreter does not directly interact with the ! application (but that will change in the next section). The code to run a function defined in a Python script is: From nnorwitz at users.sourceforge.net Tue Feb 10 13:08:26 2004 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Tue Feb 10 13:11:46 2004 Subject: [Python-checkins] python/dist/src/Doc/ext embedding.tex, 1.8, 1.8.16.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12469/Doc/ext Modified Files: Tag: release23-maint embedding.tex Log Message: SF #894428, fix typo Index: embedding.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/embedding.tex,v retrieving revision 1.8 retrieving revision 1.8.16.1 diff -C2 -d -r1.8 -r1.8.16.1 *** embedding.tex 2 Dec 2002 04:42:58 -0000 1.8 --- embedding.tex 10 Feb 2004 18:08:23 -0000 1.8.16.1 *************** *** 132,136 **** script. Like in the section about the very high level interface, the Python interpreter does not directly interact with the ! application (but that will change in th next section). The code to run a function defined in a Python script is: --- 132,136 ---- script. Like in the section about the very high level interface, the Python interpreter does not directly interact with the ! application (but that will change in the next section). The code to run a function defined in a Python script is: From montanaro at users.sourceforge.net Tue Feb 10 11:50:51 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 13:16:38 2004 Subject: [Python-checkins] python/dist/src configure, 1.440, 1.441 configure.in, 1.451, 1.452 pyconfig.h.in, 1.94, 1.95 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27540 Modified Files: configure configure.in pyconfig.h.in Log Message: remove support for missing ANSI C header files (limits.h, stddef.h, etc). Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.440 retrieving revision 1.441 diff -C2 -d -r1.440 -r1.441 *** configure 7 Feb 2004 13:53:44 -0000 1.440 --- configure 10 Feb 2004 16:50:15 -0000 1.441 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.450 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.451 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 4344,4356 **** ! ! ! ! ! ! ! for ac_header in dlfcn.h fcntl.h grp.h limits.h langinfo.h \ ! libintl.h locale.h ncurses.h poll.h pthread.h \ ! signal.h stdarg.h stddef.h stdlib.h stropts.h termios.h thread.h \ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ --- 4344,4350 ---- ! for ac_header in dlfcn.h fcntl.h grp.h langinfo.h \ ! libintl.h ncurses.h poll.h pthread.h \ ! stropts.h termios.h thread.h \ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.451 retrieving revision 1.452 diff -C2 -d -r1.451 -r1.452 *** configure.in 7 Feb 2004 13:53:45 -0000 1.451 --- configure.in 10 Feb 2004 16:50:18 -0000 1.452 *************** *** 912,918 **** # checks for header files AC_HEADER_STDC ! AC_CHECK_HEADERS(dlfcn.h fcntl.h grp.h limits.h langinfo.h \ ! libintl.h locale.h ncurses.h poll.h pthread.h \ ! signal.h stdarg.h stddef.h stdlib.h stropts.h termios.h thread.h \ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ --- 912,918 ---- # checks for header files AC_HEADER_STDC ! AC_CHECK_HEADERS(dlfcn.h fcntl.h grp.h langinfo.h \ ! libintl.h ncurses.h poll.h pthread.h \ ! stropts.h termios.h thread.h \ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/file.h sys/lock.h sys/mkdev.h sys/modem.h \ Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** pyconfig.h.in 7 Feb 2004 13:53:45 -0000 1.94 --- pyconfig.h.in 10 Feb 2004 16:50:18 -0000 1.95 *************** *** 267,279 **** #undef HAVE_LIBUTIL_H - /* Define to 1 if you have the header file. */ - #undef HAVE_LIMITS_H - /* Define if you have the 'link' function. */ #undef HAVE_LINK - /* Define to 1 if you have the header file. */ - #undef HAVE_LOCALE_H - /* Define this if you have the type long long. */ #undef HAVE_LONG_LONG --- 267,273 ---- *************** *** 417,423 **** #undef HAVE_SIGINTERRUPT - /* Define to 1 if you have the header file. */ - #undef HAVE_SIGNAL_H - /* Define to 1 if you have the `sigrelse' function. */ #undef HAVE_SIGRELSE --- 411,414 ---- *************** *** 438,460 **** #undef HAVE_STAT_TV_NSEC - /* Define to 1 if you have the header file. */ - #undef HAVE_STDARG_H - /* Define if your compiler supports variable length function prototypes (e.g. void fprintf(FILE *, char *, ...);) *and* */ #undef HAVE_STDARG_PROTOTYPES - /* Define to 1 if you have the header file. */ - #undef HAVE_STDDEF_H - /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H - /* Define to 1 if you have the header file. */ - #undef HAVE_STDLIB_H - - /* Define to 1 if you have the `strdup' function. */ - #undef HAVE_STRDUP - /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR --- 429,439 ---- *************** *** 466,472 **** #undef HAVE_STRINGS_H - /* Define to 1 if you have the header file. */ - #undef HAVE_STRING_H - /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H --- 445,448 ---- From fdrake at users.sourceforge.net Tue Feb 10 13:29:46 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 10 13:33:06 2004 Subject: [Python-checkins] python/dist/src/Doc/texinputs python.sty, 1.107, 1.108 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17640 Modified Files: python.sty Log Message: add support for \e to the {alltt} environment Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** python.sty 9 Feb 2004 20:58:08 -0000 1.107 --- python.sty 10 Feb 2004 18:29:43 -0000 1.108 *************** *** 237,240 **** --- 237,241 ---- \setlength{\py@codewidth}{\linewidth}% \addtolength{\py@codewidth}{-\parindent}% + \let\e=\textbackslash% % \par\indent% From fdrake at users.sourceforge.net Tue Feb 10 13:30:25 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Feb 10 13:33:44 2004 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex,1.82,1.83 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17808 Modified Files: doc.tex Log Message: add support for \e to the {alltt} environment Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** doc.tex 9 Feb 2004 21:00:29 -0000 1.82 --- doc.tex 10 Feb 2004 18:30:22 -0000 1.83 *************** *** 791,795 **** \begin{macrodesc}{e}{} Produces a backslash. This is convenient in \macro{code}, ! \macro{file}, and similar macros, and is only defined there. To create a backslash in ordinary text (such as the contents of the \macro{citetitle} macro), use the standard \macro{textbackslash} --- 791,796 ---- \begin{macrodesc}{e}{} Produces a backslash. This is convenient in \macro{code}, ! \macro{file}, and similar macros, and the \env{alltt} ! environment, and is only defined there. To create a backslash in ordinary text (such as the contents of the \macro{citetitle} macro), use the standard \macro{textbackslash} From montanaro at users.sourceforge.net Tue Feb 10 15:27:43 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Tue Feb 10 15:31:06 2004 Subject: [Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.28, 1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13513/Modules Modified Files: itertoolsmodule.c Log Message: need to initialize ob_type slot at run-time, at least on cygwin Index: itertoolsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** itertoolsmodule.c 10 Feb 2004 09:25:40 -0000 1.28 --- itertoolsmodule.c 10 Feb 2004 20:27:40 -0000 1.29 *************** *** 414,418 **** static PyTypeObject teedataobject_type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /* ob_size */ "itertools.tee_dataobject", /* tp_name */ --- 414,418 ---- static PyTypeObject teedataobject_type = { ! PyObject_HEAD_INIT(0) /* Must fill in type value later */ 0, /* ob_size */ "itertools.tee_dataobject", /* tp_name */ *************** *** 2466,2469 **** --- 2466,2470 ---- }; + teedataobject_type.ob_type = &PyType_Type; m = Py_InitModule3("itertools", module_methods, module_doc); From jhylton at users.sourceforge.net Wed Feb 11 14:09:59 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Feb 11 14:13:29 2004 Subject: [Python-checkins] python/dist/src/Lib/distutils sysconfig.py, 1.49.2.1, 1.49.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30665/Lib/distutils Modified Files: Tag: ast-branch sysconfig.py Log Message: If there is no .pyc file, just compile the code directly. Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v retrieving revision 1.49.2.1 retrieving revision 1.49.2.2 diff -C2 -d -r1.49.2.1 -r1.49.2.2 *** sysconfig.py 28 Apr 2003 17:31:41 -0000 1.49.2.1 --- sysconfig.py 11 Feb 2004 19:09:57 -0000 1.49.2.2 *************** *** 356,359 **** --- 356,360 ---- raise DistutilsPlatformError(my_msg) + print g # On AIX, there are wrong paths to the linker scripts in the Makefile From jhylton at users.sourceforge.net Wed Feb 11 14:10:42 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Feb 11 14:14:11 2004 Subject: [Python-checkins] python/dist/src/Tools/compiler dumppyc.py, 1.2, 1.2.28.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/compiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30945/compiler Modified Files: Tag: release23-maint dumppyc.py Log Message: If there is no .pyc file, just compile the code directly. Index: dumppyc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/dumppyc.py,v retrieving revision 1.2 retrieving revision 1.2.28.1 diff -C2 -d -r1.2 -r1.2.28.1 *** dumppyc.py 17 Sep 2001 18:08:20 -0000 1.2 --- dumppyc.py 11 Feb 2004 19:10:40 -0000 1.2.28.1 *************** *** 14,22 **** def loadCode(path): ! f = open(path) ! f.read(8) ! co = marshal.load(f) ! f.close() ! return co def walk(co, match=None): --- 14,25 ---- def loadCode(path): ! if path[-1] == "c": ! f = open(path) ! f.read(8) ! co = marshal.load(f) ! f.close() ! return co ! else: ! return compile(open(path).read(), path, "exec") def walk(co, match=None): From jhylton at users.sourceforge.net Wed Feb 11 14:15:36 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Wed Feb 11 14:19:06 2004 Subject: [Python-checkins] python/dist/src/Lib/distutils sysconfig.py, 1.49.2.2, 1.49.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32324 Modified Files: Tag: ast-branch sysconfig.py Log Message: Revert previous checkin (operator error). Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/sysconfig.py,v retrieving revision 1.49.2.2 retrieving revision 1.49.2.3 diff -C2 -d -r1.49.2.2 -r1.49.2.3 *** sysconfig.py 11 Feb 2004 19:09:57 -0000 1.49.2.2 --- sysconfig.py 11 Feb 2004 19:15:34 -0000 1.49.2.3 *************** *** 356,361 **** raise DistutilsPlatformError(my_msg) - print g - # On AIX, there are wrong paths to the linker scripts in the Makefile # -- these paths are relative to the Python source, but when installed --- 356,359 ---- From koyit at thebrewer.com Wed Feb 11 22:19:44 2004 From: koyit at thebrewer.com (Jacob Fernandez) Date: Wed Feb 11 20:07:24 2004 Subject: [Python-checkins] 85.LG. Xanax - Buy Online Message-ID: New OFFSHORE PHARMACY - No Rx required! BEST DEALS ON: Valium, Xanaxm, Soma, Adipex, Zyban, Super V1agara, etc. 100% Private & Fast SHIPPING NOW! 128-bit encrypted site which means maximum confidentiality & no tracing. Executives, Doctor's, & business people have been using our site for years & we are proud to present it to you. See what were all about today. http://triode.soldrupfvc.com/m0015/index.php?id=m0015 This communication is privileged and contains confidential information intended only for the person(s) to whom it is addressed. Any unauthorized disclosure, copying, other distribution of this communication or taking any action on its contents is strictly prohibited. If you have received this message in error, please notify us immediately OR remove yourself from our list if there is no interest in regards to our products. http://ionosphere.bacconed.com/m0015/index.php?id=m0015 pixy enid lopez mock gifford waller backplate coexistent century featherbed trapezium heterogeneity gamble costume beltsville illumine uranyl balled defocus crosby cholera articulatory compression logarithm refuge copperfield prejudice voracity digestive condescension truss admissible dysplasia awhile exudate real replete bred gpo cruickshank hull vitae breadth m From rhettinger at users.sourceforge.net Thu Feb 12 04:50:48 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Feb 12 04:54:26 2004 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.221,1.222 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14142 Modified Files: tut.tex Log Message: SF 895560: minor typo Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.221 retrieving revision 1.222 diff -C2 -d -r1.221 -r1.222 *** tut.tex 30 Dec 2003 16:15:35 -0000 1.221 --- tut.tex 12 Feb 2004 09:50:42 -0000 1.222 *************** *** 4286,4291 **** \section{Iterators\label{iterators}} ! By now, you've probably noticed that most container objects can looped over ! using a \code{for} statement: \begin{verbatim} --- 4286,4291 ---- \section{Iterators\label{iterators}} ! By now, you've probably noticed that most container objects can be looped ! over using a \code{for} statement: \begin{verbatim} From rhettinger at users.sourceforge.net Thu Feb 12 04:52:46 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Feb 12 04:56:22 2004 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.15, 1.196.8.16 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14506 Modified Files: Tag: release23-maint tut.tex Log Message: SF 895560: minor typo Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.15 retrieving revision 1.196.8.16 diff -C2 -d -r1.196.8.15 -r1.196.8.16 *** tut.tex 20 Dec 2003 20:16:11 -0000 1.196.8.15 --- tut.tex 12 Feb 2004 09:52:43 -0000 1.196.8.16 *************** *** 4220,4225 **** \section{Iterators\label{iterators}} ! By now, you've probably noticed that most container objects can looped over ! using a \code{for} statement: \begin{verbatim} --- 4220,4225 ---- \section{Iterators\label{iterators}} ! By now, you've probably noticed that most container objects can be looped ! over using a \code{for} statement: \begin{verbatim} From fdrake at users.sourceforge.net Thu Feb 12 09:34:44 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Feb 12 09:38:22 2004 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex, 1.196.8.16, 1.196.8.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8643 Modified Files: Tag: release23-maint tut.tex Log Message: fix minor markup error: \code{for} --> \keyword{for} Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.196.8.16 retrieving revision 1.196.8.17 diff -C2 -d -r1.196.8.16 -r1.196.8.17 *** tut.tex 12 Feb 2004 09:52:43 -0000 1.196.8.16 --- tut.tex 12 Feb 2004 14:34:42 -0000 1.196.8.17 *************** *** 4221,4225 **** By now, you've probably noticed that most container objects can be looped ! over using a \code{for} statement: \begin{verbatim} --- 4221,4225 ---- By now, you've probably noticed that most container objects can be looped ! over using a \keyword{for} statement: \begin{verbatim} *************** *** 4237,4245 **** This style of access is clear, concise, and convenient. The use of iterators ! pervades and unifies Python. Behind the scenes, the \code{for} statement calls ! \function{iter()} on the container object. The function returns an iterator ! object that defines the method \method{next()} which accesses elements in the ! container one at a time. When there are no more elements, \method{next()} ! raises a \exception{StopIteration} exception which tells the \code{for} loop to terminate. This example shows how it all works: --- 4237,4246 ---- This style of access is clear, concise, and convenient. The use of iterators ! pervades and unifies Python. Behind the scenes, the \keyword{for} ! statement calls \function{iter()} on the container object. The ! function returns an iterator object that defines the method ! \method{next()} which accesses elements in the container one at a ! time. When there are no more elements, \method{next()} raises a ! \exception{StopIteration} exception which tells the \keyword{for} loop to terminate. This example shows how it all works: From fdrake at users.sourceforge.net Thu Feb 12 09:35:21 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Feb 12 09:39:00 2004 Subject: [Python-checkins] python/dist/src/Doc/tut tut.tex,1.222,1.223 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8759 Modified Files: tut.tex Log Message: fix minor markup error: \code{for} --> \keyword{for} Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.222 retrieving revision 1.223 diff -C2 -d -r1.222 -r1.223 *** tut.tex 12 Feb 2004 09:50:42 -0000 1.222 --- tut.tex 12 Feb 2004 14:35:18 -0000 1.223 *************** *** 4287,4291 **** By now, you've probably noticed that most container objects can be looped ! over using a \code{for} statement: \begin{verbatim} --- 4287,4291 ---- By now, you've probably noticed that most container objects can be looped ! over using a \keyword{for} statement: \begin{verbatim} *************** *** 4303,4311 **** This style of access is clear, concise, and convenient. The use of iterators ! pervades and unifies Python. Behind the scenes, the \code{for} statement calls ! \function{iter()} on the container object. The function returns an iterator ! object that defines the method \method{next()} which accesses elements in the ! container one at a time. When there are no more elements, \method{next()} ! raises a \exception{StopIteration} exception which tells the \code{for} loop to terminate. This example shows how it all works: --- 4303,4312 ---- This style of access is clear, concise, and convenient. The use of iterators ! pervades and unifies Python. Behind the scenes, the \keyword{for} ! statement calls \function{iter()} on the container object. The ! function returns an iterator object that defines the method ! \method{next()} which accesses elements in the container one at a ! time. When there are no more elements, \method{next()} raises a ! \exception{StopIteration} exception which tells the \keyword{for} loop to terminate. This example shows how it all works: From mwh at users.sourceforge.net Thu Feb 12 10:28:28 2004 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Feb 12 10:32:08 2004 Subject: [Python-checkins] python/dist/src/Include compile.h,2.40,2.41 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/Include Modified Files: compile.h Log Message: This is my patch #876198 plus a NEWS entry and a header frob. Remove the ability to use (from C) arbitrary objects supporting the read buffer interface as the co_code member of code objects. Index: compile.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** compile.h 5 Feb 2003 23:12:56 -0000 2.40 --- compile.h 12 Feb 2004 15:28:26 -0000 2.41 *************** *** 82,90 **** #define FUTURE_DIVISION "division" - /* for internal use only */ - #define _PyCode_GETCODEPTR(co, pp) \ - ((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \ - ((co)->co_code, 0, (void **)(pp))) - #ifdef __cplusplus } --- 82,85 ---- From mwh at users.sourceforge.net Thu Feb 12 10:28:29 2004 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Feb 12 10:32:12 2004 Subject: [Python-checkins] python/dist/src/Python ceval.c,2.376,2.377 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/Python Modified Files: ceval.c Log Message: This is my patch #876198 plus a NEWS entry and a header frob. Remove the ability to use (from C) arbitrary objects supporting the read buffer interface as the co_code member of code objects. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.376 retrieving revision 2.377 diff -C2 -d -r2.376 -r2.377 *** ceval.c 10 Feb 2004 16:50:20 -0000 2.376 --- ceval.c 12 Feb 2004 15:28:26 -0000 2.377 *************** *** 755,759 **** fastlocals = f->f_localsplus; freevars = f->f_localsplus + f->f_nlocals; ! _PyCode_GETCODEPTR(co, &first_instr); /* An explanation is in order for the next line. --- 755,759 ---- fastlocals = f->f_localsplus; freevars = f->f_localsplus + f->f_nlocals; ! first_instr = PyString_AS_STRING(co->co_code); /* An explanation is in order for the next line. From mwh at users.sourceforge.net Thu Feb 12 10:28:31 2004 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Thu Feb 12 10:32:17 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.930,1.931 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19895/Misc Modified Files: NEWS Log Message: This is my patch #876198 plus a NEWS entry and a header frob. Remove the ability to use (from C) arbitrary objects supporting the read buffer interface as the co_code member of code objects. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.930 retrieving revision 1.931 diff -C2 -d -r1.930 -r1.931 *** NEWS 10 Feb 2004 16:50:21 -0000 1.930 --- NEWS 12 Feb 2004 15:28:27 -0000 1.931 *************** *** 13,16 **** --- 13,20 ---- ----------------- + - Support for arbitrary objects supporting the read-only buffer + interface as the co_code field of code objects (something that was + only possible to create from C code) has been removed. + - Made omitted callback and None equivalent for weakref.ref() and weakref.proxy(); the None case wasn't handled correctly in all From doerwalter at users.sourceforge.net Thu Feb 12 12:35:35 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:18 2004 Subject: [Python-checkins] python/dist/src/Demo/newmetaclasses Enum.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/newmetaclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/newmetaclasses Modified Files: Enum.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: Enum.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/newmetaclasses/Enum.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Enum.py 11 Jul 2002 21:08:06 -0000 1.1 --- Enum.py 12 Feb 2004 17:35:02 -0000 1.2 *************** *** 98,102 **** print Color.red ! print `Color.red` print Color.red == Color.red print Color.red == Color.blue --- 98,102 ---- print Color.red ! print repr(Color.red) print Color.red == Color.red print Color.red == Color.blue *************** *** 140,144 **** print Color.red ! print `Color.red` print Color.red == Color.red print Color.red == Color.blue --- 140,144 ---- print Color.red ! print repr(Color.red) print Color.red == Color.red print Color.red == Color.blue From doerwalter at users.sourceforge.net Thu Feb 12 12:35:35 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:26 2004 Subject: [Python-checkins] python/dist/src/Demo/metaclasses Enum.py, 1.3, 1.4 Meta.py, 1.4, 1.5 Trace.py, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/metaclasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/metaclasses Modified Files: Enum.py Meta.py Trace.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: Enum.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/metaclasses/Enum.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Enum.py 14 Sep 1998 16:44:10 -0000 1.3 --- Enum.py 12 Feb 2004 17:35:02 -0000 1.4 *************** *** 108,114 **** def __repr__(self): ! return "EnumInstance(%s, %s, %s)" % (`self.__classname`, ! `self.__enumname`, ! `self.__value`) def __str__(self): --- 108,114 ---- def __repr__(self): ! return "EnumInstance(%r, %r, %r)" % (self.__classname, ! self.__enumname, ! self.__value) def __str__(self): Index: Meta.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/metaclasses/Meta.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Meta.py 15 Jan 2001 16:53:58 -0000 1.4 --- Meta.py 12 Feb 2004 17:35:02 -0000 1.5 *************** *** 99,103 **** print "__init__, args =", args def m1(self, x): ! print "m1(x=%s)" %`x` print C x = C() --- 99,103 ---- print "__init__, args =", args def m1(self, x): ! print "m1(x=%r)" % (x,) print C x = C() Index: Trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/metaclasses/Trace.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Trace.py 14 Sep 1998 16:44:11 -0000 1.3 --- Trace.py 12 Feb 2004 17:35:02 -0000 1.4 *************** *** 118,122 **** __trace_output__ = sys.stdout class D(C): ! def m2(self, y): print "D.m2(%s)" % `y`; return C.m2(self, y) __trace_output__ = None x = C(4321) --- 118,122 ---- __trace_output__ = sys.stdout class D(C): ! def m2(self, y): print "D.m2(%r)" % (y,); return C.m2(self, y) __trace_output__ = None x = C(4321) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:35 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:30 2004 Subject: [Python-checkins] python/dist/src/Demo/rpc T.py, 1.3, 1.4 rnusersclient.py, 1.3, 1.4 rpc.py, 1.11, 1.12 xdr.py, 1.10, 1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/rpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/rpc Modified Files: T.py rnusersclient.py rpc.py xdr.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: T.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/rpc/T.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** T.py 17 Feb 1994 12:34:54 -0000 1.3 --- T.py 12 Feb 2004 17:35:02 -0000 1.4 *************** *** 19,22 **** msg = '' for x in label: msg = msg + (x + ' ') ! msg = msg + `u` + ' user, ' + `s` + ' sys, ' + `r` + ' real\n' sys.stderr.write(msg) --- 19,22 ---- msg = '' for x in label: msg = msg + (x + ' ') ! msg = msg + '%r user, %r sys, %r real\n' % (u, s, r) sys.stderr.write(msg) Index: rnusersclient.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/rpc/rnusersclient.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rnusersclient.py 17 Dec 1993 14:32:26 -0000 1.3 --- rnusersclient.py 12 Feb 2004 17:35:02 -0000 1.4 *************** *** 78,82 **** name = strip0(name) host = strip0(host) ! print `name`, `host`, `line`, time, idle def testbcast(): --- 78,82 ---- name = strip0(name) host = strip0(host) ! print "%r %r %r %s %s" % (name, host, line, time, idle) def testbcast(): Index: rpc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/rpc/rpc.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** rpc.py 21 Jul 1996 02:09:54 -0000 1.11 --- rpc.py 12 Feb 2004 17:35:02 -0000 1.12 *************** *** 94,101 **** temp = self.unpack_enum() if temp <> CALL: ! raise BadRPCFormat, 'no CALL but ' + `temp` temp = self.unpack_uint() if temp <> RPCVERSION: ! raise BadRPCVerspion, 'bad RPC version ' + `temp` prog = self.unpack_uint() vers = self.unpack_uint() --- 94,101 ---- temp = self.unpack_enum() if temp <> CALL: ! raise BadRPCFormat, 'no CALL but %r' % (temp,) temp = self.unpack_uint() if temp <> RPCVERSION: ! raise BadRPCVerspion, 'bad RPC version %r' % (temp,) prog = self.unpack_uint() vers = self.unpack_uint() *************** *** 110,114 **** mtype = self.unpack_enum() if mtype <> REPLY: ! raise RuntimeError, 'no REPLY but ' + `mtype` stat = self.unpack_enum() if stat == MSG_DENIED: --- 110,114 ---- mtype = self.unpack_enum() if mtype <> REPLY: ! raise RuntimeError, 'no REPLY but %r' % (mtype,) stat = self.unpack_enum() if stat == MSG_DENIED: *************** *** 118,130 **** high = self.unpack_uint() raise RuntimeError, \ ! 'MSG_DENIED: RPC_MISMATCH: ' + `low, high` if stat == AUTH_ERROR: stat = self.unpack_uint() raise RuntimeError, \ ! 'MSG_DENIED: AUTH_ERROR: ' + `stat` ! raise RuntimeError, 'MSG_DENIED: ' + `stat` if stat <> MSG_ACCEPTED: raise RuntimeError, \ ! 'Neither MSG_DENIED nor MSG_ACCEPTED: ' + `stat` verf = self.unpack_auth() stat = self.unpack_enum() --- 118,130 ---- high = self.unpack_uint() raise RuntimeError, \ ! 'MSG_DENIED: RPC_MISMATCH: %r' % ((low, high),) if stat == AUTH_ERROR: stat = self.unpack_uint() raise RuntimeError, \ ! 'MSG_DENIED: AUTH_ERROR: %r' % (stat,) ! raise RuntimeError, 'MSG_DENIED: %r' % (stat,) if stat <> MSG_ACCEPTED: raise RuntimeError, \ ! 'Neither MSG_DENIED nor MSG_ACCEPTED: %r' % (stat,) verf = self.unpack_auth() stat = self.unpack_enum() *************** *** 135,139 **** high = self.unpack_uint() raise RuntimeError, \ ! 'call failed: PROG_MISMATCH: ' + `low, high` if stat == PROC_UNAVAIL: raise RuntimeError, 'call failed: PROC_UNAVAIL' --- 135,139 ---- high = self.unpack_uint() raise RuntimeError, \ ! 'call failed: PROG_MISMATCH: %r' % ((low, high),) if stat == PROC_UNAVAIL: raise RuntimeError, 'call failed: PROC_UNAVAIL' *************** *** 141,145 **** raise RuntimeError, 'call failed: GARBAGE_ARGS' if stat <> SUCCESS: ! raise RuntimeError, 'call failed: ' + `stat` return xid, verf # Caller must get procedure-specific part of reply --- 141,145 ---- raise RuntimeError, 'call failed: GARBAGE_ARGS' if stat <> SUCCESS: ! raise RuntimeError, 'call failed: %r' % (stat,) return xid, verf # Caller must get procedure-specific part of reply *************** *** 351,356 **** if xid <> self.lastxid: # Can't really happen since this is TCP... ! raise RuntimeError, 'wrong xid in reply ' + `xid` + \ ! ' instead of ' + `self.lastxid` --- 351,356 ---- if xid <> self.lastxid: # Can't really happen since this is TCP... ! raise RuntimeError, 'wrong xid in reply %r instead of %r' % ( ! xid, self.lastxid) *************** *** 702,706 **** return self.packer.get_buf() proc = self.unpacker.unpack_uint() ! methname = 'handle_' + `proc` try: meth = getattr(self, methname) --- 702,706 ---- return self.packer.get_buf() proc = self.unpacker.unpack_uint() ! methname = 'handle_' + repr(proc) try: meth = getattr(self, methname) *************** *** 841,845 **** def rh(reply, fromaddr): host, port = fromaddr ! print host + '\t' + `reply` pmap = BroadcastUDPPortMapperClient(bcastaddr) pmap.set_reply_handler(rh) --- 841,845 ---- def rh(reply, fromaddr): host, port = fromaddr ! print host + '\t' + repr(reply) pmap = BroadcastUDPPortMapperClient(bcastaddr) pmap.set_reply_handler(rh) *************** *** 859,863 **** arg = self.unpacker.unpack_string() self.turn_around() ! print 'RPC function 1 called, arg', `arg` self.packer.pack_string(arg + arg) # --- 859,863 ---- arg = self.unpacker.unpack_string() self.turn_around() ! print 'RPC function 1 called, arg', repr(arg) self.packer.pack_string(arg + arg) # *************** *** 889,891 **** print 'making call...' reply = c.call_1('hello, world, ') ! print 'call returned', `reply` --- 889,891 ---- print 'making call...' reply = c.call_1('hello, world, ') ! print 'call returned', repr(reply) Index: xdr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/rpc/xdr.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** xdr.py 28 Jan 1998 14:59:48 -0000 1.10 --- xdr.py 12 Feb 2004 17:35:02 -0000 1.11 *************** *** 185,190 **** if x == 0: break if x <> 1: ! raise RuntimeError, \ ! '0 or 1 expected, got ' + `x` item = unpack_item() list.append(item) --- 185,189 ---- if x == 0: break if x <> 1: ! raise RuntimeError, '0 or 1 expected, got %r' % (x, ) item = unpack_item() list.append(item) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:36 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:32 2004 Subject: [Python-checkins] python/dist/src/Demo/tix/samples DirList.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tix/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/tix/samples Modified Files: DirList.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: DirList.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/DirList.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DirList.py 17 Mar 2002 18:19:13 -0000 1.2 --- DirList.py 12 Feb 2004 17:35:03 -0000 1.3 *************** *** 76,80 **** self.copy_name(dir,ent) ! # top.ent.entry.insert(0,'tix'+`self`) top.ent.entry.bind('', lambda self=self: self.okcmd () ) --- 76,80 ---- self.copy_name(dir,ent) ! # top.ent.entry.insert(0,'tix'+repr(self)) top.ent.entry.bind('', lambda self=self: self.okcmd () ) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:36 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:37 2004 Subject: [Python-checkins] python/dist/src/Demo/pdist RCSProxy.py, 1.6, 1.7 client.py, 1.4, 1.5 cmdfw.py, 1.2, 1.3 cmptree.py, 1.2, 1.3 cvslock.py, 1.1, 1.2 rcslib.py, 1.9, 1.10 server.py, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/pdist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/pdist Modified Files: RCSProxy.py client.py cmdfw.py cmptree.py cvslock.py rcslib.py server.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: RCSProxy.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pdist/RCSProxy.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RCSProxy.py 14 Sep 1998 16:43:55 -0000 1.6 --- RCSProxy.py 12 Feb 2004 17:35:02 -0000 1.7 *************** *** 189,193 **** print apply(attr, tuple(sys.argv[2:])) else: ! print `attr` else: print "%s: no such attribute" % what --- 189,193 ---- print apply(attr, tuple(sys.argv[2:])) else: ! print repr(attr) else: print "%s: no such attribute" % what Index: client.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pdist/client.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** client.py 7 Oct 1995 19:27:20 -0000 1.4 --- client.py 12 Feb 2004 17:35:02 -0000 1.5 *************** *** 140,144 **** challenge = string.atoi(string.strip(line)) response = self._encode_challenge(challenge) ! line = `long(response)` if line[-1] in 'Ll': line = line[:-1] self._wf.write(line + '\n') --- 140,144 ---- challenge = string.atoi(string.strip(line)) response = self._encode_challenge(challenge) ! line = repr(long(response)) if line[-1] in 'Ll': line = line[:-1] self._wf.write(line + '\n') Index: cmdfw.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pdist/cmdfw.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cmdfw.py 27 Apr 1995 23:32:47 -0000 1.2 --- cmdfw.py 12 Feb 2004 17:35:02 -0000 1.3 *************** *** 56,60 **** method = getattr(self, mname) except AttributeError: ! return self.usage("command %s unknown" % `cmd`) try: flags = getattr(self, fname) --- 56,60 ---- method = getattr(self, mname) except AttributeError: ! return self.usage("command %r unknown" % (cmd,)) try: flags = getattr(self, fname) *************** *** 76,80 **** print "Options:" for o, a in opts: ! print 'option', o, 'value', `a` print "-"*40 --- 76,80 ---- print "Options:" for o, a in opts: ! print 'option', o, 'value', repr(a) print "-"*40 *************** *** 138,142 **** print '-'*10, t, '-'*10 sts = x.run(t) ! print "Exit status:", `sts` --- 138,142 ---- print '-'*10, t, '-'*10 sts = x.run(t) ! print "Exit status:", repr(sts) Index: cmptree.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pdist/cmptree.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cmptree.py 26 Apr 1995 22:57:06 -0000 1.2 --- cmptree.py 12 Feb 2004 17:35:02 -0000 1.3 *************** *** 50,54 **** def compare(local, remote, mode): print ! print "PWD =", `os.getcwd()` sums_id = remote._send('sumlist') subdirs_id = remote._send('listsubdirs') --- 50,54 ---- def compare(local, remote, mode): print ! print "PWD =", repr(os.getcwd()) sums_id = remote._send('sumlist') subdirs_id = remote._send('listsubdirs') *************** *** 65,69 **** rsumdict[name] = rsum if not lsumdict.has_key(name): ! print `name`, "only remote" if 'r' in mode and 'c' in mode: recvfile(local, remote, name) --- 65,69 ---- rsumdict[name] = rsum if not lsumdict.has_key(name): ! print repr(name), "only remote" if 'r' in mode and 'c' in mode: recvfile(local, remote, name) *************** *** 71,75 **** lsum = lsumdict[name] if lsum != rsum: ! print `name`, rmtime = remote.mtime(name) lmtime = local.mtime(name) --- 71,75 ---- lsum = lsumdict[name] if lsum != rsum: ! print repr(name), rmtime = remote.mtime(name) lmtime = local.mtime(name) *************** *** 87,91 **** for name in lsumdict.keys(): if not rsumdict.keys(): ! print `name`, "only locally", fl() if 'w' in mode and 'c' in mode: --- 87,91 ---- for name in lsumdict.keys(): if not rsumdict.keys(): ! print repr(name), "only locally", fl() if 'w' in mode and 'c' in mode: *************** *** 161,165 **** finally: if not ok: ! print "*** recvfile of %s failed, deleting" % `name` local.delete(name) --- 161,165 ---- finally: if not ok: ! print "*** recvfile of %r failed, deleting" % (name,) local.delete(name) Index: cvslock.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pdist/cvslock.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cvslock.py 23 Jun 1995 22:03:28 -0000 1.1 --- cvslock.py 12 Feb 2004 17:35:02 -0000 1.2 *************** *** 115,119 **** self.lockdir = None self.lockfile = None ! pid = `os.getpid()` self.cvslck = self.join(CVSLCK) self.cvsrfl = self.join(CVSRFL + pid) --- 115,119 ---- self.lockdir = None self.lockfile = None ! pid = repr(os.getpid()) self.cvslck = self.join(CVSLCK) self.cvsrfl = self.join(CVSRFL + pid) Index: rcslib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pdist/rcslib.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rcslib.py 9 Aug 2002 16:38:32 -0000 1.9 --- rcslib.py 12 Feb 2004 17:35:02 -0000 1.10 *************** *** 233,237 **** name, rev = self._unmangle(name_rev) if not self.isvalid(name): ! raise os.error, 'not an rcs file %s' % `name` return name, rev --- 233,237 ---- name, rev = self._unmangle(name_rev) if not self.isvalid(name): ! raise os.error, 'not an rcs file %r' % (name,) return name, rev *************** *** 253,257 **** if rev: cmd = cmd + ' ' + rflag + rev ! return os.popen("%s %s" % (cmd, `namev`)) def _unmangle(self, name_rev): --- 253,257 ---- if rev: cmd = cmd + ' ' + rflag + rev ! return os.popen("%s %r" % (cmd, namev)) def _unmangle(self, name_rev): Index: server.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pdist/server.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** server.py 21 Jun 1995 02:10:32 -0000 1.4 --- server.py 12 Feb 2004 17:35:02 -0000 1.5 *************** *** 135,143 **** except string.atol_error: if self._verbose > 0: ! print "Invalid response syntax", `response` return 0 if not self._compare_challenge_response(challenge, response): if self._verbose > 0: ! print "Invalid response value", `response` return 0 if self._verbose > 1: --- 135,143 ---- except string.atol_error: if self._verbose > 0: ! print "Invalid response syntax", repr(response) return 0 if not self._compare_challenge_response(challenge, response): if self._verbose > 0: ! print "Invalid response value", repr(response) return 0 if self._verbose > 1: From doerwalter at users.sourceforge.net Thu Feb 12 12:35:37 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:40 2004 Subject: [Python-checkins] python/dist/src/Demo/tkinter/matt animation-w-velocity-ctrl.py, 1.2, 1.3 pong-demo-1.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tkinter/matt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/tkinter/matt Modified Files: animation-w-velocity-ctrl.py pong-demo-1.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: animation-w-velocity-ctrl.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tkinter/matt/animation-w-velocity-ctrl.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** animation-w-velocity-ctrl.py 30 Jul 1996 18:56:31 -0000 1.2 --- animation-w-velocity-ctrl.py 12 Feb 2004 17:35:04 -0000 1.3 *************** *** 29,33 **** velocity = self.speed.get() str = float(velocity) / 1000.0 ! str = `str` + "i" self.draw.move("thing", str, str) self.after(10, self.moveThing) --- 29,33 ---- velocity = self.speed.get() str = float(velocity) / 1000.0 ! str = "%ri" % (str,) self.draw.move("thing", str, str) self.after(10, self.moveThing) Index: pong-demo-1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tkinter/matt/pong-demo-1.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pong-demo-1.py 30 Jul 1996 18:57:03 -0000 1.2 --- pong-demo-1.py 12 Feb 2004 17:35:04 -0000 1.3 *************** *** 40,44 **** self.y = self.y + deltay ! self.draw.move(self.ball, `deltax` + "i", `deltay` + "i") self.after(10, self.moveBall) --- 40,44 ---- self.y = self.y + deltay ! self.draw.move(self.ball, "%ri" % deltax, "%ri" % deltay) self.after(10, self.moveBall) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:36 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:50 2004 Subject: [Python-checkins] python/dist/src/Demo/threads Coroutine.py, 1.1, 1.2 find.py, 1.7, 1.8 sync.py, 1.6, 1.7 telnet.py, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/threads In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/threads Modified Files: Coroutine.py find.py sync.py telnet.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: Coroutine.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/threads/Coroutine.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Coroutine.py 8 Nov 2000 15:17:49 -0000 1.1 --- Coroutine.py 12 Feb 2004 17:35:03 -0000 1.2 *************** *** 139,146 **** def tran(self, target, data=None): if not self.invokedby.has_key(target): ! raise TypeError, '.tran target ' + `target` + \ ! ' is not an active coroutine' if self.killed: ! raise TypeError, '.tran target ' + `target` + ' is killed' self.value = data me = self.active --- 139,145 ---- def tran(self, target, data=None): if not self.invokedby.has_key(target): ! raise TypeError, '.tran target %r is not an active coroutine' % (target,) if self.killed: ! raise TypeError, '.tran target %r is killed' % (target,) self.value = data me = self.active *************** *** 154,158 **** raise Killed if self.terminated_by is not None: ! raise EarlyExit, `self.terminated_by` + ' terminated early' return self.value --- 153,157 ---- raise Killed if self.terminated_by is not None: ! raise EarlyExit, '%r terminated early' % (self.terminated_by,) return self.value Index: find.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/threads/find.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** find.py 18 Oct 2002 18:20:33 -0000 1.7 --- find.py 12 Feb 2004 17:35:03 -0000 1.8 *************** *** 117,121 **** t2 = time.time() ! sys.stderr.write('Total time ' + `t2-t1` + ' sec.\n') --- 117,121 ---- t2 = time.time() ! sys.stderr.write('Total time %r sec.\n' % (t2-t1)) *************** *** 134,138 **** names = os.listdir(dir) except os.error, msg: ! print `dir`, ':', msg return for name in names: --- 134,138 ---- names = os.listdir(dir) except os.error, msg: ! print repr(dir), ':', msg return for name in names: *************** *** 142,146 **** stat = os.lstat(fullname) except os.error, msg: ! print `fullname`, ':', msg continue if pred(dir, name, fullname, stat): --- 142,146 ---- stat = os.lstat(fullname) except os.error, msg: ! print repr(fullname), ':', msg continue if pred(dir, name, fullname, stat): Index: sync.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/threads/sync.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sync.py 14 Sep 1998 16:44:07 -0000 1.6 --- sync.py 12 Feb 2004 17:35:03 -0000 1.7 *************** *** 337,341 **** def broadcast(self, num = -1): if num < -1: ! raise ValueError, '.broadcast called with num ' + `num` if num == 0: return --- 337,341 ---- def broadcast(self, num = -1): if num < -1: ! raise ValueError, '.broadcast called with num %r' % (num,) if num == 0: return *************** *** 419,423 **** if self.count == self.maxcount: raise ValueError, '.v() tried to raise semaphore count above ' \ ! 'initial value ' + `maxcount` self.count = self.count + 1 self.nonzero.signal() --- 419,423 ---- if self.count == self.maxcount: raise ValueError, '.v() tried to raise semaphore count above ' \ ! 'initial value %r' % (maxcount,)) self.count = self.count + 1 self.nonzero.signal() Index: telnet.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/threads/telnet.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** telnet.py 21 Jan 2001 07:07:30 -0000 1.5 --- telnet.py 12 Feb 2004 17:35:03 -0000 1.6 *************** *** 58,62 **** s.connect((host, port)) except error, msg: ! sys.stderr.write('connect failed: ' + `msg` + '\n') sys.exit(1) # --- 58,62 ---- s.connect((host, port)) except error, msg: ! sys.stderr.write('connect failed: %r\n' % (msg,)) sys.exit(1) # *************** *** 78,82 **** if opt: print ord(c) ! ## print '(replying: ' + `opt+c` + ')' s.send(opt + c) opt = '' --- 78,82 ---- if opt: print ord(c) ! ## print '(replying: %r)' % (opt+c,) s.send(opt + c) opt = '' *************** *** 102,106 **** sys.stdout.write(cleandata) sys.stdout.flush() ! ## print 'Out:', `cleandata` def child(s): --- 102,106 ---- sys.stdout.write(cleandata) sys.stdout.flush() ! ## print 'Out:', repr(cleandata) def child(s): *************** *** 108,112 **** while 1: line = sys.stdin.readline() ! ## print 'Got:', `line` if not line: break s.send(line) --- 108,112 ---- while 1: line = sys.stdin.readline() ! ## print 'Got:', repr(line) if not line: break s.send(line) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:35 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:53 2004 Subject: [Python-checkins] python/dist/src/Demo/classes Complex.py, 1.6, 1.7 Dates.py, 1.4, 1.5 Dbm.py, 1.4, 1.5 Range.py, 1.5, 1.6 bitvec.py, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/classes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/classes Modified Files: Complex.py Dates.py Dbm.py Range.py bitvec.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: Complex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/classes/Complex.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Complex.py 24 Apr 2003 17:08:22 -0000 1.6 --- Complex.py 12 Feb 2004 17:35:01 -0000 1.7 *************** *** 118,130 **** def __repr__(self): if not self.im: ! return 'Complex(%s)' % `self.re` else: ! return 'Complex(%s, %s)' % (`self.re`, `self.im`) def __str__(self): if not self.im: ! return `self.re` else: ! return 'Complex(%s, %s)' % (`self.re`, `self.im`) def __neg__(self): --- 118,130 ---- def __repr__(self): if not self.im: ! return 'Complex(%r)' % (self.re,) else: ! return 'Complex(%r, %r)' % (self.re, self.im) def __str__(self): if not self.im: ! return repr(self.re) else: ! return 'Complex(%r, %r)' % (self.re, self.im) def __neg__(self): Index: Dates.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/classes/Dates.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Dates.py 7 Jun 2003 19:39:56 -0000 1.4 --- Dates.py 12 Feb 2004 17:35:01 -0000 1.5 *************** *** 87,91 **** def _num2date( n ): # return date with ordinal n if type(n) not in _INT_TYPES: ! raise TypeError, 'argument must be integer: ' + `type(n)` ans = Date(1,1,1) # arguments irrelevant; just getting a Date obj --- 87,91 ---- def _num2date( n ): # return date with ordinal n if type(n) not in _INT_TYPES: ! raise TypeError, 'argument must be integer: %r' % type(n) ans = Date(1,1,1) # arguments irrelevant; just getting a Date obj *************** *** 121,128 **** def __init__( self, month, day, year ): if not 1 <= month <= 12: ! raise ValueError, 'month must be in 1..12: ' + `month` dim = _days_in_month( month, year ) if not 1 <= day <= dim: ! raise ValueError, 'day must be in 1..' + `dim` + ': ' + `day` self.month, self.day, self.year = month, day, year self.ord = _date2num( self ) --- 121,128 ---- def __init__( self, month, day, year ): if not 1 <= month <= 12: ! raise ValueError, 'month must be in 1..12: %r' % (month,) dim = _days_in_month( month, year ) if not 1 <= day <= dim: ! raise ValueError, 'day must be in 1..%r: %r' % (dim, day) self.month, self.day, self.year = month, day, year self.ord = _date2num( self ) *************** *** 143,155 **** # print as, e.g., Mon 16 Aug 1993 def __repr__( self ): ! return '%.3s %2d %.3s ' % ( self.weekday(), self.day, ! _MONTH_NAMES[self.month-1] ) + `self.year` # Python 1.1 coerces neither int+date nor date+int def __add__( self, n ): if type(n) not in _INT_TYPES: ! raise TypeError, 'can\'t add ' + `type(n)` + ' to date' return _num2date( self.ord + n ) __radd__ = __add__ # handle int+date --- 143,156 ---- # print as, e.g., Mon 16 Aug 1993 def __repr__( self ): ! return '%.3s %2d %.3s %r' % ( self.weekday(), self.day, ! _MONTH_NAMES[self.month-1], ! self.year) # Python 1.1 coerces neither int+date nor date+int def __add__( self, n ): if type(n) not in _INT_TYPES: ! raise TypeError, 'can\'t add %r to date' % type(n) return _num2date( self.ord + n ) __radd__ = __add__ # handle int+date *************** *** 178,182 **** a = Date(9,30,1913) b = Date(9,30,1914) ! if `a` != 'Tue 30 Sep 1913': raise DateTestError, '__repr__ failure' if (not a < b) or a == b or a > b or b != b: --- 179,183 ---- a = Date(9,30,1913) b = Date(9,30,1914) ! if repr(a) != 'Tue 30 Sep 1913': raise DateTestError, '__repr__ failure' if (not a < b) or a == b or a > b or b != b: Index: Dbm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/classes/Dbm.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Dbm.py 24 Apr 2003 17:08:23 -0000 1.4 --- Dbm.py 12 Feb 2004 17:35:01 -0000 1.5 *************** *** 14,18 **** s = '' for key in self.keys(): ! t = `key` + ': ' + `self[key]` if s: t = ', ' + t s = s + t --- 14,18 ---- s = '' for key in self.keys(): ! t = repr(key) + ': ' + repr(self[key]) if s: t = ', ' + t s = s + t *************** *** 23,33 **** def __getitem__(self, key): ! return eval(self.db[`key`]) def __setitem__(self, key, value): ! self.db[`key`] = `value` def __delitem__(self, key): ! del self.db[`key`] def keys(self): --- 23,33 ---- def __getitem__(self, key): ! return eval(self.db[repr(key)]) def __setitem__(self, key, value): ! self.db[repr(key)] = repr(value) def __delitem__(self, key): ! del self.db[repr(key)] def keys(self): *************** *** 38,42 **** def has_key(self, key): ! return self.db.has_key(`key`) --- 38,42 ---- def has_key(self, key): ! return self.db.has_key(repr(key)) Index: Range.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/classes/Range.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Range.py 24 Apr 2003 17:08:23 -0000 1.5 --- Range.py 12 Feb 2004 17:35:01 -0000 1.6 *************** *** 35,41 **** self.len = max(0, int((self.stop - self.start) / self.step)) ! # implement `x` and is also used by print x def __repr__(self): ! return 'range' + `self.start, self.stop, self.step` # implement len(x) --- 35,41 ---- self.len = max(0, int((self.stop - self.start) / self.step)) ! # implement repr(x) and is also used by print x def __repr__(self): ! return 'range(%r, %r, %r)' % (self.start, self.stop, self.step) # implement len(x) Index: bitvec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/classes/bitvec.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bitvec.py 24 Apr 2003 17:08:24 -0000 1.4 --- bitvec.py 12 Feb 2004 17:35:01 -0000 1.5 *************** *** 21,25 **** bitmask = 1L << l if bitmask <= param: ! raise 'FATAL', '(param, l) = ' + `param, l` while l: bitmask = bitmask >> 1 --- 21,25 ---- bitmask = 1L << l if bitmask <= param: ! raise 'FATAL', '(param, l) = %r' % ((param, l),) while l: bitmask = bitmask >> 1 *************** *** 168,175 **** def __repr__(self): ##rprt('.' + '__repr__()\n') ! return 'bitvec' + `self._data, self._len` def __cmp__(self, other, *rest): ! #rprt(`self`+'.__cmp__'+`(other, ) + rest`+'\n') if type(other) != type(self): other = apply(bitvec, (other, ) + rest) --- 168,175 ---- def __repr__(self): ##rprt('.' + '__repr__()\n') ! return 'bitvec(%r, %r)' % (self._data, self._len) def __cmp__(self, other, *rest): ! #rprt('%r.__cmp__%r\n' % (self, (other,) + rest)) if type(other) != type(self): other = apply(bitvec, (other, ) + rest) *************** *** 194,207 **** def __len__(self): ! #rprt(`self`+'.__len__()\n') return self._len def __getitem__(self, key): ! #rprt(`self`+'.__getitem__('+`key`+')\n') key = _check_key(self._len, key) return self._data & (1L << key) != 0 def __setitem__(self, key, value): ! #rprt(`self`+'.__setitem__'+`key, value`+'\n') key = _check_key(self._len, key) #_check_value(value) --- 194,207 ---- def __len__(self): ! #rprt('%r.__len__()\n' % (self,)) return self._len def __getitem__(self, key): ! #rprt('%r.__getitem__(%r)\n' % (self, key)) key = _check_key(self._len, key) return self._data & (1L << key) != 0 def __setitem__(self, key, value): ! #rprt('%r.__setitem__(%r, %r)\n' % (self, key, value)) key = _check_key(self._len, key) #_check_value(value) *************** *** 212,216 **** def __delitem__(self, key): ! #rprt(`self`+'.__delitem__('+`key`+')\n') key = _check_key(self._len, key) #el cheapo solution... --- 212,216 ---- def __delitem__(self, key): ! #rprt('%r.__delitem__(%r)\n' % (self, key)) key = _check_key(self._len, key) #el cheapo solution... *************** *** 219,223 **** def __getslice__(self, i, j): ! #rprt(`self`+'.__getslice__'+`i, j`+'\n') i, j = _check_slice(self._len, i, j) if i >= j: --- 219,223 ---- def __getslice__(self, i, j): ! #rprt('%r.__getslice__(%r, %r)\n' % (self, i, j)) i, j = _check_slice(self._len, i, j) if i >= j: *************** *** 235,239 **** def __setslice__(self, i, j, sequence, *rest): ! #rprt(`self`+'.__setslice__'+`(i, j, sequence) + rest`+'\n') i, j = _check_slice(self._len, i, j) if type(sequence) != type(self): --- 235,239 ---- def __setslice__(self, i, j, sequence, *rest): ! #rprt('%s.__setslice__%r\n' % (self, (i, j, sequence) + rest)) i, j = _check_slice(self._len, i, j) if type(sequence) != type(self): *************** *** 248,252 **** def __delslice__(self, i, j): ! #rprt(`self`+'.__delslice__'+`i, j`+'\n') i, j = _check_slice(self._len, i, j) if i == 0 and j == self._len: --- 248,252 ---- def __delslice__(self, i, j): ! #rprt('%r.__delslice__(%r, %r)\n' % (self, i, j)) i, j = _check_slice(self._len, i, j) if i == 0 and j == self._len: *************** *** 257,261 **** def __add__(self, other): ! #rprt(`self`+'.__add__('+`other`+')\n') retval = self.copy() retval[self._len:self._len] = other --- 257,261 ---- def __add__(self, other): ! #rprt('%r.__add__(%r)\n' % (self, other)) retval = self.copy() retval[self._len:self._len] = other *************** *** 263,267 **** def __mul__(self, multiplier): ! #rprt(`self`+'.__mul__('+`multiplier`+')\n') if type(multiplier) != type(0): raise TypeError, 'sequence subscript not int' --- 263,267 ---- def __mul__(self, multiplier): ! #rprt('%r.__mul__(%r)\n' % (self, multiplier)) if type(multiplier) != type(0): raise TypeError, 'sequence subscript not int' *************** *** 282,286 **** def __and__(self, otherseq, *rest): ! #rprt(`self`+'.__and__'+`(otherseq, ) + rest`+'\n') if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) --- 282,286 ---- def __and__(self, otherseq, *rest): ! #rprt('%r.__and__%r\n' % (self, (otherseq,) + rest)) if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) *************** *** 291,295 **** def __xor__(self, otherseq, *rest): ! #rprt(`self`+'.__xor__'+`(otherseq, ) + rest`+'\n') if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) --- 291,295 ---- def __xor__(self, otherseq, *rest): ! #rprt('%r.__xor__%r\n' % (self, (otherseq,) + rest)) if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) *************** *** 300,304 **** def __or__(self, otherseq, *rest): ! #rprt(`self`+'.__or__'+`(otherseq, ) + rest`+'\n') if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) --- 300,304 ---- def __or__(self, otherseq, *rest): ! #rprt('%r.__or__%r\n' % (self, (otherseq,) + rest)) if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) *************** *** 309,313 **** def __invert__(self): ! #rprt(`self`+'.__invert__()\n') return BitVec(~self._data & ((1L << self._len) - 1), \ self._len) --- 309,313 ---- def __invert__(self): ! #rprt('%r.__invert__()\n' % (self,)) return BitVec(~self._data & ((1L << self._len) - 1), \ self._len) *************** *** 315,319 **** def __coerce__(self, otherseq, *rest): #needed for *some* of the arithmetic operations ! #rprt(`self`+'.__coerce__'+`(otherseq, ) + rest`+'\n') if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) --- 315,319 ---- def __coerce__(self, otherseq, *rest): #needed for *some* of the arithmetic operations ! #rprt('%r.__coerce__%r\n' % (self, (otherseq,) + rest)) if type(otherseq) != type(self): otherseq = apply(bitvec, (otherseq, ) + rest) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:37 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:39:57 2004 Subject: [Python-checkins] python/dist/src/Doc/lib caseless.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Doc/lib Modified Files: caseless.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: caseless.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/caseless.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** caseless.py 6 Jan 2003 16:51:33 -0000 1.1 --- caseless.py 12 Feb 2004 17:35:05 -0000 1.2 *************** *** 48,55 **** parser.add_option("-f", "--file", dest="file") ! #print `parser.get_option("-f")` ! #print `parser.get_option("-F")` ! #print `parser.get_option("--file")` ! #print `parser.get_option("--fIlE")` (options, args) = parser.parse_args(["--FiLe", "foo"]) assert options.file == "foo", options.file --- 48,55 ---- parser.add_option("-f", "--file", dest="file") ! #print repr(parser.get_option("-f")) ! #print repr(parser.get_option("-F")) ! #print repr(parser.get_option("--file")) ! #print repr(parser.get_option("--fIlE")) (options, args) = parser.parse_args(["--FiLe", "foo"]) assert options.file == "foo", options.file From doerwalter at users.sourceforge.net Thu Feb 12 12:35:36 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:00 2004 Subject: [Python-checkins] python/dist/src/Demo/sockets broadcast.py, 1.4, 1.5 ftp.py, 1.5, 1.6 gopher.py, 1.4, 1.5 mcast.py, 1.9, 1.10 radio.py, 1.3, 1.4 telnet.py, 1.5, 1.6 udpecho.py, 1.5, 1.6 unicast.py, 1.1, 1.2 unixclient.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/sockets Modified Files: broadcast.py ftp.py gopher.py mcast.py radio.py telnet.py udpecho.py unicast.py unixclient.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: broadcast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/broadcast.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** broadcast.py 4 Mar 1995 22:57:55 -0000 1.4 --- broadcast.py 12 Feb 2004 17:35:03 -0000 1.5 *************** *** 11,15 **** while 1: ! data = `time.time()` + '\n' s.sendto(data, ('', MYPORT)) time.sleep(2) --- 11,15 ---- while 1: ! data = repr(time.time()) + '\n' s.sendto(data, ('', MYPORT)) time.sleep(2) Index: ftp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/ftp.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ftp.py 25 Aug 2000 15:38:41 -0000 1.5 --- ftp.py 12 Feb 2004 17:35:03 -0000 1.6 *************** *** 92,96 **** hostaddr = gethostbyname(hostname) hbytes = string.splitfields(hostaddr, '.') ! pbytes = [`port/256`, `port%256`] bytes = hbytes + pbytes cmd = 'PORT ' + string.joinfields(bytes, ',') --- 92,96 ---- hostaddr = gethostbyname(hostname) hbytes = string.splitfields(hostaddr, '.') ! pbytes = [repr(port/256), repr(port%256)] bytes = hbytes + pbytes cmd = 'PORT ' + string.joinfields(bytes, ',') Index: gopher.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/gopher.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gopher.py 27 Nov 1996 19:50:41 -0000 1.4 --- gopher.py 12 Feb 2004 17:35:03 -0000 1.5 *************** *** 76,83 **** parts = string.splitfields(line[1:], TAB) if len(parts) < 4: ! print '(Bad line from server:', `line`, ')' continue if len(parts) > 4: ! print '(Extra info from server:', parts[4:], ')' parts.insert(0, typechar) list.append(parts) --- 76,83 ---- parts = string.splitfields(line[1:], TAB) if len(parts) < 4: ! print '(Bad line from server: %r)' % (line,) continue if len(parts) > 4: ! print '(Extra info from server: %r)' % (parts[4:],) parts.insert(0, typechar) list.append(parts) *************** *** 155,159 **** while 1: print '----- MENU -----' ! print 'Selector:', `selector` print 'Host:', host, ' Port:', port print --- 155,159 ---- while 1: print '----- MENU -----' ! print 'Selector:', repr(selector) print 'Host:', host, ' Port:', port print *************** *** 161,169 **** item = list[i] typechar, description = item[0], item[1] ! print string.rjust(`i+1`, 3) + ':', description, if typename.has_key(typechar): print typename[typechar] else: ! print '' print while 1: --- 161,169 ---- item = list[i] typechar, description = item[0], item[1] ! print string.rjust(repr(i+1), 3) + ':', description, if typename.has_key(typechar): print typename[typechar] else: ! print '' print while 1: *************** *** 222,226 **** while 1: print '----- SEARCH -----' ! print 'Selector:', `selector` print 'Host:', host, ' Port:', port print --- 222,226 ---- while 1: print '----- SEARCH -----' ! print 'Selector:', repr(selector) print 'Host:', host, ' Port:', port print *************** *** 241,247 **** def browse_telnet(selector, host, port): if selector: ! print 'Log in as', `selector` if type(port) <> type(''): ! port = `port` sts = os.system('set -x; exec telnet ' + host + ' ' + port) if sts: --- 241,247 ---- def browse_telnet(selector, host, port): if selector: ! print 'Log in as', repr(selector) if type(port) <> type(''): ! port = repr(port) sts = os.system('set -x; exec telnet ' + host + ' ' + port) if sts: *************** *** 308,314 **** p = os.popen(cmd, 'w') except IOError, msg: ! print `cmd`, ':', msg return None ! print 'Piping through', `cmd`, '...' return p if savefile[0] == '~': --- 308,314 ---- p = os.popen(cmd, 'w') except IOError, msg: ! print repr(cmd), ':', msg return None ! print 'Piping through', repr(cmd), '...' return p if savefile[0] == '~': *************** *** 317,323 **** f = open(savefile, 'w') except IOError, msg: ! print `savefile`, ':', msg return None ! print 'Saving to', `savefile`, '...' return f --- 317,323 ---- f = open(savefile, 'w') except IOError, msg: ! print repr(savefile), ':', msg return None ! print 'Saving to', repr(savefile), '...' return f Index: mcast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/mcast.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mcast.py 7 Aug 1999 14:01:05 -0000 1.9 --- mcast.py 12 Feb 2004 17:35:03 -0000 1.10 *************** *** 39,43 **** s.setsockopt(IPPROTO_IP, IP_MULTICAST_TTL, ttl) while 1: ! data = `time.time()` ## data = data + (1400 - len(data)) * '\0' s.sendto(data, (mygroup, MYPORT)) --- 39,43 ---- s.setsockopt(IPPROTO_IP, IP_MULTICAST_TTL, ttl) while 1: ! data = repr(time.time()) ## data = data + (1400 - len(data)) * '\0' s.sendto(data, (mygroup, MYPORT)) *************** *** 54,58 **** data, sender = s.recvfrom(1500) while data[-1:] == '\0': data = data[:-1] # Strip trailing \0's ! print sender, ':', `data` --- 54,58 ---- data, sender = s.recvfrom(1500) while data[-1:] == '\0': data = data[:-1] # Strip trailing \0's ! print sender, ':', repr(data) Index: radio.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/radio.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** radio.py 8 Oct 1994 19:13:48 -0000 1.3 --- radio.py 12 Feb 2004 17:35:03 -0000 1.4 *************** *** 11,14 **** while 1: data, wherefrom = s.recvfrom(1500, 0) ! sys.stderr.write(`wherefrom` + '\n') sys.stdout.write(data) --- 11,14 ---- while 1: data, wherefrom = s.recvfrom(1500, 0) ! sys.stderr.write(repr(wherefrom) + '\n') sys.stdout.write(data) Index: telnet.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/telnet.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** telnet.py 25 Aug 2000 15:38:41 -0000 1.5 --- telnet.py 12 Feb 2004 17:35:03 -0000 1.6 *************** *** 54,58 **** s.connect((host, port)) except error, msg: ! sys.stderr.write('connect failed: ' + `msg` + '\n') sys.exit(1) # --- 54,58 ---- s.connect((host, port)) except error, msg: ! sys.stderr.write('connect failed: ' + repr(msg) + '\n') sys.exit(1) # Index: udpecho.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/udpecho.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** udpecho.py 25 Aug 2000 15:38:41 -0000 1.5 --- udpecho.py 12 Feb 2004 17:35:03 -0000 1.6 *************** *** 38,42 **** while 1: data, addr = s.recvfrom(BUFSIZE) ! print 'server received', `data`, 'from', `addr` s.sendto(data, addr) --- 38,42 ---- while 1: data, addr = s.recvfrom(BUFSIZE) ! print 'server received %r from %r' % (data, addr) s.sendto(data, addr) *************** *** 59,63 **** s.sendto(line, addr) data, fromaddr = s.recvfrom(BUFSIZE) ! print 'client received', `data`, 'from', `fromaddr` main() --- 59,63 ---- s.sendto(line, addr) data, fromaddr = s.recvfrom(BUFSIZE) ! print 'client received %r from %r' % (data, fromaddr) main() Index: unicast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/unicast.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** unicast.py 21 Aug 1996 20:11:55 -0000 1.1 --- unicast.py 12 Feb 2004 17:35:03 -0000 1.2 *************** *** 10,14 **** while 1: ! data = `time.time()` + '\n' s.sendto(data, ('', MYPORT)) time.sleep(2) --- 10,14 ---- while 1: ! data = repr(time.time()) + '\n' s.sendto(data, ('', MYPORT)) time.sleep(2) Index: unixclient.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/sockets/unixclient.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** unixclient.py 28 Jan 1998 16:53:57 -0000 1.1 --- unixclient.py 12 Feb 2004 17:35:03 -0000 1.2 *************** *** 8,10 **** data = s.recv(1024) s.close() ! print 'Received', `data` --- 8,10 ---- data = s.recv(1024) s.close() ! print 'Received', repr(data) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:38 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:03 2004 Subject: [Python-checkins] python/dist/src/Doc/tools/sgmlconv esistools.py, 1.9, 1.10 latex2esis.py, 1.31, 1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Doc/tools/sgmlconv Modified Files: esistools.py latex2esis.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: esistools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/esistools.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** esistools.py 16 Oct 2002 16:02:08 -0000 1.9 --- esistools.py 12 Feb 2004 17:35:05 -0000 1.10 *************** *** 30,34 **** r = r + unichr(int(n)) else: ! raise ValueError, "can't handle " + `s` return r --- 30,34 ---- r = r + unichr(int(n)) else: ! raise ValueError, "can't handle %r" % s return r *************** *** 221,226 **** else: ! raise xml.sax.SAXNotRecognizedException("unknown property %s" ! % `property`) def setProperty(self, property, value): --- 221,226 ---- else: ! raise xml.sax.SAXNotRecognizedException("unknown property %r" ! % (property, )) def setProperty(self, property, value): Index: latex2esis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/latex2esis.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** latex2esis.py 16 Oct 2002 16:00:42 -0000 1.31 --- latex2esis.py 12 Feb 2004 17:35:05 -0000 1.32 *************** *** 74,79 **** def append(self, entry): if not isinstance(entry, str): ! raise LaTeXFormatError("cannot push non-string on stack: " ! + `entry`) #dbgmsg("%s<%s>" % (" "*len(self.data), entry)) list.append(self, entry) --- 74,79 ---- def append(self, entry): if not isinstance(entry, str): ! raise LaTeXFormatError("cannot push non-string on stack: %r" ! % (entry, )) #dbgmsg("%s<%s>" % (" "*len(self.data), entry)) list.append(self, entry) *************** *** 209,214 **** if not m: raise LaTeXFormatError( ! "could not extract parameter %s for %s: %s" ! % (pentry.name, macroname, `line[:100]`)) if entry.outputname: self.dump_attr(pentry, m.group(1)) --- 209,214 ---- if not m: raise LaTeXFormatError( ! "could not extract parameter %s for %s: %r" ! % (pentry.name, macroname, line[:100])) if entry.outputname: self.dump_attr(pentry, m.group(1)) *************** *** 260,264 **** stack.append(entry.name) self.write("(%s\n" % entry.outputname) ! #dbgmsg("--- text: %s" % `pentry.text`) self.write("-%s\n" % encode(pentry.text)) elif pentry.type == "entityref": --- 260,264 ---- stack.append(entry.name) self.write("(%s\n" % entry.outputname) ! #dbgmsg("--- text: %r" % pentry.text) self.write("-%s\n" % encode(pentry.text)) elif pentry.type == "entityref": *************** *** 327,332 **** if len(line) > 100: extra = "..." ! raise LaTeXFormatError("could not identify markup: %s%s" ! % (`line[:100]`, extra)) while stack: entry = self.get_entry(stack[-1]) --- 327,332 ---- if len(line) > 100: extra = "..." ! raise LaTeXFormatError("could not identify markup: %r%s" ! % (line[:100], extra)) while stack: entry = self.get_entry(stack[-1]) *************** *** 362,366 **** entry = self.table.get(name) if entry is None: ! dbgmsg("get_entry(%s) failing; building default entry!" % `name`) # not defined; build a default entry: entry = TableEntry(name) --- 362,366 ---- entry = self.table.get(name) if entry is None: ! dbgmsg("get_entry(%r) failing; building default entry!" % (name, )) # not defined; build a default entry: entry = TableEntry(name) *************** *** 487,491 **** name = self.__current.name if self.__table.has_key(name): ! raise ValueError("name %s already in use" % `name`) self.__table[name] = self.__current self.__current = None --- 487,491 ---- name = self.__current.name if self.__table.has_key(name): ! raise ValueError("name %r already in use" % (name,)) self.__table[name] = self.__current self.__current = None From doerwalter at users.sourceforge.net Thu Feb 12 12:35:36 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:06 2004 Subject: [Python-checkins] python/dist/src/Demo/scripts eqfix.py, 1.7, 1.8 from.py, 1.8, 1.9 ftpstats.py, 1.3, 1.4 lpwatch.py, 1.7, 1.8 markov.py, 1.3, 1.4 mboxconvert.py, 1.4, 1.5 mkrcs.py, 1.4, 1.5 mpzpi.py, 1.4, 1.5 newslist.py, 1.10, 1.11 pp.py, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/scripts Modified Files: eqfix.py from.py ftpstats.py lpwatch.py markov.py mboxconvert.py mkrcs.py mpzpi.py newslist.py pp.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: eqfix.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/eqfix.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** eqfix.py 27 Nov 1996 19:46:46 -0000 1.7 --- eqfix.py 12 Feb 2004 17:35:02 -0000 1.8 *************** *** 59,68 **** def recursedown(dirname): ! dbg('recursedown(' + `dirname` + ')\n') bad = 0 try: names = os.listdir(dirname) except os.error, msg: ! err(dirname + ': cannot list directory: ' + `msg` + '\n') return 1 names.sort() --- 59,68 ---- def recursedown(dirname): ! dbg('recursedown(%r)\n' % (dirname,)) bad = 0 try: names = os.listdir(dirname) except os.error, msg: ! err('%s: cannot list directory: %r\n' % (dirname, msg)) return 1 names.sort() *************** *** 81,89 **** def fix(filename): ! ## dbg('fix(' + `filename` + ')\n') try: f = open(filename, 'r') except IOError, msg: ! err(filename + ': cannot open: ' + `msg` + '\n') return 1 head, tail = os.path.split(filename) --- 81,89 ---- def fix(filename): ! ## dbg('fix(%r)\n' % (dirname,)) try: f = open(filename, 'r') except IOError, msg: ! err('%s: cannot open: %r\n' % (filename, msg)) return 1 head, tail = os.path.split(filename) *************** *** 123,128 **** except IOError, msg: f.close() ! err(tempname+': cannot create: '+\ ! `msg`+'\n') return 1 f.seek(0) --- 123,127 ---- except IOError, msg: f.close() ! err('%s: cannot create: %r\n' % (tempname, msg)) return 1 f.seek(0) *************** *** 130,134 **** rep(filename + ':\n') continue # restart from the beginning ! rep(`lineno` + '\n') rep('< ' + line) rep('> ' + newline) --- 129,133 ---- rep(filename + ':\n') continue # restart from the beginning ! rep(repr(lineno) + '\n') rep('< ' + line) rep('> ' + newline) *************** *** 147,161 **** os.chmod(tempname, statbuf[ST_MODE] & 07777) except os.error, msg: ! err(tempname + ': warning: chmod failed (' + `msg` + ')\n') # Then make a backup of the original file as filename~ try: os.rename(filename, filename + '~') except os.error, msg: ! err(filename + ': warning: backup failed (' + `msg` + ')\n') # Now move the temp file to the original file try: os.rename(tempname, filename) except os.error, msg: ! err(filename + ': rename failed (' + `msg` + ')\n') return 1 # Return succes --- 146,160 ---- os.chmod(tempname, statbuf[ST_MODE] & 07777) except os.error, msg: ! err('%s: warning: chmod failed (%r)\n' % (tempname, msg)) # Then make a backup of the original file as filename~ try: os.rename(filename, filename + '~') except os.error, msg: ! err('%s: warning: backup failed (%r)\n' % (filename, msg)) # Now move the temp file to the original file try: os.rename(tempname, filename) except os.error, msg: ! err('%s: rename failed (%r)\n' % (filename, msg)) return 1 # Return succes Index: from.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/from.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** from.py 20 Feb 2001 16:21:35 -0000 1.8 --- from.py 12 Feb 2004 17:35:03 -0000 1.9 *************** *** 32,35 **** break if line.startswith('Subject: '): ! print `line[9:-1]`, print --- 32,35 ---- break if line.startswith('Subject: '): ! print repr(line[9:-1]), print Index: ftpstats.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/ftpstats.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ftpstats.py 14 Sep 1998 16:44:00 -0000 1.3 --- ftpstats.py 12 Feb 2004 17:35:03 -0000 1.4 *************** *** 61,65 **** continue if prog.match(line) < 0: ! print 'Bad line', lineno, ':', `line` continue items = prog.group(1, 2, 3, 4, 5, 6) --- 61,65 ---- continue if prog.match(line) < 0: ! print 'Bad line', lineno, ':', repr(line) continue items = prog.group(1, 2, 3, 4, 5, 6) Index: lpwatch.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/lpwatch.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** lpwatch.py 27 Nov 1996 19:46:53 -0000 1.7 --- lpwatch.py 12 Feb 2004 17:35:03 -0000 1.8 *************** *** 84,105 **** # if totaljobs: ! line = `(totalbytes+1023)/1024` + ' K' if totaljobs <> len(users): ! line = line + ' (' + `totaljobs` + ' jobs)' if len(users) == 1: ! line = line + ' for ' + users.keys()[0] else: ! line = line + ' for ' + `len(users)` + ' users' if userseen: if aheadjobs == 0: ! line = line + ' (' + thisuser + ' first)' else: ! line = line + ' (' + `(aheadbytes+1023)/1024` ! line = line + ' K before ' + thisuser + ')' lines.append(line) # sts = pipe.close() if sts: ! lines.append('lpq exit status ' + `sts`) return string.joinfields(lines, ': ') --- 84,105 ---- # if totaljobs: ! line = '%d K' % ((totalbytes+1023)/1024) if totaljobs <> len(users): ! line = line + ' (%d jobs)' % totaljobs if len(users) == 1: ! line = line + ' for %s' % (users.keys()[0],) else: ! line = line + ' for %d users' % len(users) if userseen: if aheadjobs == 0: ! line = line + ' (%s first)' % thisuser else: ! line = line + ' (%d K before %s)' % ( ! (aheadbytes+1023)/1024, thisuser) lines.append(line) # sts = pipe.close() if sts: ! lines.append('lpq exit status %r' % (sts,)) return string.joinfields(lines, ': ') Index: markov.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/markov.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** markov.py 20 May 1998 17:11:46 -0000 1.3 --- markov.py 12 Feb 2004 17:35:03 -0000 1.4 *************** *** 90,95 **** for key in m.trans.keys(): if key is None or len(key) < histsize: ! print `key`, m.trans[key] ! if histsize == 0: print `''`, m.trans[''] print while 1: --- 90,95 ---- for key in m.trans.keys(): if key is None or len(key) < histsize: ! print repr(key), m.trans[key] ! if histsize == 0: print repr(''), m.trans[''] print while 1: Index: mboxconvert.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/mboxconvert.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mboxconvert.py 27 Nov 1996 19:46:57 -0000 1.4 --- mboxconvert.py 12 Feb 2004 17:35:03 -0000 1.5 *************** *** 74,78 **** else: sys.stderr.write( ! 'Bad line in MMFD mailbox: %s\n' % `line`) return sts --- 74,78 ---- else: sys.stderr.write( ! 'Bad line in MMFD mailbox: %r\n' % (line,)) return sts *************** *** 90,94 **** else: sys.stderr.write( ! 'Unparseable date: %s\n' % `m.getheader('Date')`) t = os.fstat(f.fileno())[stat.ST_MTIME] print 'From', email, time.ctime(t) --- 90,94 ---- else: sys.stderr.write( ! 'Unparseable date: %r\n' % (m.getheader('Date'),)) t = os.fstat(f.fileno())[stat.ST_MTIME] print 'From', email, time.ctime(t) Index: mkrcs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/mkrcs.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mkrcs.py 27 Nov 1996 19:46:59 -0000 1.4 --- mkrcs.py 12 Feb 2004 17:35:03 -0000 1.5 *************** *** 13,23 **** rcs = 'RCS' if os.path.islink(rcs): ! print `rcs`, 'is a symlink to', `os.readlink(rcs)` return if os.path.isdir(rcs): ! print `rcs`, 'is an ordinary directory' return if os.path.exists(rcs): ! print `rcs`, 'is a file?!?!' return # --- 13,23 ---- rcs = 'RCS' if os.path.islink(rcs): ! print '%r is a symlink to %r' % (rcs, os.readlink(rcs)) return if os.path.isdir(rcs): ! print '%r is an ordinary directory' % (rcs,) return if os.path.exists(rcs): ! print '%r is a file?!?!' % (rcs,) return # *************** *** 30,53 **** # Ergo: # (3) join(up, down) is the current directory ! #print 'p =', `p` while not os.path.isdir(os.path.join(p, rcstree)): head, tail = os.path.split(p) ! #print 'head =', `head`, '; tail =', `tail` if not tail: ! print 'Sorry, no ancestor dir contains', `rcstree` return p = head up = os.path.join(os.pardir, up) down = os.path.join(tail, down) ! #print 'p =', `p`, '; up =', `up`, '; down =', `down` there = os.path.join(up, rcstree) there = os.path.join(there, down) there = os.path.join(there, rcs) if os.path.isdir(there): ! print `there`, 'already exists' else: ! print 'making', `there` makedirs(there) ! print 'making symlink', `rcs`, '->', `there` os.symlink(there, rcs) --- 30,53 ---- # Ergo: # (3) join(up, down) is the current directory ! #print 'p =', repr(p) while not os.path.isdir(os.path.join(p, rcstree)): head, tail = os.path.split(p) ! #print 'head = %r; tail = %r' % (head, tail) if not tail: ! print 'Sorry, no ancestor dir contains %r' % (rcstree,) return p = head up = os.path.join(os.pardir, up) down = os.path.join(tail, down) ! #print 'p = %r; up = %r; down = %r' % (p, up, down) there = os.path.join(up, rcstree) there = os.path.join(there, down) there = os.path.join(there, rcs) if os.path.isdir(there): ! print '%r already exists' % (there, ) else: ! print 'making %r' % (there,) makedirs(there) ! print 'making symlink %r -> %r' % (rcs, there) os.symlink(there, rcs) Index: mpzpi.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/mpzpi.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mpzpi.py 10 Dec 2003 15:22:23 -0000 1.4 --- mpzpi.py 12 Feb 2004 17:35:03 -0000 1.5 *************** *** 28,32 **** # Use write() to avoid spaces between the digits # Use int(d) to avoid a trailing L after each digit ! sys.stdout.write(`int(d)`) # Flush so the output is seen immediately sys.stdout.flush() --- 28,32 ---- # Use write() to avoid spaces between the digits # Use int(d) to avoid a trailing L after each digit ! sys.stdout.write(repr(int(d))) # Flush so the output is seen immediately sys.stdout.flush() Index: newslist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/newslist.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** newslist.py 14 Sep 1998 16:44:01 -0000 1.10 --- newslist.py 12 Feb 2004 17:35:03 -0000 1.11 *************** *** 305,309 **** print 'Getting list of new groups since start of '+treedate+'...', info = server.newgroups(treedate,'000001')[1] ! print 'got '+`len(info)`+'.' print 'Processing...', groups = [] --- 305,309 ---- print 'Getting list of new groups since start of '+treedate+'...', info = server.newgroups(treedate,'000001')[1] ! print 'got %d.' % len(info) print 'Processing...', groups = [] Index: pp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/scripts/pp.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pp.py 9 Aug 2002 16:38:32 -0000 1.5 --- pp.py 12 Feb 2004 17:35:03 -0000 1.6 *************** *** 126,130 **** if DFLAG: import pdb ! pdb.run('execfile(' + `tfn` + ')') else: execfile(tfn) --- 126,130 ---- if DFLAG: import pdb ! pdb.run('execfile(%r)' % (tfn,)) else: execfile(tfn) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:40 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:09 2004 Subject: [Python-checkins] python/dist/src/Lib/bsddb dbrecio.py, 1.2, 1.3 dbtables.py, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/bsddb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Lib/bsddb Modified Files: dbrecio.py dbtables.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: dbrecio.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/dbrecio.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dbrecio.py 30 Dec 2002 20:52:07 -0000 1.2 --- dbrecio.py 12 Feb 2004 17:35:08 -0000 1.3 *************** *** 165,172 **** f.write(lines[1]) f.seek(0) ! print 'First line =', `f.readline()` here = f.tell() line = f.readline() ! print 'Second line =', `line` f.seek(-len(line), 1) line2 = f.read(len(line)) --- 165,172 ---- f.write(lines[1]) f.seek(0) ! print 'First line =', repr(f.readline()) here = f.tell() line = f.readline() ! print 'Second line =', repr(line) f.seek(-len(line), 1) line2 = f.read(len(line)) Index: dbtables.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/dbtables.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dbtables.py 21 Sep 2003 00:08:14 -0000 1.9 --- dbtables.py 12 Feb 2004 17:35:08 -0000 1.10 *************** *** 207,211 **** key, data = cur.first() while 1: ! print `{key: data}` next = cur.next() if next: --- 207,211 ---- key, data = cur.first() while 1: ! print repr({key: data}) next = cur.next() if next: *************** *** 342,348 **** tcolpickles = self.db.get(_columns_key(table)) except DBNotFoundError: ! raise TableDBError, "unknown table: " + `table` if not tcolpickles: ! raise TableDBError, "unknown table: " + `table` self.__tablecolumns[table] = pickle.loads(tcolpickles) --- 342,348 ---- tcolpickles = self.db.get(_columns_key(table)) except DBNotFoundError: ! raise TableDBError, "unknown table: %r" % (table,) if not tcolpickles: ! raise TableDBError, "unknown table: %r" % (table,) self.__tablecolumns[table] = pickle.loads(tcolpickles) *************** *** 385,389 **** for column in rowdict.keys() : if not self.__tablecolumns[table].count(column): ! raise TableDBError, "unknown column: "+`column` # get a unique row identifier for this row --- 385,389 ---- for column in rowdict.keys() : if not self.__tablecolumns[table].count(column): ! raise TableDBError, "unknown column: %r" % (column,) # get a unique row identifier for this row *************** *** 536,540 **** for column in (columns + conditions.keys()): if not self.__tablecolumns[table].count(column): ! raise TableDBError, "unknown column: "+`column` # keyed on rows that match so far, containings dicts keyed on --- 536,540 ---- for column in (columns + conditions.keys()): if not self.__tablecolumns[table].count(column): ! raise TableDBError, "unknown column: %r" % (column,) # keyed on rows that match so far, containings dicts keyed on From doerwalter at users.sourceforge.net Thu Feb 12 12:35:36 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:13 2004 Subject: [Python-checkins] python/dist/src/Demo/tkinter/guido mbox.py, 1.4, 1.5 solitaire.py, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tkinter/guido In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Demo/tkinter/guido Modified Files: mbox.py solitaire.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: mbox.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tkinter/guido/mbox.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mbox.py 27 Nov 1996 19:51:29 -0000 1.4 --- mbox.py 12 Feb 2004 17:35:04 -0000 1.5 *************** *** 254,258 **** n = scanbox.size() for i in range(n): ! line = scanbox.get(`i`) if scanparser.match(line) >= 0: num = string.atoi(scanparser.group(1)) --- 254,258 ---- n = scanbox.size() for i in range(n): ! line = scanbox.get(repr(i)) if scanparser.match(line) >= 0: num = string.atoi(scanparser.group(1)) Index: solitaire.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tkinter/guido/solitaire.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** solitaire.py 30 Dec 1996 16:45:14 -0000 1.4 --- solitaire.py 12 Feb 2004 17:35:04 -0000 1.5 *************** *** 184,188 **** def __repr__(self): """Return a string for debug print statements.""" ! return "Card(%s, %s)" % (`self.suit`, `self.value`) def moveto(self, x, y): --- 184,188 ---- def __repr__(self): """Return a string for debug print statements.""" ! return "Card(%r, %r)" % (self.suit, self.value) def moveto(self, x, y): From doerwalter at users.sourceforge.net Thu Feb 12 12:35:41 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:16 2004 Subject: [Python-checkins] python/dist/src/Lib/bsddb/test test_associate.py, 1.6, 1.7 test_basics.py, 1.10, 1.11 test_dbtables.py, 1.6, 1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/bsddb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Lib/bsddb/test Modified Files: test_associate.py test_basics.py test_dbtables.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: test_associate.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/test/test_associate.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_associate.py 21 Sep 2003 00:08:14 -0000 1.6 --- test_associate.py 12 Feb 2004 17:35:08 -0000 1.7 *************** *** 201,205 **** assert type(priData) == type("") if verbose: ! print 'getGenre key:', `priKey`, 'data:', `priData` genre = string.split(priData, '|')[2] if genre == 'Blues': --- 201,205 ---- assert type(priData) == type("") if verbose: ! print 'getGenre key: %r data: %r' % (priKey, priData) genre = string.split(priData, '|')[2] if genre == 'Blues': *************** *** 243,247 **** assert type(priData) == type(()) if verbose: ! print 'getGenre key:', `priKey`, 'data:', `priData` genre = priData[2] if genre == 'Blues': --- 243,247 ---- assert type(priData) == type(()) if verbose: ! print 'getGenre key: %r data: %r' % (priKey, priData) genre = priData[2] if genre == 'Blues': Index: test_basics.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/test/test_basics.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_basics.py 13 Jan 2004 19:59:57 -0000 1.10 --- test_basics.py 12 Feb 2004 17:35:08 -0000 1.11 *************** *** 362,366 **** self.fail("expected exception") if n != None: ! self.fail("expected None: "+`n`) rec = c.get_both('0404', self.makeData('0404')) --- 362,366 ---- self.fail("expected exception") if n != None: ! self.fail("expected None: %r" % (n,)) rec = c.get_both('0404', self.makeData('0404')) *************** *** 376,380 **** self.fail("expected exception") if n != None: ! self.fail("expected None: "+`n`) if self.d.get_type() == db.DB_BTREE: --- 376,380 ---- self.fail("expected exception") if n != None: ! self.fail("expected None: %r" % (n,)) if self.d.get_type() == db.DB_BTREE: *************** *** 549,553 **** assert num >= 1, "truncate returned <= 0 on non-empty database" num = d.truncate() ! assert num == 0, "truncate on empty DB returned nonzero (%s)" % `num` #---------------------------------------------------------------------- --- 549,553 ---- assert num >= 1, "truncate returned <= 0 on non-empty database" num = d.truncate() ! assert num == 0, "truncate on empty DB returned nonzero (%r)" % (num,) #---------------------------------------------------------------------- *************** *** 675,679 **** assert num >= 1, "truncate returned <= 0 on non-empty database" num = d.truncate(txn) ! assert num == 0, "truncate on empty DB returned nonzero (%s)" % `num` txn.commit() --- 675,679 ---- assert num >= 1, "truncate returned <= 0 on non-empty database" num = d.truncate(txn) ! assert num == 0, "truncate on empty DB returned nonzero (%r)" % (num,) txn.commit() Index: test_dbtables.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/test/test_dbtables.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_dbtables.py 21 Sep 2003 00:08:14 -0000 1.6 --- test_dbtables.py 12 Feb 2004 17:35:08 -0000 1.7 *************** *** 110,114 **** else : if verbose: ! print "values=", `values` raise "Wrong values returned!" --- 110,114 ---- else : if verbose: ! print "values= %r" % (values,) raise "Wrong values returned!" From doerwalter at users.sourceforge.net Thu Feb 12 12:35:41 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:19 2004 Subject: [Python-checkins] python/dist/src/Lib/distutils cmd.py, 1.35, 1.36 core.py, 1.58, 1.59 dir_util.py, 1.12, 1.13 dist.py, 1.63, 1.64 fancy_getopt.py, 1.27, 1.28 util.py, 1.73, 1.74 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Lib/distutils Modified Files: cmd.py core.py dir_util.py dist.py fancy_getopt.py util.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: cmd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/cmd.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** cmd.py 20 Oct 2003 14:01:51 -0000 1.35 --- cmd.py 12 Feb 2004 17:35:08 -0000 1.36 *************** *** 254,259 **** if not ok: raise DistutilsOptionError, \ ! "'%s' must be a list of strings (got %s)" % \ ! (option, `val`) def _ensure_tested_string (self, option, tester, --- 254,259 ---- if not ok: raise DistutilsOptionError, \ ! "'%s' must be a list of strings (got %r)" % \ ! (option, val) def _ensure_tested_string (self, option, tester, Index: core.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/core.py,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** core.py 19 Feb 2003 14:16:00 -0000 1.58 --- core.py 12 Feb 2004 17:35:08 -0000 1.59 *************** *** 203,207 **** """ if stop_after not in ('init', 'config', 'commandline', 'run'): ! raise ValueError, "invalid value for 'stop_after': %s" % `stop_after` global _setup_stop_after, _setup_distribution --- 203,207 ---- """ if stop_after not in ('init', 'config', 'commandline', 'run'): ! raise ValueError, "invalid value for 'stop_after': %r" % (stop_after,) global _setup_stop_after, _setup_distribution Index: dir_util.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dir_util.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dir_util.py 26 Nov 2002 17:42:48 -0000 1.12 --- dir_util.py 12 Feb 2004 17:35:08 -0000 1.13 *************** *** 34,38 **** if type(name) is not StringType: raise DistutilsInternalError, \ ! "mkpath: 'name' must be a string (got %s)" % `name` # XXX what's the better way to handle verbosity? print as we create --- 34,38 ---- if type(name) is not StringType: raise DistutilsInternalError, \ ! "mkpath: 'name' must be a string (got %r)" % (name,) # XXX what's the better way to handle verbosity? print as we create Index: dist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dist.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** dist.py 3 Mar 2003 20:07:27 -0000 1.63 --- dist.py 12 Feb 2004 17:35:08 -0000 1.64 *************** *** 526,532 **** else: raise DistutilsClassError( ! "invalid help function %s for help option '%s': " "must be a callable object (function, etc.)" ! % (`func`, help_option)) if help_option_found: --- 526,532 ---- else: raise DistutilsClassError( ! "invalid help function %r for help option '%s': " "must be a callable object (function, etc.)" ! % (func, help_option)) if help_option_found: Index: fancy_getopt.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/fancy_getopt.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** fancy_getopt.py 19 Nov 2002 13:12:27 -0000 1.27 --- fancy_getopt.py 12 Feb 2004 17:35:08 -0000 1.28 *************** *** 163,167 **** # the option table is part of the code, so simply # assert that it is correct ! assert "invalid option tuple: %s" % `option` # Type- and value-check the option names --- 163,167 ---- # the option table is part of the code, so simply # assert that it is correct ! assert "invalid option tuple: %r" % (option,) # Type- and value-check the option names Index: util.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/util.py,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** util.py 6 Jan 2003 13:28:12 -0000 1.73 --- util.py 12 Feb 2004 17:35:08 -0000 1.74 *************** *** 286,290 **** """ if msg is None: ! msg = "%s%s" % (func.__name__, `args`) if msg[-2:] == ',)': # correct for singleton tuple msg = msg[0:-2] + ')' --- 286,290 ---- """ if msg is None: ! msg = "%s%r" % (func.__name__, args) if msg[-2:] == ',)': # correct for singleton tuple msg = msg[0:-2] + ')' *************** *** 308,312 **** return 0 else: ! raise ValueError, "invalid truth value %s" % `val` --- 308,312 ---- return 0 else: ! raise ValueError, "invalid truth value %r" % (val,) *************** *** 395,403 **** script.write(string.join(map(repr, py_files), ",\n") + "]\n") script.write(""" ! byte_compile(files, optimize=%s, force=%s, ! prefix=%s, base_dir=%s, ! verbose=%s, dry_run=0, direct=1) ! """ % (`optimize`, `force`, `prefix`, `base_dir`, `verbose`)) script.close() --- 395,403 ---- script.write(string.join(map(repr, py_files), ",\n") + "]\n") script.write(""" ! byte_compile(files, optimize=%r, force=%r, ! prefix=%r, base_dir=%r, ! verbose=%r, dry_run=0, direct=1) ! """ % (optimize, force, prefix, base_dir, verbose)) script.close() *************** *** 433,438 **** if file[:len(prefix)] != prefix: raise ValueError, \ ! ("invalid prefix: filename %s doesn't start with %s" ! % (`file`, `prefix`)) dfile = dfile[len(prefix):] if base_dir: --- 433,438 ---- if file[:len(prefix)] != prefix: raise ValueError, \ ! ("invalid prefix: filename %r doesn't start with %r" ! % (file, prefix)) dfile = dfile[len(prefix):] if base_dir: From doerwalter at users.sourceforge.net Thu Feb 12 12:35:42 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:22 2004 Subject: [Python-checkins] python/dist/src/Lib/lib-tk FileDialog.py, 1.9, 1.10 Tix.py, 1.16, 1.17 Tkinter.py, 1.177, 1.178 turtle.py, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Lib/lib-tk Modified Files: FileDialog.py Tix.py Tkinter.py turtle.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: FileDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/FileDialog.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FileDialog.py 21 Jan 2003 14:19:21 -0000 1.9 --- FileDialog.py 12 Feb 2004 17:35:09 -0000 1.10 *************** *** 245,249 **** d = Dialog(self.top, title="Overwrite Existing File Question", ! text="Overwrite existing file %s?" % `file`, bitmap='questhead', default=1, --- 245,249 ---- d = Dialog(self.top, title="Overwrite Existing File Question", ! text="Overwrite existing file %r?" % (file,), bitmap='questhead', default=1, Index: Tix.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tix.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Tix.py 6 Apr 2003 09:00:50 -0000 1.16 --- Tix.py 12 Feb 2004 17:35:09 -0000 1.17 *************** *** 375,381 **** return elif not isinstance(option, StringType): ! option = `option` if not isinstance(value, StringType): ! value = `value` names = self._subwidget_names() for name in names: --- 375,381 ---- return elif not isinstance(option, StringType): ! option = repr(option) if not isinstance(value, StringType): ! value = repr(value) names = self._subwidget_names() for name in names: Index: Tkinter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tkinter.py,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** Tkinter.py 1 Jul 2003 21:12:47 -0000 1.177 --- Tkinter.py 12 Feb 2004 17:35:09 -0000 1.178 *************** *** 178,182 **** self._master = master self._tk = master.tk ! self._name = 'PY_VAR' + `_varnum` _varnum = _varnum + 1 self.set(self._default) --- 178,182 ---- self._master = master self._tk = master.tk ! self._name = 'PY_VAR' + repr(_varnum) _varnum = _varnum + 1 self.set(self._default) *************** *** 1023,1027 **** be given which will be executed before FUNC.""" f = CallWrapper(func, subst, self).__call__ ! name = `id(f)` try: func = func.im_func --- 1023,1027 ---- be given which will be executed before FUNC.""" f = CallWrapper(func, subst, self).__call__ ! name = repr(id(f)) try: func = func.im_func *************** *** 1811,1815 **** del cnf['name'] if not name: ! name = `id(self)` self._name = name if master._w=='.': --- 1811,1815 ---- del cnf['name'] if not name: ! name = repr(id(self)) self._name = name if master._w=='.': *************** *** 1958,1964 **** def At(x, y=None): if y is None: ! return '@' + `x` else: ! return '@' + `x` + ',' + `y` class Canvas(Widget): --- 1958,1964 ---- def At(x, y=None): if y is None: ! return '@%r' % (x,) else: ! return '@%r,%r' % (x, y) class Canvas(Widget): *************** *** 3119,3123 **** if not name: Image._last_id += 1 ! name = "pyimage" +`Image._last_id` # tk itself would use image # The following is needed for systems where id(x) # can return a negative number, such as Linux/m68k: --- 3119,3123 ---- if not name: Image._last_id += 1 ! name = "pyimage%r" % (Image._last_id,) # tk itself would use image # The following is needed for systems where id(x) # can return a negative number, such as Linux/m68k: Index: turtle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/turtle.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** turtle.py 9 Jun 2003 08:50:57 -0000 1.11 --- turtle.py 12 Feb 2004 17:35:10 -0000 1.12 *************** *** 96,100 **** id = self._canvas.create_line(0, 0, 0, 0, fill=color) except Tkinter.TclError: ! raise Error, "bad color string: %s" % `color` self._set_color(color) return --- 96,100 ---- id = self._canvas.create_line(0, 0, 0, 0, fill=color) except Tkinter.TclError: ! raise Error, "bad color string: %r" % (color,) self._set_color(color) return *************** *** 102,111 **** r, g, b = color except: ! raise Error, "bad color sequence: %s" % `color` else: try: r, g, b = args except: ! raise Error, "bad color arguments: %s" % `args` assert 0 <= r <= 1 assert 0 <= g <= 1 --- 102,111 ---- r, g, b = color except: ! raise Error, "bad color sequence: %r" % (color,) else: try: r, g, b = args except: ! raise Error, "bad color arguments: %r" % (args,) assert 0 <= r <= 1 assert 0 <= g <= 1 *************** *** 241,250 **** x, y = args[0] except: ! raise Error, "bad point argument: %s" % `args[0]` else: try: x, y = args except: ! raise Error, "bad coordinates: %s" % `args[0]` x0, y0 = self._origin self._goto(x0+x, y0-y) --- 241,250 ---- x, y = args[0] except: ! raise Error, "bad point argument: %r" % (args[0],) else: try: x, y = args except: ! raise Error, "bad coordinates: %r" % (args[0],) x0, y0 = self._origin self._goto(x0+x, y0-y) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:43 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:25 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib ColorDelegator.py, 1.11, 1.12 EditorWindow.py, 1.54, 1.55 FileList.py, 1.6, 1.7 GrepDialog.py, 1.4, 1.5 ObjectBrowser.py, 1.4, 1.5 ParenMatch.py, 1.7, 1.8 PyShell.py, 1.85, 1.86 RemoteDebugger.py, 1.10, 1.11 ScriptBinding.py, 1.26, 1.27 TreeWidget.py, 1.7, 1.8 UndoDelegator.py, 1.4, 1.5 WidgetRedirector.py, 1.3, 1.4 aboutDialog.py, 1.14, 1.15 configDialog.py, 1.55, 1.56 configHandler.py, 1.32, 1.33 rpc.py, 1.28, 1.29 textView.py, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Lib/idlelib Modified Files: ColorDelegator.py EditorWindow.py FileList.py GrepDialog.py ObjectBrowser.py ParenMatch.py PyShell.py RemoteDebugger.py ScriptBinding.py TreeWidget.py UndoDelegator.py WidgetRedirector.py aboutDialog.py configDialog.py configHandler.py rpc.py textView.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: ColorDelegator.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/ColorDelegator.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ColorDelegator.py 9 Jul 2003 18:48:24 -0000 1.11 --- ColorDelegator.py 12 Feb 2004 17:35:08 -0000 1.12 *************** *** 183,187 **** ok = "SYNC" in self.tag_names(next + "-1c") line = self.get(mark, next) ! ##print head, "get", mark, next, "->", `line` if not line: return --- 183,187 ---- ok = "SYNC" in self.tag_names(next + "-1c") line = self.get(mark, next) ! ##print head, "get", mark, next, "->", repr(line) if not line: return Index: EditorWindow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/EditorWindow.py,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** EditorWindow.py 23 Sep 2003 20:53:10 -0000 1.54 --- EditorWindow.py 12 Feb 2004 17:35:08 -0000 1.55 *************** *** 762,766 **** self.load_extension(name) except: ! print "Failed to load extension", `name` import traceback traceback.print_exc() --- 762,766 ---- self.load_extension(name) except: ! print "Failed to load extension", repr(name) import traceback traceback.print_exc() *************** *** 938,942 **** self.context_use_ps1 = value else: ! raise KeyError, "bad option name: %s" % `key` # If ispythonsource and guess are true, guess a good value for --- 938,942 ---- self.context_use_ps1 = value else: ! raise KeyError, "bad option name: %r" % (key,) # If ispythonsource and guess are true, guess a good value for *************** *** 1072,1076 **** for context in self.num_context_lines: startat = max(lno - context, 1) ! startatindex = `startat` + ".0" rawtext = text.get(startatindex, "insert") y.set_str(rawtext) --- 1072,1076 ---- for context in self.num_context_lines: startat = max(lno - context, 1) ! startatindex = repr(startat) + ".0" rawtext = text.get(startatindex, "insert") y.set_str(rawtext) *************** *** 1104,1108 **** self.reindent_to(y.compute_backslash_indent()) else: ! assert 0, "bogus continuation type " + `c` return "break" --- 1104,1108 ---- self.reindent_to(y.compute_backslash_indent()) else: ! assert 0, "bogus continuation type %r" % (c,) return "break" *************** *** 1334,1338 **** return "" i = self.i = self.i + 1 ! mark = `i` + ".0" if self.text.compare(mark, ">=", "end"): return "" --- 1334,1338 ---- return "" i = self.i = self.i + 1 ! mark = repr(i) + ".0" if self.text.compare(mark, ">=", "end"): return "" Index: FileList.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/FileList.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileList.py 6 Jun 2003 21:58:38 -0000 1.6 --- FileList.py 12 Feb 2004 17:35:09 -0000 1.7 *************** *** 36,40 **** tkMessageBox.showerror( "Is A Directory", ! "The path %s is a directory." % `filename`, master=self.root) return None --- 36,40 ---- tkMessageBox.showerror( "Is A Directory", ! "The path %r is a directory." % (filename,), master=self.root) return None *************** *** 47,51 **** tkMessageBox.showinfo( "New File", ! "Opening non-existent file %s" % `filename`, master=self.root) if action is None: --- 47,51 ---- tkMessageBox.showinfo( "New File", ! "Opening non-existent file %r" % (filename,), master=self.root) if action is None: *************** *** 103,107 **** tkMessageBox.showerror( "Name Conflict", ! "You now have multiple edit windows open for %s" % `filename`, master=self.root) self.dict[newkey] = edit --- 103,107 ---- tkMessageBox.showerror( "Name Conflict", ! "You now have multiple edit windows open for %r" % (filename,), master=self.root) self.dict[newkey] = edit Index: GrepDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/GrepDialog.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GrepDialog.py 7 Jun 2003 03:21:17 -0000 1.4 --- GrepDialog.py 12 Feb 2004 17:35:09 -0000 1.5 *************** *** 78,82 **** self.close() pat = self.engine.getpat() ! print "Searching %s in %s ..." % (`pat`, path) hits = 0 for fn in list: --- 78,82 ---- self.close() pat = self.engine.getpat() ! print "Searching %r in %s ..." % (pat, path) hits = 0 for fn in list: Index: ObjectBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/ObjectBrowser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectBrowser.py 16 Sep 2002 22:16:05 -0000 1.4 --- ObjectBrowser.py 12 Feb 2004 17:35:09 -0000 1.5 *************** *** 98,102 **** def setfunction(value, key=key, object=self.object): object[key] = value ! item = make_objecttreeitem(`key` + ":", value, setfunction) sublist.append(item) return sublist --- 98,102 ---- def setfunction(value, key=key, object=self.object): object[key] = value ! item = make_objecttreeitem("%r:" % (key,), value, setfunction) sublist.append(item) return sublist Index: ParenMatch.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/ParenMatch.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ParenMatch.py 17 May 2003 03:51:57 -0000 1.7 --- ParenMatch.py 12 Feb 2004 17:35:09 -0000 1.8 *************** *** 143,147 **** for context in self.num_context_lines: startat = max(lno - context, 1) ! startatindex = `startat` + ".0" # rawtext needs to contain everything up to the last # character, which was the close paren. the parser also --- 143,147 ---- for context in self.num_context_lines: startat = max(lno - context, 1) ! startatindex = repr(startat) + ".0" # rawtext needs to contain everything up to the last # character, which was the close paren. the parser also Index: PyShell.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/PyShell.py,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** PyShell.py 21 Jan 2004 22:10:01 -0000 1.85 --- PyShell.py 12 Feb 2004 17:35:09 -0000 1.86 *************** *** 336,342 **** default=False, type='bool') if __name__ == 'idlelib.PyShell': ! command = "__import__('idlelib.run').run.main(" + `del_exitf` +")" else: ! command = "__import__('run').main(" + `del_exitf` + ")" if sys.platform[:3] == 'win' and ' ' in sys.executable: # handle embedded space in path by quoting the argument --- 336,342 ---- default=False, type='bool') if __name__ == 'idlelib.PyShell': ! command = "__import__('idlelib.run').run.main(%r)" % (del_exitf,) else: ! command = "__import__('run').main(%r)" % (del_exitf,) if sys.platform[:3] == 'win' and ' ' in sys.executable: # handle embedded space in path by quoting the argument *************** *** 455,464 **** self.runcommand("""if 1: import sys as _sys ! _sys.path = %s del _sys _msg = 'Use File/Exit or your end-of-file key to quit IDLE' __builtins__.quit = __builtins__.exit = _msg del _msg ! \n""" % `sys.path`) active_seq = None --- 455,464 ---- self.runcommand("""if 1: import sys as _sys ! _sys.path = %r del _sys _msg = 'Use File/Exit or your end-of-file key to quit IDLE' __builtins__.quit = __builtins__.exit = _msg del _msg ! \n""" % (sys.path,)) active_seq = None *************** *** 484,488 **** if how == "OK": if what is not None: ! print >>console, `what` elif how == "EXCEPTION": if self.tkconsole.getvar("<>"): --- 484,488 ---- if how == "OK": if what is not None: ! print >>console, repr(what) elif how == "EXCEPTION": if self.tkconsole.getvar("<>"): *************** *** 590,594 **** "Prepend sys.path with file's directory if not already included" self.runcommand("""if 1: ! _filename = %s import sys as _sys from os.path import dirname as _dirname --- 590,594 ---- "Prepend sys.path with file's directory if not already included" self.runcommand("""if 1: ! _filename = %r import sys as _sys from os.path import dirname as _dirname *************** *** 597,601 **** _sys.path.insert(0, _dir) del _filename, _sys, _dirname, _dir ! \n""" % `filename`) def showsyntaxerror(self, filename=None): --- 597,601 ---- _sys.path.insert(0, _dir) del _filename, _sys, _dirname, _dir ! \n""" % (filename,)) def showsyntaxerror(self, filename=None): *************** *** 1334,1340 **** shell.interp.runcommand("""if 1: import sys as _sys ! _sys.argv = %s del _sys ! \n""" % `sys.argv`) if cmd: shell.interp.execsource(cmd) --- 1334,1340 ---- shell.interp.runcommand("""if 1: import sys as _sys ! _sys.argv = %r del _sys ! \n""" % (sys.argv,)) if cmd: shell.interp.execsource(cmd) Index: RemoteDebugger.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/RemoteDebugger.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RemoteDebugger.py 12 May 2003 02:33:47 -0000 1.10 --- RemoteDebugger.py 12 Feb 2004 17:35:09 -0000 1.11 *************** *** 95,99 **** def get_stack(self, fid, tbid): ! ##print >>sys.__stderr__, "get_stack(%s, %s)" % (`fid`, `tbid`) frame = frametable[fid] if tbid is None: --- 95,99 ---- def get_stack(self, fid, tbid): ! ##print >>sys.__stderr__, "get_stack(%r, %r)" % (fid, tbid) frame = frametable[fid] if tbid is None: *************** *** 296,300 **** ##print "**IdbProxy.call %s %s %s" % (methodname, args, kwargs) value = self.conn.remotecall(self.oid, methodname, args, kwargs) ! ##print "**IdbProxy.call %s returns %s" % (methodname, `value`) return value --- 296,300 ---- ##print "**IdbProxy.call %s %s %s" % (methodname, args, kwargs) value = self.conn.remotecall(self.oid, methodname, args, kwargs) ! ##print "**IdbProxy.call %s returns %r" % (methodname, value) return value Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/ScriptBinding.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ScriptBinding.py 21 Jan 2004 18:54:30 -0000 1.26 --- ScriptBinding.py 12 Feb 2004 17:35:09 -0000 1.27 *************** *** 146,150 **** # XXX Too often this discards arguments the user just set... interp.runcommand("""if 1: ! _filename = %s import sys as _sys from os.path import basename as _basename --- 146,150 ---- # XXX Too often this discards arguments the user just set... interp.runcommand("""if 1: ! _filename = %r import sys as _sys from os.path import basename as _basename *************** *** 153,159 **** _sys.argv = [_filename] import os as _os ! _os.chdir(%s) del _filename, _sys, _basename, _os ! \n""" % (`filename`, `dirname`)) interp.prepend_syspath(filename) interp.runcode(code) --- 153,159 ---- _sys.argv = [_filename] import os as _os ! _os.chdir(%r) del _filename, _sys, _basename, _os ! \n""" % (filename, dirname)) interp.prepend_syspath(filename) interp.runcode(code) Index: TreeWidget.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/TreeWidget.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TreeWidget.py 9 Jul 2003 18:48:24 -0000 1.7 --- TreeWidget.py 12 Feb 2004 17:35:09 -0000 1.8 *************** *** 32,36 **** ICONDIR = _icondir elif not os.path.isdir(ICONDIR): ! raise RuntimeError, "can't find icon directory (%s)" % `ICONDIR` def listicons(icondir=ICONDIR): --- 32,36 ---- ICONDIR = _icondir elif not os.path.isdir(ICONDIR): ! raise RuntimeError, "can't find icon directory (%r)" % (ICONDIR,) def listicons(icondir=ICONDIR): Index: UndoDelegator.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/UndoDelegator.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UndoDelegator.py 30 Nov 2002 19:04:07 -0000 1.4 --- UndoDelegator.py 12 Feb 2004 17:35:09 -0000 1.5 *************** *** 178,182 **** if self.tags is None: t = t[:-1] ! return s + `t` def do(self, text): --- 178,182 ---- if self.tags is None: t = t[:-1] ! return s + repr(t) def do(self, text): *************** *** 311,315 **** strs = [] for cmd in self.cmds: ! strs.append(" " + `cmd`) return s + "(\n" + ",\n".join(strs) + "\n)" --- 311,315 ---- strs = [] for cmd in self.cmds: ! strs.append(" %r" % (cmd,)) return s + "(\n" + ",\n".join(strs) + "\n)" Index: WidgetRedirector.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/WidgetRedirector.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WidgetRedirector.py 9 Jul 2003 18:48:24 -0000 1.3 --- WidgetRedirector.py 12 Feb 2004 17:35:09 -0000 1.4 *************** *** 70,74 **** def __repr__(self): ! return "OriginalCommand(%s, %s)" % (`self.redir`, `self.name`) def __call__(self, *args): --- 70,74 ---- def __repr__(self): ! return "OriginalCommand(%r, %r)" % (self.redir, self.name) def __call__(self, *args): Index: aboutDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/aboutDialog.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** aboutDialog.py 28 Oct 2003 21:57:10 -0000 1.14 --- aboutDialog.py 12 Feb 2004 17:35:09 -0000 1.15 *************** *** 67,71 **** labelPythonVer.grid(row=9, column=0, sticky=W, padx=10, pady=0) # handle weird tk version num in windoze python >= 1.6 (?!?) ! tkVer = `TkVersion`.split('.') tkVer[len(tkVer)-1] = str('%.3g' % (float('.'+tkVer[len(tkVer)-1])))[2:] if tkVer[len(tkVer)-1] == '': --- 67,71 ---- labelPythonVer.grid(row=9, column=0, sticky=W, padx=10, pady=0) # handle weird tk version num in windoze python >= 1.6 (?!?) ! tkVer = repr(TkVersion).split('.') tkVer[len(tkVer)-1] = str('%.3g' % (float('.'+tkVer[len(tkVer)-1])))[2:] if tkVer[len(tkVer)-1] == '': *************** *** 142,147 **** import tkMessageBox tkMessageBox.showerror(title='File Load Error', ! message='Unable to load file '+ ! `fn`+' .', parent=self) return --- 142,146 ---- import tkMessageBox tkMessageBox.showerror(title='File Load Error', ! message='Unable to load file %r .' % (fn,), parent=self) return Index: configDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/configDialog.py,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** configDialog.py 9 Jul 2003 18:48:24 -0000 1.55 --- configDialog.py 12 Feb 2004 17:35:09 -0000 1.56 *************** *** 719,723 **** keySetName=self.customKeys.get() if not tkMessageBox.askyesno('Delete Key Set','Are you sure you wish '+ ! 'to delete the key set '+`keySetName`+' ?', parent=self): return --- 719,723 ---- keySetName=self.customKeys.get() if not tkMessageBox.askyesno('Delete Key Set','Are you sure you wish '+ ! 'to delete the key set %r ?' % (keySetName), parent=self): return *************** *** 746,750 **** themeName=self.customTheme.get() if not tkMessageBox.askyesno('Delete Theme','Are you sure you wish '+ ! 'to delete the theme '+`themeName`+' ?', parent=self): return --- 746,750 ---- themeName=self.customTheme.get() if not tkMessageBox.askyesno('Delete Theme','Are you sure you wish '+ ! 'to delete the theme %r ?' % (themeName,), parent=self): return Index: configHandler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/configHandler.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** configHandler.py 24 Nov 2003 05:26:16 -0000 1.32 --- configHandler.py 12 Feb 2004 17:35:09 -0000 1.33 *************** *** 232,239 **** return self.defaultCfg[configType].Get(section, option, type=type) else: #returning default, print warning ! warning=('\n Warning: configHandler.py - IdleConf.GetOption -\n'+ ! ' problem retrieving configration option '+`option`+'\n'+ ! ' from section '+`section`+'.\n'+ ! ' returning default value: '+`default`+'\n') sys.stderr.write(warning) return default --- 232,240 ---- return self.defaultCfg[configType].Get(section, option, type=type) else: #returning default, print warning ! warning=('\n Warning: configHandler.py - IdleConf.GetOption -\n' ! ' problem retrieving configration option %r\n' ! ' from section %r.\n' ! ' returning default value: %r\n' % ! (option, section, default)) sys.stderr.write(warning) return default *************** *** 332,339 **** if not cfgParser.has_option(themeName,element): #we are going to return a default, print warning ! warning=('\n Warning: configHandler.py - IdleConf.GetThemeDict'+ ! ' -\n problem retrieving theme element '+`element`+ ! '\n from theme '+`themeName`+'.\n'+ ! ' returning default value: '+`theme[element]`+'\n') sys.stderr.write(warning) colour=cfgParser.Get(themeName,element,default=theme[element]) --- 333,341 ---- if not cfgParser.has_option(themeName,element): #we are going to return a default, print warning ! warning=('\n Warning: configHandler.py - IdleConf.GetThemeDict' ! ' -\n problem retrieving theme element %r' ! '\n from theme %r.\n' ! ' returning default value: %r\n' % ! (element, themeName, theme[element])) sys.stderr.write(warning) colour=cfgParser.Get(themeName,element,default=theme[element]) *************** *** 562,569 **** keyBindings[event]=binding else: #we are going to return a default, print warning ! warning=('\n Warning: configHandler.py - IdleConf.GetCoreKeys'+ ! ' -\n problem retrieving key binding for event '+ ! `event`+'\n from key set '+`keySetName`+'.\n'+ ! ' returning default value: '+`keyBindings[event]`+'\n') sys.stderr.write(warning) return keyBindings --- 564,572 ---- keyBindings[event]=binding else: #we are going to return a default, print warning ! warning=('\n Warning: configHandler.py - IdleConf.GetCoreKeys' ! ' -\n problem retrieving key binding for event %r' ! '\n from key set %r.\n' ! ' returning default value: %r\n' % ! (event, keySetName, keyBindings[event])) sys.stderr.write(warning) return keyBindings Index: rpc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/rpc.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** rpc.py 21 Jan 2004 19:21:11 -0000 1.28 --- rpc.py 12 Feb 2004 17:35:09 -0000 1.29 *************** *** 59,63 **** # def pickle_function(fn): # assert isinstance(fn, type.FunctionType) ! # return `fn` copy_reg.pickle(types.CodeType, pickle_code, unpickle_code) --- 59,63 ---- # def pickle_function(fn): # assert isinstance(fn, type.FunctionType) ! # return repr(fn) copy_reg.pickle(types.CodeType, pickle_code, unpickle_code) *************** *** 171,175 **** return ("ERROR", "Bad request format") if not self.objtable.has_key(oid): ! return ("ERROR", "Unknown object id: %s" % `oid`) obj = self.objtable[oid] if methodname == "__methods__": --- 171,175 ---- return ("ERROR", "Bad request format") if not self.objtable.has_key(oid): ! return ("ERROR", "Unknown object id: %r" % (oid,)) obj = self.objtable[oid] if methodname == "__methods__": *************** *** 182,186 **** return ("OK", attributes) if not hasattr(obj, methodname): ! return ("ERROR", "Unsupported method name: %s" % `methodname`) method = getattr(obj, methodname) try: --- 182,186 ---- return ("OK", attributes) if not hasattr(obj, methodname): ! return ("ERROR", "Unsupported method name: %r" % (methodname,)) method = getattr(obj, methodname) try: *************** *** 322,326 **** s = pickle.dumps(message) except pickle.PicklingError: ! print >>sys.__stderr__, "Cannot pickle:", `message` raise s = struct.pack(">sys.__stderr__, "Cannot pickle:", repr(message) raise s = struct.pack(">sys.__stderr__, "-----------------------" ! print >>sys.__stderr__, "cannot unpickle packet:", `packet` traceback.print_stack(file=sys.__stderr__) print >>sys.__stderr__, "-----------------------" --- 378,382 ---- except pickle.UnpicklingError: print >>sys.__stderr__, "-----------------------" ! print >>sys.__stderr__, "cannot unpickle packet:", repr(packet) traceback.print_stack(file=sys.__stderr__) print >>sys.__stderr__, "-----------------------" Index: textView.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/textView.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** textView.py 12 Jun 2003 04:20:56 -0000 1.4 --- textView.py 12 Feb 2004 17:35:09 -0000 1.5 *************** *** 47,51 **** except IOError: tkMessageBox.showerror(title='File Load Error', ! message='Unable to load file '+`fileName`+' .') else: self.textView.insert(0.0,textFile.read()) --- 47,51 ---- except IOError: tkMessageBox.showerror(title='File Load Error', ! message='Unable to load file %r .' % (fileName,)) else: self.textView.insert(0.0,textFile.read()) From doerwalter at users.sourceforge.net Thu Feb 12 12:35:46 2004 From: doerwalter at users.sourceforge.net (doerwalter@users.sourceforge.net) Date: Thu Feb 12 12:40:29 2004 Subject: [Python-checkins] python/dist/src/Lib BaseHTTPServer.py, 1.28, 1.29 Bastion.py, 1.7, 1.8 CGIHTTPServer.py, 1.32, 1.33 ConfigParser.py, 1.61, 1.62 HTMLParser.py, 1.12, 1.13 StringIO.py, 1.32, 1.33 aifc.py, 1.42, 1.43 atexit.py, 1.6, 1.7 base64.py, 1.15, 1.16 bdb.py, 1.42, 1.43 binhex.py, 1.22, 1.23 calendar.py, 1.32, 1.33 cgi.py, 1.76, 1.77 difflib.py, 1.17, 1.18 dis.py, 1.47, 1.48 doctest.py, 1.32, 1.33 formatter.py, 1.23, 1.24 fpformat.py, 1.9, 1.10 ftplib.py, 1.72, 1.73 gopherlib.py, 1.13, 1.14 gzip.py, 1.39, 1.40 ihooks.py, 1.17, 1.18 imaplib.py, 1.65, 1.66 macurl2path.py, 1.11, 1.12 markupbase.py, 1.8, 1.9 mhlib.py, 1.36, 1.37 mimetools.py, 1.29, 1.30 modulefinder.py, 1.8, 1.9 nntplib.py, 1.36, 1.37 opcode.py, 1.3, 1.4 pdb.py, 1.66, 1.67 pickle.py, 1.156, 1.157 pipes.py, 1.12, 1.13 popen2.py, 1.28, 1.29 poplib.py, 1.22, 1.23 posixfile.py, 1.24, 1.25 pprint.py, 1.28, 1.29 pre.py, 1.15, 1.16 profile.py, 1.50, 1.51 pstats.py, 1.29, 1.30 regsub.py, 1.14, 1.15 repr.py, 1.15, 1.16 rexec.py, 1.48, 1.49 sgmllib.py, 1.46, 1.47 shlex.py, 1.22, 1.23 site.py, 1.55, 1.56 smtplib.py, ! 1.63, 1.64 stringold.py, 1.47, 1.48 sunaudio.py, 1.7, 1.8 tabnanny.py, 1.21, 1.22 telnetlib.py, 1.23, 1.24 toaiff.py, 1.14, 1.15 trace.py, 1.16, 1.17 unittest.py, 1.33, 1.34 urllib.py, 1.159, 1.160 warnings.py, 1.21, 1.22 wave.py, 1.16, 1.17 xdrlib.py, 1.15, 1.16 xmllib.py, 1.31, 1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21620/Lib Modified Files: BaseHTTPServer.py Bastion.py CGIHTTPServer.py ConfigParser.py HTMLParser.py StringIO.py aifc.py atexit.py base64.py bdb.py binhex.py calendar.py cgi.py difflib.py dis.py doctest.py formatter.py fpformat.py ftplib.py gopherlib.py gzip.py ihooks.py imaplib.py macurl2path.py markupbase.py mhlib.py mimetools.py modulefinder.py nntplib.py opcode.py pdb.py pickle.py pipes.py popen2.py poplib.py posixfile.py pprint.py pre.py profile.py pstats.py regsub.py repr.py rexec.py sgmllib.py shlex.py site.py smtplib.py stringold.py sunaudio.py tabnanny.py telnetlib.py toaiff.py trace.py unittest.py urllib.py warnings.py wave.py xdrlib.py xmllib.py Log Message: Replace backticks with repr() or "%r" >From SF patch #852334. Index: BaseHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/BaseHTTPServer.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** BaseHTTPServer.py 9 Aug 2003 05:01:41 -0000 1.28 --- BaseHTTPServer.py 12 Feb 2004 17:35:05 -0000 1.29 *************** *** 239,243 **** [command, path, version] = words if version[:5] != 'HTTP/': ! self.send_error(400, "Bad request version (%s)" % `version`) return False try: --- 239,243 ---- [command, path, version] = words if version[:5] != 'HTTP/': ! self.send_error(400, "Bad request version (%r)" % version) return False try: *************** *** 254,258 **** version_number = int(version_number[0]), int(version_number[1]) except (ValueError, IndexError): ! self.send_error(400, "Bad request version (%s)" % `version`) return False if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1": --- 254,258 ---- version_number = int(version_number[0]), int(version_number[1]) except (ValueError, IndexError): ! self.send_error(400, "Bad request version (%r)" % version) return False if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1": *************** *** 267,276 **** if command != 'GET': self.send_error(400, ! "Bad HTTP/0.9 request type (%s)" % `command`) return False elif not words: return False else: ! self.send_error(400, "Bad request syntax (%s)" % `requestline`) return False self.command, self.path, self.request_version = command, path, version --- 267,276 ---- if command != 'GET': self.send_error(400, ! "Bad HTTP/0.9 request type (%r)" % command) return False elif not words: return False else: ! self.send_error(400, "Bad request syntax (%r)" % requestline) return False self.command, self.path, self.request_version = command, path, version *************** *** 303,307 **** mname = 'do_' + self.command if not hasattr(self, mname): ! self.send_error(501, "Unsupported method (%s)" % `self.command`) return method = getattr(self, mname) --- 303,307 ---- mname = 'do_' + self.command if not hasattr(self, mname): ! self.send_error(501, "Unsupported method (%r)" % self.command) return method = getattr(self, mname) Index: Bastion.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/Bastion.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Bastion.py 6 Jan 2003 15:43:34 -0000 1.7 --- Bastion.py 12 Feb 2004 17:35:05 -0000 1.8 *************** *** 125,129 **** if name is None: ! name = `object` return bastionclass(get2, name) --- 125,129 ---- if name is None: ! name = repr(object) return bastionclass(get2, name) Index: CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** CGIHTTPServer.py 14 Jul 2003 06:56:32 -0000 1.32 --- CGIHTTPServer.py 12 Feb 2004 17:35:05 -0000 1.33 *************** *** 118,136 **** scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): ! self.send_error(404, "No such CGI script (%s)" % `scriptname`) return if not os.path.isfile(scriptfile): ! self.send_error(403, "CGI script is not a plain file (%s)" % ! `scriptname`) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2 or self.have_popen3): ! self.send_error(403, "CGI script is not a Python script (%s)" % ! `scriptname`) return if not self.is_executable(scriptfile): ! self.send_error(403, "CGI script is not executable (%s)" % ! `scriptname`) return --- 118,136 ---- scriptfile = self.translate_path(scriptname) if not os.path.exists(scriptfile): ! self.send_error(404, "No such CGI script (%r)" % scriptname) return if not os.path.isfile(scriptfile): ! self.send_error(403, "CGI script is not a plain file (%r)" % ! scriptname) return ispy = self.is_python(scriptname) if not ispy: if not (self.have_fork or self.have_popen2 or self.have_popen3): ! self.send_error(403, "CGI script is not a Python script (%r)" % ! scriptname) return if not self.is_executable(scriptfile): ! self.send_error(403, "CGI script is not executable (%r)" % ! scriptname) return Index: ConfigParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ConfigParser.py,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** ConfigParser.py 21 Oct 2003 16:45:00 -0000 1.61 --- ConfigParser.py 12 Feb 2004 17:35:05 -0000 1.62 *************** *** 119,123 **** def __init__(self, section): ! Error.__init__(self, 'No section: ' + `section`) self.section = section --- 119,123 ---- def __init__(self, section): ! Error.__init__(self, 'No section: %r' % (section,)) self.section = section *************** *** 192,196 **** Error.__init__( self, ! 'File contains no section headers.\nfile: %s, line: %d\n%s' % (filename, lineno, line)) self.filename = filename --- 192,196 ---- Error.__init__( self, ! 'File contains no section headers.\nfile: %s, line: %d\n%r' % (filename, lineno, line)) self.filename = filename *************** *** 454,458 **** # no section header in the file? elif cursect is None: ! raise MissingSectionHeaderError(fpname, lineno, `line`) # an option line? else: --- 454,458 ---- # no section header in the file? elif cursect is None: ! raise MissingSectionHeaderError(fpname, lineno, line) # an option line? else: *************** *** 479,483 **** if not e: e = ParsingError(fpname) ! e.append(lineno, `line`) # if any parsing errors occurred, raise an exception if e: --- 479,483 ---- if not e: e = ParsingError(fpname) ! e.append(lineno, repr(line)) # if any parsing errors occurred, raise an exception if e: *************** *** 614,616 **** raise InterpolationSyntaxError( option, section, ! "'%' must be followed by '%' or '(', found: " + `rest`) --- 614,616 ---- raise InterpolationSyntaxError( option, section, ! "'%%' must be followed by '%%' or '(', found: %r" % (rest,)) Index: HTMLParser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/HTMLParser.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** HTMLParser.py 14 Mar 2003 16:21:54 -0000 1.12 --- HTMLParser.py 12 Feb 2004 17:35:05 -0000 1.13 *************** *** 273,278 **** else: offset = offset + len(self.__starttag_text) ! self.error("junk characters in start tag: %s" ! % `rawdata[k:endpos][:20]`) if end.endswith('/>'): # XHTML-style empty tag: --- 273,278 ---- else: offset = offset + len(self.__starttag_text) ! self.error("junk characters in start tag: %r" ! % (rawdata[k:endpos][:20],)) if end.endswith('/>'): # XHTML-style empty tag: *************** *** 325,329 **** match = endtagfind.match(rawdata, i) # if not match: ! self.error("bad end tag: %s" % `rawdata[i:j]`) tag = match.group(1) self.handle_endtag(tag.lower()) --- 325,329 ---- match = endtagfind.match(rawdata, i) # if not match: ! self.error("bad end tag: %r" % (rawdata[i:j],)) tag = match.group(1) self.handle_endtag(tag.lower()) *************** *** 369,373 **** def unknown_decl(self, data): ! self.error("unknown declaration: " + `data`) # Internal -- helper to remove special character quoting --- 369,373 ---- def unknown_decl(self, data): ! self.error("unknown declaration: %r" % (data,)) # Internal -- helper to remove special character quoting Index: StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/StringIO.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** StringIO.py 18 Jan 2004 20:29:54 -0000 1.32 --- StringIO.py 12 Feb 2004 17:35:05 -0000 1.33 *************** *** 223,230 **** f.write(lines[1]) f.seek(0) ! print 'First line =', `f.readline()` print 'Position =', f.tell() line = f.readline() ! print 'Second line =', `line` f.seek(-len(line), 1) line2 = f.read(len(line)) --- 223,230 ---- f.write(lines[1]) f.seek(0) ! print 'First line =', repr(f.readline()) print 'Position =', f.tell() line = f.readline() ! print 'Second line =', repr(line) f.seek(-len(line), 1) line2 = f.read(len(line)) Index: aifc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/aifc.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** aifc.py 12 Aug 2002 22:11:28 -0000 1.42 --- aifc.py 12 Feb 2004 17:35:05 -0000 1.43 *************** *** 393,397 **** if id == marker[0]: return marker ! raise Error, 'marker ' + `id` + ' does not exist' def setpos(self, pos): --- 393,397 ---- if id == marker[0]: return marker ! raise Error, 'marker %r does not exist' % (id,) def setpos(self, pos): *************** *** 698,702 **** if id == marker[0]: return marker ! raise Error, 'marker ' + `id` + ' does not exist' def getmarkers(self): --- 698,702 ---- if id == marker[0]: return marker ! raise Error, 'marker %r does not exist' % (id,) def getmarkers(self): Index: atexit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/atexit.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** atexit.py 27 Feb 2003 20:14:31 -0000 1.6 --- atexit.py 12 Feb 2004 17:35:05 -0000 1.7 *************** *** 41,47 **** print "running x1" def x2(n): ! print "running x2(%s)" % `n` def x3(n, kwd=None): ! print "running x3(%s, kwd=%s)" % (`n`, `kwd`) register(x1) --- 41,47 ---- print "running x1" def x2(n): ! print "running x2(%r)" % (n,) def x3(n, kwd=None): ! print "running x3(%r, kwd=%r)" % (n, kwd) register(x1) Index: base64.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/base64.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** base64.py 7 Jan 2004 22:32:12 -0000 1.15 --- base64.py 12 Feb 2004 17:35:05 -0000 1.16 *************** *** 349,353 **** s1 = encodestring(s0) s2 = decodestring(s1) ! print s0, `s1`, s2 --- 349,353 ---- s1 = encodestring(s0) s2 = decodestring(s1) ! print s0, repr(s1), s2 Index: bdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bdb.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** bdb.py 27 Feb 2003 20:14:32 -0000 1.42 --- bdb.py 12 Feb 2004 17:35:05 -0000 1.43 *************** *** 53,57 **** if event == 'exception': return self.dispatch_exception(frame, arg) ! print 'bdb.Bdb.dispatch: unknown debugging event:', `event` return self.trace_dispatch --- 53,57 ---- if event == 'exception': return self.dispatch_exception(frame, arg) ! print 'bdb.Bdb.dispatch: unknown debugging event:', repr(event) return self.trace_dispatch *************** *** 312,316 **** frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) ! s = filename + '(' + `lineno` + ')' if frame.f_code.co_name: s = s + frame.f_code.co_name --- 312,316 ---- frame, lineno = frame_lineno filename = self.canonic(frame.f_code.co_filename) ! s = '%s(%r)' % (filename, lineno) if frame.f_code.co_name: s = s + frame.f_code.co_name Index: binhex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/binhex.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** binhex.py 4 Sep 2001 19:14:13 -0000 1.22 --- binhex.py 12 Feb 2004 17:35:06 -0000 1.23 *************** *** 230,234 **** def close_data(self): if self.dlen != 0: ! raise Error, 'Incorrect data size, diff='+`self.rlen` self._writecrc() self.state = _DID_DATA --- 230,234 ---- def close_data(self): if self.dlen != 0: ! raise Error, 'Incorrect data size, diff=%r' % (self.rlen,) self._writecrc() self.state = _DID_DATA *************** *** 249,253 **** if self.rlen != 0: raise Error, \ ! "Incorrect resource-datasize, diff="+`self.rlen` self._writecrc() self.ofp.close() --- 249,253 ---- if self.rlen != 0: raise Error, \ ! "Incorrect resource-datasize, diff=%r" % (self.rlen,) self._writecrc() self.ofp.close() Index: calendar.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/calendar.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** calendar.py 13 Feb 2003 22:58:02 -0000 1.32 --- calendar.py 12 Feb 2004 17:35:06 -0000 1.33 *************** *** 152,158 **** w = max(2, w) l = max(1, l) ! s = ((month_name[themonth] + ' ' + `theyear`).center( ! 7 * (w + 1) - 1).rstrip() + ! '\n' * l + weekheader(w).rstrip() + '\n' * l) for aweek in monthcalendar(theyear, themonth): s = s + week(aweek, w).rstrip() + '\n' * l --- 152,158 ---- w = max(2, w) l = max(1, l) ! s = ("%s %r" % (month_name[themonth], theyear)).center( ! 7 * (w + 1) - 1).rstrip() + \ ! '\n' * l + weekheader(w).rstrip() + '\n' * l for aweek in monthcalendar(theyear, themonth): s = s + week(aweek, w).rstrip() + '\n' * l *************** *** 182,186 **** c = max(2, c) colwidth = (w + 1) * 7 - 1 ! s = `year`.center(colwidth * 3 + c * 2).rstrip() + '\n' * l header = weekheader(w) header = format3cstring(header, header, header, colwidth, c).rstrip() --- 182,186 ---- c = max(2, c) colwidth = (w + 1) * 7 - 1 ! s = repr(year).center(colwidth * 3 + c * 2).rstrip() + '\n' * l header = weekheader(w) header = format3cstring(header, header, header, colwidth, c).rstrip() Index: cgi.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cgi.py,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** cgi.py 27 Feb 2003 20:14:32 -0000 1.76 --- cgi.py 12 Feb 2004 17:35:06 -0000 1.77 *************** *** 213,217 **** if len(nv) != 2: if strict_parsing: ! raise ValueError, "bad query field: %s" % `name_value` continue if len(nv[1]) or keep_blank_values: --- 213,217 ---- if len(nv) != 2: if strict_parsing: ! raise ValueError, "bad query field: %r" % (name_value,) continue if len(nv[1]) or keep_blank_values: *************** *** 248,253 **** boundary = pdict['boundary'] if not valid_boundary(boundary): ! raise ValueError, ('Invalid boundary in multipart form: %s' ! % `boundary`) nextpart = "--" + boundary --- 248,253 ---- boundary = pdict['boundary'] if not valid_boundary(boundary): ! raise ValueError, ('Invalid boundary in multipart form: %r' ! % (boundary,)) nextpart = "--" + boundary *************** *** 362,366 **** def __repr__(self): """Return printable representation.""" ! return "MiniFieldStorage(%s, %s)" % (`self.name`, `self.value`) --- 362,366 ---- def __repr__(self): """Return printable representation.""" ! return "MiniFieldStorage(%r, %r)" % (self.name, self.value) *************** *** 523,528 **** def __repr__(self): """Return a printable representation.""" ! return "FieldStorage(%s, %s, %s)" % ( ! `self.name`, `self.filename`, `self.value`) def __iter__(self): --- 523,528 ---- def __repr__(self): """Return a printable representation.""" ! return "FieldStorage(%r, %r, %r)" % ( ! self.name, self.filename, self.value) def __iter__(self): *************** *** 633,638 **** ib = self.innerboundary if not valid_boundary(ib): ! raise ValueError, ('Invalid boundary in multipart form: %s' ! % `ib`) self.list = [] klass = self.FieldStorageClass or self.__class__ --- 633,637 ---- ib = self.innerboundary if not valid_boundary(ib): ! raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,) self.list = [] klass = self.FieldStorageClass or self.__class__ *************** *** 958,963 **** print "
          " + escape(key) + ":", value = form[key] ! print "" + escape(`type(value)`) + "" ! print "
          " + escape(`value`) print "" print --- 957,962 ---- print "
          " + escape(key) + ":", value = form[key] ! print "" + escape(repr(type(value))) + "" ! print "
          " + escape(repr(value)) print "" print Index: difflib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/difflib.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** difflib.py 16 Oct 2003 05:53:16 -0000 1.17 --- difflib.py 12 Feb 2004 17:35:06 -0000 1.18 *************** *** 690,696 **** if not n > 0: ! raise ValueError("n must be > 0: " + `n`) if not 0.0 <= cutoff <= 1.0: ! raise ValueError("cutoff must be in [0.0, 1.0]: " + `cutoff`) result = [] s = SequenceMatcher() --- 690,696 ---- if not n > 0: ! raise ValueError("n must be > 0: %r" % (n,)) if not 0.0 <= cutoff <= 1.0: ! raise ValueError("cutoff must be in [0.0, 1.0]: %r" % (cutoff,)) result = [] s = SequenceMatcher() *************** *** 877,881 **** g = self._dump(' ', a, alo, ahi) else: ! raise ValueError, 'unknown tag ' + `tag` for line in g: --- 877,881 ---- g = self._dump(' ', a, alo, ahi) else: ! raise ValueError, 'unknown tag %r' % (tag,) for line in g: *************** *** 989,993 **** btags += ' ' * lb else: ! raise ValueError, 'unknown tag ' + `tag` for line in self._qformat(aelt, belt, atags, btags): yield line --- 989,993 ---- btags += ' ' * lb else: ! raise ValueError, 'unknown tag %r' % (tag,) for line in self._qformat(aelt, belt, atags, btags): yield line Index: dis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dis.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** dis.py 28 Oct 2003 12:17:25 -0000 1.47 --- dis.py 12 Feb 2004 17:35:06 -0000 1.48 *************** *** 81,85 **** if i in labels: print '>>', else: print ' ', ! print `i`.rjust(4), print opname[op].ljust(20), i = i+1 --- 81,85 ---- if i in labels: print '>>', else: print ' ', ! print repr(i).rjust(4), print opname[op].ljust(20), i = i+1 *************** *** 90,100 **** if op == EXTENDED_ARG: extended_arg = oparg*65536L ! print `oparg`.rjust(5), if op in hasconst: ! print '(' + `co.co_consts[oparg]` + ')', elif op in hasname: print '(' + co.co_names[oparg] + ')', elif op in hasjrel: ! print '(to ' + `i + oparg` + ')', elif op in haslocal: print '(' + co.co_varnames[oparg] + ')', --- 90,100 ---- if op == EXTENDED_ARG: extended_arg = oparg*65536L ! print repr(oparg).rjust(5), if op in hasconst: ! print '(' + repr(co.co_consts[oparg]) + ')', elif op in hasname: print '(' + co.co_names[oparg] + ')', elif op in hasjrel: ! print '(to ' + repr(i + oparg) + ')', elif op in haslocal: print '(' + co.co_varnames[oparg] + ')', *************** *** 119,123 **** if i in labels: print '>>', else: print ' ', ! print `i`.rjust(4), print opname[op].ljust(15), i = i+1 --- 119,123 ---- if i in labels: print '>>', else: print ' ', ! print repr(i).rjust(4), print opname[op].ljust(15), i = i+1 *************** *** 125,132 **** oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 ! print `oparg`.rjust(5), if op in hasconst: if constants: ! print '(' + `constants[oparg]` + ')', else: print '(%d)'%oparg, --- 125,132 ---- oparg = ord(code[i]) + ord(code[i+1])*256 i = i+2 ! print repr(oparg).rjust(5), if op in hasconst: if constants: ! print '(' + repr(constants[oparg]) + ')', else: print '(%d)'%oparg, *************** *** 137,141 **** print '(%d)'%oparg, elif op in hasjrel: ! print '(to ' + `i + oparg` + ')', elif op in haslocal: if varnames: --- 137,141 ---- print '(%d)'%oparg, elif op in hasjrel: ! print '(to ' + repr(i + oparg) + ')', elif op in haslocal: if varnames: Index: doctest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** doctest.py 17 Sep 2003 05:50:59 -0000 1.32 --- doctest.py 12 Feb 2004 17:35:06 -0000 1.33 *************** *** 335,340 **** lineno = i - 1 if line[j] != " ": ! raise ValueError("line " + `lineno` + " of docstring lacks " ! "blank after " + PS1 + ": " + line) j = j + 1 blanks = m.group(1) --- 335,340 ---- lineno = i - 1 if line[j] != " ": ! raise ValueError("line %r of docstring lacks blank after %s: %s" % ! (lineno, PS1, line)) j = j + 1 blanks = m.group(1) *************** *** 349,353 **** if m.group(1) != blanks: raise ValueError("inconsistent leading whitespace " ! "in line " + `i` + " of docstring: " + line) i = i + 1 else: --- 349,353 ---- if m.group(1) != blanks: raise ValueError("inconsistent leading whitespace " ! "in line %r of docstring: %s" % (i, line)) i = i + 1 else: *************** *** 368,372 **** if line[:nblanks] != blanks: raise ValueError("inconsistent leading whitespace " ! "in line " + `i` + " of docstring: " + line) expect.append(line[nblanks:]) i = i + 1 --- 368,372 ---- if line[:nblanks] != blanks: raise ValueError("inconsistent leading whitespace " ! "in line %r of docstring: %s" % (i, line)) expect.append(line[nblanks:]) i = i + 1 *************** *** 476,480 **** out("*" * 65 + "\n") _tag_out(out, ("Failure in example", source)) ! out("from line #" + `lineno` + " of " + name + "\n") if state == FAIL: _tag_out(out, ("Expected", want or NADA), ("Got", got)) --- 476,480 ---- out("*" * 65 + "\n") _tag_out(out, ("Failure in example", source)) ! out("from line #%r of %s\n" % (lineno, name)) if state == FAIL: _tag_out(out, ("Expected", want or NADA), ("Got", got)) *************** *** 687,692 **** raise TypeError("Tester.__init__: must specify mod or globs") if mod is not None and not _ismodule(mod): ! raise TypeError("Tester.__init__: mod must be a module; " + ! `mod`) if globs is None: globs = mod.__dict__ --- 687,691 ---- raise TypeError("Tester.__init__: must specify mod or globs") if mod is not None and not _ismodule(mod): ! raise TypeError("Tester.__init__: mod must be a module; %r" % (mod,)) if globs is None: globs = mod.__dict__ *************** *** 776,780 **** except AttributeError: raise ValueError("Tester.rundoc: name must be given " ! "when object.__name__ doesn't exist; " + `object`) if self.verbose: print "Running", name + ".__doc__" --- 775,779 ---- except AttributeError: raise ValueError("Tester.rundoc: name must be given " ! "when object.__name__ doesn't exist; %r" % (object,)) if self.verbose: print "Running", name + ".__doc__" *************** *** 894,899 **** if not hasattr(d, "items"): ! raise TypeError("Tester.rundict: d must support .items(); " + ! `d`) f = t = 0 # Run the tests by alpha order of names, for consistency in --- 893,897 ---- if not hasattr(d, "items"): ! raise TypeError("Tester.rundict: d must support .items(); %r" % (d,)) f = t = 0 # Run the tests by alpha order of names, for consistency in *************** *** 937,941 **** raise TypeError("Tester.run__test__: values in " "dict must be strings, functions, methods, " ! "or classes; " + `v`) failures = failures + f tries = tries + t --- 935,939 ---- raise TypeError("Tester.run__test__: values in " "dict must be strings, functions, methods, " ! "or classes; %r" % (v,)) failures = failures + f tries = tries + t *************** *** 1140,1144 **** if not _ismodule(m): ! raise TypeError("testmod: module required; " + `m`) if name is None: name = m.__name__ --- 1138,1142 ---- if not _ismodule(m): ! raise TypeError("testmod: module required; %r" % (m,)) if name is None: name = m.__name__ *************** *** 1154,1158 **** if not hasattr(testdict, "items"): raise TypeError("testmod: module.__test__ must support " ! ".items(); " + `testdict`) f, t = tester.run__test__(testdict, name + ".__test__") failures += f --- 1152,1156 ---- if not hasattr(testdict, "items"): raise TypeError("testmod: module.__test__ must support " ! ".items(); %r" % (testdict,)) f, t = tester.run__test__(testdict, name + ".__test__") failures += f Index: formatter.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/formatter.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** formatter.py 27 Feb 2003 20:14:33 -0000 1.23 --- formatter.py 12 Feb 2004 17:35:06 -0000 1.24 *************** *** 326,345 **** def new_alignment(self, align): ! print "new_alignment(%s)" % `align` def new_font(self, font): ! print "new_font(%s)" % `font` def new_margin(self, margin, level): ! print "new_margin(%s, %d)" % (`margin`, level) def new_spacing(self, spacing): ! print "new_spacing(%s)" % `spacing` def new_styles(self, styles): ! print "new_styles(%s)" % `styles` def send_paragraph(self, blankline): ! print "send_paragraph(%s)" % `blankline` def send_line_break(self): --- 326,345 ---- def new_alignment(self, align): ! print "new_alignment(%r)" % (align,) def new_font(self, font): ! print "new_font(%r)" % (font,) def new_margin(self, margin, level): ! print "new_margin(%r, %d)" % (margin, level) def new_spacing(self, spacing): ! print "new_spacing(%r)" % (spacing,) def new_styles(self, styles): ! print "new_styles(%r)" % (styles,) def send_paragraph(self, blankline): ! print "send_paragraph(%r)" % (blankline,) def send_line_break(self): *************** *** 350,360 **** def send_label_data(self, data): ! print "send_label_data(%s)" % `data` def send_flowing_data(self, data): ! print "send_flowing_data(%s)" % `data` def send_literal_data(self, data): ! print "send_literal_data(%s)" % `data` --- 350,360 ---- def send_label_data(self, data): ! print "send_label_data(%r)" % (data,) def send_flowing_data(self, data): ! print "send_flowing_data(%r)" % (data,) def send_literal_data(self, data): ! print "send_literal_data(%r)" % (data,) Index: fpformat.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/fpformat.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** fpformat.py 20 Jan 2001 23:34:12 -0000 1.9 --- fpformat.py 12 Feb 2004 17:35:06 -0000 1.10 *************** *** 89,93 **** and at least one digit before. If digs <= 0, the point is suppressed.""" ! if type(x) != type(''): x = `x` try: sign, intpart, fraction, expo = extract(x) --- 89,93 ---- and at least one digit before. If digs <= 0, the point is suppressed.""" ! if type(x) != type(''): x = repr(x) try: sign, intpart, fraction, expo = extract(x) *************** *** 105,109 **** and exactly one digit before. If digs is <= 0, one digit is kept and the point is suppressed.""" ! if type(x) != type(''): x = `x` sign, intpart, fraction, expo = extract(x) if not intpart: --- 105,109 ---- and exactly one digit before. If digs is <= 0, one digit is kept and the point is suppressed.""" ! if type(x) != type(''): x = repr(x) sign, intpart, fraction, expo = extract(x) if not intpart: *************** *** 127,131 **** s = sign + intpart if digs > 0: s = s + '.' + fraction ! e = `abs(expo)` e = '0'*(3-len(e)) + e if expo < 0: e = '-' + e --- 127,131 ---- s = sign + intpart if digs > 0: s = s + '.' + fraction ! e = repr(abs(expo)) e = '0'*(3-len(e)) + e if expo < 0: e = '-' + e Index: ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** ftplib.py 3 Jun 2002 10:41:45 -0000 1.72 --- ftplib.py 12 Feb 2004 17:35:06 -0000 1.73 *************** *** 162,166 **** i = i-1 s = s[:5] + '*'*(i-5) + s[i:] ! return `s` # Internal: send one line to the server, appending CRLF --- 162,166 ---- i = i-1 s = s[:5] + '*'*(i-5) + s[i:] ! return repr(s) # Internal: send one line to the server, appending CRLF *************** *** 251,255 **** ''' hbytes = host.split('.') ! pbytes = [`port/256`, `port%256`] bytes = hbytes + pbytes cmd = 'PORT ' + ','.join(bytes) --- 251,255 ---- ''' hbytes = host.split('.') ! pbytes = [repr(port/256), repr(port%256)] bytes = hbytes + pbytes cmd = 'PORT ' + ','.join(bytes) *************** *** 265,269 **** if af == 0: raise error_proto, 'unsupported address family' ! fields = ['', `af`, host, `port`, ''] cmd = 'EPRT ' + '|'.join(fields) return self.voidcmd(cmd) --- 265,269 ---- if af == 0: raise error_proto, 'unsupported address family' ! fields = ['', repr(af), host, repr(port), ''] cmd = 'EPRT ' + '|'.join(fields) return self.voidcmd(cmd) *************** *** 398,402 **** while 1: line = fp.readline() ! if self.debugging > 2: print '*retr*', `line` if not line: break --- 398,402 ---- while 1: line = fp.readline() ! if self.debugging > 2: print '*retr*', repr(line) if not line: break Index: gopherlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gopherlib.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gopherlib.py 22 Sep 2003 12:43:16 -0000 1.13 --- gopherlib.py 12 Feb 2004 17:35:06 -0000 1.14 *************** *** 48,52 **** if gtype in _type_to_name_map: return _type_to_name_map[gtype] ! return 'TYPE=' + `gtype` # Names for characters and strings --- 48,52 ---- if gtype in _type_to_name_map: return _type_to_name_map[gtype] ! return 'TYPE=%r' % (gtype,) # Names for characters and strings *************** *** 114,118 **** parts = line[1:].split(TAB) if len(parts) < 4: ! print '(Bad line from server:', `line`, ')' continue if len(parts) > 4: --- 114,118 ---- parts = line[1:].split(TAB) if len(parts) < 4: ! print '(Bad line from server: %r)' % (line,) continue if len(parts) > 4: *************** *** 199,203 **** else: data = get_binary(f) ! print 'binary data:', len(data), 'bytes:', `data[:100]`[:40] # Run the test when run as script --- 199,203 ---- else: data = get_binary(f) ! print 'binary data:', len(data), 'bytes:', repr(data[:100])[:40] # Run the test when run as script Index: gzip.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gzip.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** gzip.py 4 Dec 2003 19:28:06 -0000 1.39 --- gzip.py 12 Feb 2004 17:35:06 -0000 1.40 *************** *** 443,447 **** else: if arg[-3:] != ".gz": ! print "filename doesn't end in .gz:", `arg` continue f = open(arg, "rb") --- 443,447 ---- else: if arg[-3:] != ".gz": ! print "filename doesn't end in .gz:", repr(arg) continue f = open(arg, "rb") Index: ihooks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ihooks.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ihooks.py 20 Oct 2003 14:01:49 -0000 1.17 --- ihooks.py 12 Feb 2004 17:35:06 -0000 1.18 *************** *** 274,279 **** m = self.hooks.load_package(name, filename, file) else: ! raise ImportError, "Unrecognized module type (%s) for %s" % \ ! (`type`, name) finally: if file: file.close() --- 274,279 ---- m = self.hooks.load_package(name, filename, file) else: ! raise ImportError, "Unrecognized module type (%r) for %s" % \ ! (type, name) finally: if file: file.close() *************** *** 300,305 **** if initfile: initfile.close() raise ImportError, \ ! "Bad type (%s) for __init__ module in package %s" % ( ! `inittype`, name) path = [filename] file = initfile --- 300,305 ---- if initfile: initfile.close() raise ImportError, \ ! "Bad type (%r) for __init__ module in package %s" % ( ! inittype, name) path = [filename] file = initfile Index: imaplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/imaplib.py,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** imaplib.py 10 Nov 2003 06:44:44 -0000 1.65 --- imaplib.py 12 Feb 2004 17:35:06 -0000 1.66 *************** *** 193,197 **** if __debug__: if self.debug >= 3: ! self._mesg('CAPABILITIES: %s' % `self.capabilities`) for version in AllowedVersions: --- 193,197 ---- if __debug__: if self.debug >= 3: ! self._mesg('CAPABILITIES: %r' % (self.capabilities,)) for version in AllowedVersions: *************** *** 973,977 **** if __debug__: if self.mo is not None and self.debug >= 5: ! self._mesg("\tmatched r'%s' => %s" % (cre.pattern, `self.mo.groups()`)) return self.mo is not None --- 973,977 ---- if __debug__: if self.mo is not None and self.debug >= 5: ! self._mesg("\tmatched r'%s' => %r" % (cre.pattern, self.mo.groups())) return self.mo is not None *************** *** 1417,1421 **** test_seq1 = test_seq1[1:] # Login not needed M._mesg('PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION) ! M._mesg('CAPABILITIES = %s' % `M.capabilities`) for cmd,args in test_seq1: --- 1417,1421 ---- test_seq1 = test_seq1[1:] # Login not needed M._mesg('PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION) ! M._mesg('CAPABILITIES = %r' % (M.capabilities,)) for cmd,args in test_seq1: Index: macurl2path.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/macurl2path.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** macurl2path.py 9 Feb 2001 09:48:45 -0000 1.11 --- macurl2path.py 12 Feb 2004 17:35:06 -0000 1.12 *************** *** 81,85 **** "/foo/bar/", "/"]: ! print `url`, '->', `url2pathname(url)` for path in ["drive:", "drive:dir:", --- 81,85 ---- "/foo/bar/", "/"]: ! print '%r -> %r' % (url, url2pathname(url)) for path in ["drive:", "drive:dir:", *************** *** 90,94 **** ":dir:", ":dir:file"]: ! print `path`, '->', `pathname2url(path)` if __name__ == '__main__': --- 90,94 ---- ":dir:", ":dir:file"]: ! print '%r -> %r' % (path, pathname2url(path)) if __name__ == '__main__': Index: markupbase.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/markupbase.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** markupbase.py 24 Apr 2003 16:02:42 -0000 1.8 --- markupbase.py 12 Feb 2004 17:35:06 -0000 1.9 *************** *** 125,129 **** else: self.error( ! "unexpected %s char in declaration" % `rawdata[j]`) if j < 0: return j --- 125,129 ---- else: self.error( ! "unexpected %r char in declaration" % rawdata[j]) if j < 0: return j *************** *** 145,149 **** match= _msmarkedsectionclose.search(rawdata, i+3) else: ! self.error('unknown status keyword %s in marked section' % `rawdata[i+3:j]`) if not match: return -1 --- 145,149 ---- match= _msmarkedsectionclose.search(rawdata, i+3) else: ! self.error('unknown status keyword %r in marked section' % rawdata[i+3:j]) if not match: return -1 *************** *** 181,186 **** if s != "/dev/null" % `seq`).read() list = map(int, stuff.split()) print list, "<-- pick" --- 986,993 ---- 'all']: try: ! do('f.parsesequence(%r)' % (seq,)) except Error, msg: print "Error:", msg ! stuff = os.popen("pick %r 2>/dev/null" % (seq,)).read() list = map(int, stuff.split()) print list, "<-- pick" Index: mimetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mimetools.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** mimetools.py 15 Jun 2003 22:12:23 -0000 1.29 --- mimetools.py 12 Feb 2004 17:35:06 -0000 1.30 *************** *** 130,138 **** hostid = socket.gethostbyname(socket.gethostname()) try: ! uid = `os.getuid()` except AttributeError: uid = '1' try: ! pid = `os.getpid()` except AttributeError: pid = '1' --- 130,138 ---- hostid = socket.gethostbyname(socket.gethostname()) try: ! uid = repr(os.getuid()) except AttributeError: uid = '1' try: ! pid = repr(os.getpid()) except AttributeError: pid = '1' Index: modulefinder.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/modulefinder.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** modulefinder.py 14 Nov 2003 10:28:42 -0000 1.8 --- modulefinder.py 12 Feb 2004 17:35:06 -0000 1.9 *************** *** 63,71 **** def __repr__(self): ! s = "Module(%s" % `self.__name__` if self.__file__ is not None: ! s = s + ", %s" % `self.__file__` if self.__path__ is not None: ! s = s + ", %s" % `self.__path__` s = s + ")" return s --- 63,71 ---- def __repr__(self): ! s = "Module(%r" % % (self.__name__,) if self.__file__ is not None: ! s = s + ", %r" % (self.__file__,) if self.__path__ is not None: ! s = s + ", %r" % (self.__path__,) s = s + ")" return s *************** *** 565,569 **** print "path:" for item in path: ! print " ", `item` # Create the module finder and turn its crank --- 565,569 ---- print "path:" for item in path: ! print " ", repr(item) # Create the module finder and turn its crank Index: nntplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/nntplib.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** nntplib.py 19 Apr 2003 18:04:57 -0000 1.36 --- nntplib.py 12 Feb 2004 17:35:06 -0000 1.37 *************** *** 176,180 **** if it 201, posting is not allowed.""" ! if self.debugging: print '*welcome*', `self.welcome` return self.welcome --- 176,180 ---- if it 201, posting is not allowed.""" ! if self.debugging: print '*welcome*', repr(self.welcome) return self.welcome *************** *** 191,200 **** """Internal: send one line to the server, appending CRLF.""" line = line + CRLF ! if self.debugging > 1: print '*put*', `line` self.sock.sendall(line) def putcmd(self, line): """Internal: send one command to the server (through putline()).""" ! if self.debugging: print '*cmd*', `line` self.putline(line) --- 191,200 ---- """Internal: send one line to the server, appending CRLF.""" line = line + CRLF ! if self.debugging > 1: print '*put*', repr(line) self.sock.sendall(line) def putcmd(self, line): """Internal: send one command to the server (through putline()).""" ! if self.debugging: print '*cmd*', repr(line) self.putline(line) *************** *** 204,208 **** line = self.file.readline() if self.debugging > 1: ! print '*get*', `line` if not line: raise EOFError if line[-2:] == CRLF: line = line[:-2] --- 204,208 ---- line = self.file.readline() if self.debugging > 1: ! print '*get*', repr(line) if not line: raise EOFError if line[-2:] == CRLF: line = line[:-2] *************** *** 214,218 **** Raise various errors if the response indicates an error.""" resp = self.getline() ! if self.debugging: print '*resp*', `resp` c = resp[:1] if c == '4': --- 214,218 ---- Raise various errors if the response indicates an error.""" resp = self.getline() ! if self.debugging: print '*resp*', repr(resp) c = resp[:1] if c == '4': Index: opcode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/opcode.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** opcode.py 24 Apr 2003 05:45:17 -0000 1.3 --- opcode.py 12 Feb 2004 17:35:06 -0000 1.4 *************** *** 22,26 **** opmap = {} opname = [''] * 256 ! for op in range(256): opname[op] = '<' + `op` + '>' del op --- 22,26 ---- opmap = {} opname = [''] * 256 ! for op in range(256): opname[op] = '<%r>' % (op,) del op Index: pdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pdb.py,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** pdb.py 15 Jun 2003 23:26:29 -0000 1.66 --- pdb.py 12 Feb 2004 17:35:06 -0000 1.67 *************** *** 220,224 **** f = self.lookupmodule(filename) if not f: ! print '*** ', `filename`, print 'not found from sys.path' return --- 220,224 ---- f = self.lookupmodule(filename) if not f: ! print '*** ', repr(filename), print 'not found from sys.path' return *************** *** 253,257 **** if not ok: print '*** The specified object', ! print `arg`, print 'is not a function' print ('or was not found ' --- 253,257 ---- if not ok: print '*** The specified object', ! print repr(arg), print 'is not a function' print ('or was not found ' *************** *** 597,601 **** exc_type_name = t else: exc_type_name = t.__name__ ! print '***', exc_type_name + ':', `v` raise --- 597,601 ---- exc_type_name = t else: exc_type_name = t.__name__ ! print '***', exc_type_name + ':', repr(v) raise *************** *** 628,632 **** first = max(1, int(x) - 5) except: ! print '*** Error in argument:', `arg` return elif self.lineno is None: --- 628,632 ---- first = max(1, int(x) - 5) except: ! print '*** Error in argument:', repr(arg) return elif self.lineno is None: *************** *** 645,649 **** break else: ! s = `lineno`.rjust(3) if len(s) < 4: s = s + ' ' if lineno in breaklist: s = s + 'B' --- 645,649 ---- break else: ! s = repr(lineno).rjust(3) if len(s) < 4: s = s + ' ' if lineno in breaklist: s = s + 'B' *************** *** 666,670 **** exc_type_name = t else: exc_type_name = t.__name__ ! print '***', exc_type_name + ':', `v` return code = None --- 666,670 ---- exc_type_name = t else: exc_type_name = t.__name__ ! print '***', exc_type_name + ':', repr(v) return code = None *************** *** 1035,1039 **** mainpyfile = filename = sys.argv[1] # Get script filename if not os.path.exists(filename): ! print 'Error:', `filename`, 'does not exist' sys.exit(1) mainmodule = os.path.basename(filename) --- 1035,1039 ---- mainpyfile = filename = sys.argv[1] # Get script filename if not os.path.exists(filename): ! print 'Error:', repr(filename), 'does not exist' sys.exit(1) mainmodule = os.path.basename(filename) *************** *** 1043,1045 **** sys.path.insert(0, os.path.dirname(filename)) ! run('execfile(' + `filename` + ')') --- 1043,1045 ---- sys.path.insert(0, os.path.dirname(filename)) ! run('execfile(%r)' % (filename,)) Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** pickle.py 29 Jun 2003 16:59:59 -0000 1.156 --- pickle.py 12 Feb 2004 17:35:06 -0000 1.157 *************** *** 262,266 **** return LONG_BINPUT + pack("d', obj)) else: ! self.write(FLOAT + `obj` + '\n') dispatch[FloatType] = save_float --- 489,493 ---- self.write(BINFLOAT + pack('>d', obj)) else: ! self.write(FLOAT + repr(obj) + '\n') dispatch[FloatType] = save_float *************** *** 500,504 **** self.write(BINSTRING + pack("' def reset(self): --- 90,95 ---- def __repr__(self): ! """t.__repr__() implements repr(t).""" ! return '