New submission from STINNER Victor <victor.stin...@haypocalc.com>:

The documentation of PyArg_Parse*() number formats specify that only int / 
float / complex are accepted, whereas any int / float / complex compatible 
object is accepted. "compatible" means that it has an __int__() / __float__() / 
__complex__() method, or nb_int / nb_float of 
Py_TYPE(obj)->tp_as_number->nb_int is defined (tp_as_number has no nb_complex).

I suppose that the following paragraph is also outdated:

"It is possible to pass "long" integers (integers whose value exceeds the
 platform's :const:`LONG_MAX`) however no proper range checking is done --- the
 most significant bits are silently truncated when the receiving field is too
 small to receive the value (actually, the semantics are inherited from 
downcasts
 in C --- your mileage may vary)."

Moreover, "without overflow checking" should be explained (Mark told me that 
the number is truncated to a power of 2).

----------
assignee: d...@python
components: Documentation, Interpreter Core
messages: 107379
nosy: d...@python, haypo, mark.dickinson
priority: normal
severity: normal
status: open
title: Doc/c-api/arg.rst: fix documentation of number formats
versions: Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8952>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to