Jeffrey Yasskin
ca2b69f765
Move __builtins__.trunc() to math.trunc() per
...
http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue
1965.
2008-02-01 06:22:46 +00:00
Raymond Hettinger
867558afd6
CallMethod is faster with a NULL third-argument than with an empty format string.
2008-01-29 19:52:09 +00:00
Guido van Rossum
1d9a9eaa89
Fix two crashers.
2008-01-23 20:19:01 +00:00
Christian Heimes
288e89acfc
Added bytes and b'' as aliases for str and ''
2008-01-18 18:24:07 +00:00
Georg Brandl
9fcd8ceb74
Fix C++-style comment.
2008-01-05 17:49:17 +00:00
Jeffrey Yasskin
9871d8fe22
Continue rolling back pep-3141 changes that changed behavior from 2.5. This
...
round included:
* Revert round to its 2.6 behavior (half away from 0).
* Because round, floor, and ceil always return float again, it's no
longer necessary to have them delegate to __xxx___, so I've ripped
that out of their implementations and the Real ABC. This also helps
in implementing types that work in both 2.6 and 3.0: you return int
from the __xxx__ methods, and let it get enabled by the version
upgrade.
* Make pow(-1, .5) raise a ValueError again.
2008-01-05 08:47:13 +00:00
Jeffrey Yasskin
2f3c16be73
Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (just
...
the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361,
r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new
documentation. The only significant difference is that round(x) returns a float
to preserve backward-compatibility. See http://bugs.python.org/issue1689 .
2008-01-03 02:21:52 +00:00
Guido van Rossum
01dbc109a8
Improve performance of built-in any()/all() by avoiding PyIter_Next() --
...
using a trick found in ifilter().
Feel free to backport to 2.5.
2007-12-20 23:48:28 +00:00
Skip Montanaro
4e3ebe0bae
Note that open() is the preferred way to open files (issue 1510).
2007-12-08 14:37:43 +00:00
Raymond Hettinger
4e2f714031
Fix Issue 1045.
...
Factor-out common calling code by simplifying the length_hint API.
Speed-up the function by caching the PyObject_String for the attribute lookup.
2007-12-06 00:56:53 +00:00
Raymond Hettinger
a45c4873fc
Missing DECREFs
2007-10-25 02:26:58 +00:00
Raymond Hettinger
3a8daf5b56
Fixup error return and add support for intermixed ints and floats/
2007-10-24 02:05:51 +00:00
Raymond Hettinger
3f8caa3ba7
Optimize sum() for integer and float inputs.
2007-10-24 01:28:33 +00:00
Neal Norwitz
df25efeae9
Add a bunch more deprecation warnings for builtins that are going away in 3.0
2007-05-23 06:58:36 +00:00
Neal Norwitz
8b2bfbc198
Add -3 option to the interpreter to warn about features that are
...
deprecated and will be changed/removed in Python 3.0.
This patch is mostly from Anthony. I tweaked some format and added
a little doc.
2007-05-23 06:35:32 +00:00
Georg Brandl
5240d7416c
Patch #1444529 : the builtin compile() now accepts keyword arguments.
...
(backport)
2007-03-13 20:46:32 +00:00
Georg Brandl
3bb156722e
Typo and grammar fixes.
2007-03-13 07:23:16 +00:00
Georg Brandl
871f1bc601
Backport from Py3k branch:
...
Patch #1591665 : implement the __dir__() special function lookup in PyObject_Dir.
Had to change a few bits of the patch because classobjs and __methods__ are still
in Py2.6.
2007-03-12 13:17:36 +00:00
Georg Brandl
8134d06e08
Bug #1283491 : follow docstring convention wrt. keyword-able args in sum().
2006-10-12 12:33:07 +00:00
Neal Norwitz
477ca1c953
Fix SF #1552093 , eval docstring typo (3 ps in mapping)
2006-09-05 02:25:41 +00:00
Neal Norwitz
43bd4db933
It's highly unlikely, though possible for PyEval_Get*() to return NULLs.
...
So be safe and do an XINCREF.
Klocwork # 221-222.
2006-08-12 01:46:42 +00:00
Georg Brandl
7e3ba2a699
Bug #1535165 : fixed a segfault in input() and raw_input() when
...
sys.stdin is closed.
2006-08-06 08:23:54 +00:00
Neal Norwitz
c4edb0ec81
SF #1479181 : split open() and file() from being aliases for each other.
2006-05-02 04:43:14 +00:00
Martin v. Löwis
b1ed7fac12
Replace INT_MAX with PY_SSIZE_T_MAX.
2006-04-13 07:52:27 +00:00
Neal Norwitz
92e212f7d9
Accept keyword arguments for __import__ and doc the addition of the level param from PEP 328.
2006-04-03 04:48:37 +00:00