[Python-checkins] r51438 - in python/branches/p3yk: Doc/api/abstract.tex Doc/api/concrete.tex Doc/api/exceptions.tex Doc/api/init.tex Doc/api/intro.tex Doc/api/newtypes.tex Doc/commontex/boilerplate.tex Doc/dist/dist.tex Doc/lib/libctypes.tex Doc/lib/libexcs.tex Doc/lib/libwarnings.tex Doc/whatsnew/whatsnew25.tex Include/abstract.h Include/code.h Include/import.h Include/object.h Include/pyerrors.h Include/unicodeobject.h Lib/Cookie.py Lib/cgi.py Lib/compiler/ast.py Lib/compiler/pycodegen.py Lib/compiler/symbols.py Lib/ctypes/__init__.py Lib/ctypes/test/test_as_parameter.py Lib/ctypes/test/test_functions.py Lib/ctypes/test/test_numbers.py Lib/ctypes/test/test_prototypes.py Lib/ctypes/test/test_python_api.py Lib/distutils/__init__.py Lib/idlelib/Bindings.py Lib/idlelib/CREDITS.txt Lib/idlelib/CodeContext.py Lib/idlelib/NEWS.txt Lib/idlelib/PyShell.py Lib/idlelib/idlever.py Lib/logging/__init__.py Lib/logging/config.py Lib/site.py Lib/string.py Lib/tabnanny.py Lib/tarfile.py Lib/test/exception_hierarchy.txt Lib/test/inspect_fodder2.py Lib/test/output/test_cgi Lib/test/test_bytes.py Lib/test/test_bz2.py Lib/test/test_cgi.py Lib/test/test_compiler.py Lib/test/test_format.py Lib/test/test_index.py Lib/test/test_inspect.py Lib/test/test_logging.py Lib/test/test_mailbox.py Lib/test/test_signal.py Lib/test/test_socketserver.py Lib/test/test_tarfile.py Lib/test/test_threading.py Lib/test/test_threadsignals.py Lib/test/test_urllib2.py Lib/test/test_uuid.py Lib/test/test_xml_etree_c.py Lib/tokenize.py Lib/trace.py Lib/urllib2.py Lib/uuid.py Makefile.pre.in Misc/ACKS Misc/PURIFY.README Misc/README.klocwork Misc/RPM/python-2.5.spec Misc/RPM/python-2.6.spec Misc/build.sh Modules/_bsddb.c Modules/_codecsmodule.c Modules/_ctypes/_ctypes.c Modules/_ctypes/_ctypes_test.c Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_ctypes/ctypes.h Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/configure.ac Modules/_ctypes/libffi/fficonfig.py.in Modules/_ctypes/stgdict.c Modules/_cursesmodule.c Modules/_elementtree.c Modules/_hotshot.c Modules/_sre.c Modules/_tkinter.c Modules/arraymodule.c Modules/bz2module.c Modules/collectionsmodule.c Modules/expat/xmlparse.c Modules/mmapmodule.c Modules/operator.c Modules/posixmodule.c Modules/rgbimgmodule.c Modules/socketmodule.c Modules/unicodedata.c Modules/zipimport.c Objects/abstract.c Objects/bytesobject.c Objects/exceptions.c Objects/intobject.c Objects/listobject.c Objects/longobject.c Objects/object.c Objects/sliceobject.c Objects/stringobject.c Objects/structseq.c Objects/tupleobject.c Objects/typeobject.c Objects/unicodeobject.c PC/pyconfig.h PCbuild/_ssl.mak PCbuild/_ssl.vcproj PCbuild/build_ssl.py PCbuild/pythoncore.vcproj PCbuild/readme.txt Parser Parser/grammar.c Parser/parsetok.c Python/ast.c Python/bltinmodule.c Python/ceval.c Python/compile.c Python/import.c Python/marshal.c Python/peephole.c Python/pystate.c Python/pythonrun.c Python/symtable.c Tools/buildbot Tools/buildbot/external.bat Tools/msi/msi.py

Nick Coghlan ncoghlan at gmail.com
Tue Aug 22 12:19:32 CEST 2006


thomas.wouters wrote:
> Log:
> 
> Merge current trunk into p3yk. This includes the PyNumber_Index API change,
> which unfortunately means the errors from the bytes type change somewhat:
> 
> bytes([300]) still raises a ValueError, but bytes([10**100]) now raises a
> TypeError (either that, or bytes(1.0) also raises a ValueError --
> PyNumber_AsSsize_t() can only raise one type of exception.)

That's not right. The error argument for PyNumber_AsSsize_t is only used for 
overflow handling (that's why it's always either IndexError or OverflowError 
in the core). The TypeError for non-integers (like 1.0) is raised separately 
(even if you set the error argument to NULL to request clipping).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-checkins mailing list