Antoine Pitrou
23bba4ca39
Issue #11750 : The Windows API functions scattered in the _subprocess and
...
_multiprocessing.win32 modules now live in a single module "_winapi".
Patch by sbt.
2012-04-18 20:51:15 +02:00
Stefan Krah
c51b7fd65b
1) Simplify comment -- one has to read the complete proof (available in ACL2)
...
in order to understand the algorithm anyway.
2) v->exp == -v->digits may be assumed.
3) Fix comment (v always shares data with a).
2012-04-18 19:27:32 +02:00
Stefan Krah
5d0d2e2b04
Explain the strategy to avoid huge alignment shifts in _mpd_qadd() in detail.
2012-04-18 18:59:56 +02:00
Stefan Krah
ed4b21ff4f
Cosmetic change: initialize digits to 1 (redundant).
2012-04-18 18:45:22 +02:00
Stefan Krah
bc771e9b19
Remove redundant finalization of the result.
2012-04-18 18:25:37 +02:00
Stefan Krah
aecaf0b663
Fix comments and whitespace.
2012-04-18 18:08:20 +02:00
Stefan Krah
6369f77d20
Support mythical ones' complement machines.
2012-04-18 17:57:56 +02:00
Stefan Krah
140893cbaa
The previous code is correct, but hard to verify: The libmpdec documentation
...
rightfully states that an mpd_t with a coefficient flagged as MPD_CONST_DATA
must not be in the position of the result operand. In this particular case
several assumptions guarantee that a resize will never occur in all possible
code paths, which was the reason for using MPD_CONST_DATA and saving an
instruction by omitting the initialization of tmp.alloc.
For readability, tmp is now flagged as MPD_STATIC_DATA and tmp.alloc
is initialized.
2012-04-18 17:48:34 +02:00
Antoine Pitrou
a3f4457b17
Speed up reading of small files. This avoids multiple C read() calls on pyc files.
2012-04-17 13:50:58 +02:00
Brett Cannon
6f44d66bc4
Issue #13959 : Rename imp to _imp and add Lib/imp.py and begin
...
rewriting functionality in pure Python.
To start, imp.new_module() has been rewritten in pure Python, put into
importlib (privately) and then publicly exposed in imp.
2012-04-15 16:08:47 -04:00
Mark Dickinson
da4210f77d
Issue #13496 : Merge from 3.2
2012-04-15 16:32:04 +01:00
Mark Dickinson
a13b109bc0
Issue 13496: Fix bisect.bisect overflow bug for large collections.
2012-04-15 16:30:35 +01:00
Kristján Valur Jónsson
69c635266e
Issue #10576 : Add a progress callback to gcmodule
2012-04-15 11:41:32 +00:00
Victor Stinner
b8d016955a
Fix clock_gettime/getres/settime: PyArg_ParseTuple() expects an int
...
Only use a single #ifdef for the 3 functions.
2012-04-13 23:44:05 +02:00
Stefan Krah
ec766a6179
1) Remove claim of an input invariant that is only true for static mpd_t.
...
Resizing is used _inside_ libmpdec functions, and it is permitted to
change x->alloc several times while setting x->len at the end of the
function. Therefore, for dynamic mpd_t x->alloc can _temporarily_ drop
below x->len. Of course the final result always has x->len <= x->alloc.
For static mpd_t this cannot happen, since resizing to a smaller
coefficient is a no-op.
2) Remove micro optimization in mpd_switch_to_dyn(): Previously only the
valid initialized part of the existing coefficient up to x->len was
copied to the new dynamic memory area. Now copying does the same as
realloc() and the entire old memory area is copied.
The rationale for this change is that it is no longer needed to memorize
the explanation given in 1).
2012-04-10 23:11:54 +02:00
Stefan Krah
7b544ca08d
Fix stale comment.
2012-04-10 23:08:29 +02:00
Stefan Krah
cc74b6ab14
Issue #14478 : Cache the hash of a Decimal in the C version.
2012-04-10 16:27:58 +02:00
Stefan Krah
e37f8b29fc
Issue #14520 : Add __sizeof__() method to the Decimal object.
2012-04-09 21:27:20 +02:00
Stefan Krah
f69aef747a
Resize the coefficient to MPD_MINALLOC also if the requested size is below
...
MPD_MINALLOC. Previously the resize was skipped as a micro optimization.
2012-04-09 20:47:57 +02:00
Stefan Krah
dd159ce606
Speed up _decimal by 30-40% for numerical workloads by improving the cache
...
locality for regularly sized coefficients.
2012-04-09 20:24:57 +02:00
Stefan Krah
94ef3e4c1d
Use the MPD() accessor macro.
2012-04-09 19:20:46 +02:00
Kristján Valur Jónsson
e638513856
Remove unused variable from gcmodule.c. The code no longer tests for the
...
presence of a __del__ attribute on objects, rather it uses the tp_del slot.
2012-04-08 13:56:25 +00:00
Brett Cannon
8798ad3e1e
struct timeval.tv_usec is 4 bytes on 64-bit OS X as it should be, but
...
is defined as an int while everyone else expects a long regardless of
length.
2012-04-07 14:59:29 -04:00
Stefan Krah
1bcb138cf2
Merge.
2012-04-07 16:10:04 +02:00
Stefan Krah
dc36efa368
1) Fix comment.
...
2) Assert that the source operand is not special. Prevent resulting assert
failure (harmless) by initializing flags before calling mpd_qshiftr_inplace.
3) Save a couple of instructions (mpd_zerocoeff already sets digits and len).
Reorder initialization to match the order in the mpd_t struct.
2012-04-07 15:57:59 +02:00
Kristján Valur Jónsson
10f383a937
Issue #14310 : inter-process socket duplication for windows
2012-04-07 11:23:31 +00:00
Ross Lagerwall
0f9eec19ee
Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
...
Found with Clang's Static Analyzer.
2012-04-07 07:09:57 +02:00
Stefan Krah
4771cca817
Whitespace.
2012-04-05 16:15:25 +02:00
Stefan Krah
871b96bd5a
Reduce array size.
2012-04-05 16:07:22 +02:00
Stefan Krah
a6169484c2
Formatting.
2012-04-05 15:48:59 +02:00
Stefan Krah
ff3eca0cc3
Allow printing a leading '-' and the maximum number of exponent digits
...
rather than raising RuntimeError (allocated space is sufficient for the
additional character).
2012-04-05 15:46:19 +02:00
Stefan Krah
0774e9b9f5
Raise InvalidOperation if exponents of zeros are clamped during exact
...
conversion in the Decimal constructor. Exact here refers to the
representation and not to the value (clamping does not change the value).
2012-04-05 15:21:58 +02:00
Eli Bendersky
828efdea56
Replace bootstrap imports with real C API calls.
2012-04-05 05:40:58 +03:00
Antoine Pitrou
a701388de1
Rename _PyIter_GetBuiltin to _PyObject_GetBuiltin, and do not include it in the stable ABI.
2012-04-05 00:04:20 +02:00
Eli Bendersky
08b852970e
Fix Windows compilation errors
2012-04-04 15:55:07 +03:00
Eli Bendersky
ebf37a2ffb
Fixes and enhancements to _elementtree:
...
* Fixed refleak problems when GC collection is run (see messages in
issue #14065 )
* Added weakref support to Element objects
2012-04-03 22:02:37 +03:00
Kristján Valur Jónsson
31668b8f7a
Issue #14288 : Serialization support for builtin iterators.
2012-04-03 10:49:41 +00:00
Victor Stinner
30d79471bb
Expose clock_settime() as time.clock_settime()
2012-04-03 00:45:07 +02:00
Victor Stinner
1470f35bc6
Add time.CLOCK_HIGHRES constant, needed on Solaris
2012-04-03 00:31:17 +02:00
Stefan Krah
91c0274bc4
Improve comments.
2012-04-02 20:51:08 +02:00
Benjamin Peterson
dba1b40b60
merge 3.2
2012-04-02 11:28:49 -04:00
Benjamin Peterson
e900096dc4
prevent writing to stderr from messing up the exception state ( closes #14474 )
2012-04-02 11:15:17 -04:00
Stefan Krah
5100171d81
Clear the context flags if a context is initialized from the DefaultContext.
2012-04-02 15:02:21 +02:00
Stefan Krah
41e031004b
Fix Overflow exception in the bignum factorial benchmark that is due to
...
the recent change of the default value for context.Emax.
2012-04-01 23:25:34 +02:00
Antoine Pitrou
9a54a260de
Issue #14300 : Under Windows, sockets created using socket.dup() now allow overlapped I/O.
...
Patch by sbt.
2012-04-01 01:14:39 +02:00
Antoine Pitrou
6211b88161
Issue #14437 : Fix building the _io module under Cygwin.
2012-03-31 23:50:31 +02:00
Andrew Svetlov
9e892bbf28
fix issue #5136 : deprecate old unused functions from tkinter.
...
These functions are not documnted, so no documentation update.
2012-03-31 19:36:39 +03:00
Kristján Valur Jónsson
310052c1f0
Fix warning when compiling socketmodule.c with VS2010
...
VS2010 defineds the old errno constants in addition to the WSA* ones.
2012-03-31 13:35:00 +00:00
Eli Bendersky
0192ba33b4
Issue #14065 : Added cyclic GC support to ET.Element
2012-03-30 16:38:33 +03:00
Stefan Krah
1e25755006
Merge.
2012-03-30 14:19:21 +02:00