Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Defensive programming: mpd_isspecial(r) already implies mpd_isspecial(q), but | Stefan Krah | 2012-04-20 | 1 | -0/+1 |
| | | | | this is more readable. | ||||
* | The divmod function for large numbers now has an ACL2 proof. Related changes: | Stefan Krah | 2012-04-20 | 1 | -45/+140 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Rename _mpd_qbarrett_divmod into _mpd_base_ndivmod: The function is only marginally related to either Barrett's algorithm or to the version in Hasselstrom's paper. 2) In places where the proof assumes exact operations, use new versions of add/sub/multiply that set NaN/Invalid_operation if this condition is not met. According to the proof this cannot happen, so this should be regarded as an extra safety net. 3) Raise Division_impossible for operands with a number of digits greater than MPD_MAX_PREC. This facilitates the audit of the function and can practically only occur in the 32-bit version under conditions where a MemoryError is already imminent. 4) Use _mpd_qmul() in places where the result can exceed MPD_MAX_PREC in a well defined manner. 5) Test for mpd_isspecial(qq) in a place where the addition of one can theoretically trigger a Malloc_error. 6) Remove redundant code in _mpd_qdivmod(). 7) Add many comments. | ||||
* | Issue #14127: Add st_{cma}time_ns fields to os.stat() result object. | Larry Hastings | 2012-04-19 | 2 | -27/+48 |
| | |||||
* | Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo. | Martin v. Löwis | 2012-04-19 | 1 | -0/+24 |
| | | | | Patch by Stefan Behnel. | ||||
* | Issue #11750: The Windows API functions scattered in the _subprocess and | Antoine Pitrou | 2012-04-18 | 3 | -834/+1398 |
| | | | | | _multiprocessing.win32 modules now live in a single module "_winapi". Patch by sbt. | ||||
* | 1) Simplify comment -- one has to read the complete proof (available in ACL2) | Stefan Krah | 2012-04-18 | 1 | -7/+6 |
| | | | | | | | | in order to understand the algorithm anyway. 2) v->exp == -v->digits may be assumed. 3) Fix comment (v always shares data with a). | ||||
* | Explain the strategy to avoid huge alignment shifts in _mpd_qadd() in detail. | Stefan Krah | 2012-04-18 | 1 | -6/+35 |
| | |||||
* | Cosmetic change: initialize digits to 1 (redundant). | Stefan Krah | 2012-04-18 | 1 | -1/+1 |
| | |||||
* | Remove redundant finalization of the result. | Stefan Krah | 2012-04-18 | 1 | -2/+0 |
| | |||||
* | Fix comments and whitespace. | Stefan Krah | 2012-04-18 | 1 | -8/+8 |
| | |||||
* | Support mythical ones' complement machines. | Stefan Krah | 2012-04-18 | 1 | -1/+1 |
| | |||||
* | The previous code is correct, but hard to verify: The libmpdec documentation | Stefan Krah | 2012-04-18 | 1 | -1/+2 |
| | | | | | | | | | | | 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. | ||||
* | Speed up reading of small files. This avoids multiple C read() calls on pyc ↵ | Antoine Pitrou | 2012-04-17 | 1 | -3/+11 |
| | | | | files. | ||||
* | Issue #13959: Rename imp to _imp and add Lib/imp.py and begin | Brett Cannon | 2012-04-15 | 1 | -1/+1 |
| | | | | | | | 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. | ||||
* | Issue #13496: Merge from 3.2 | Mark Dickinson | 2012-04-15 | 1 | -2/+8 |
|\ | |||||
| * | Issue 13496: Fix bisect.bisect overflow bug for large collections. | Mark Dickinson | 2012-04-15 | 1 | -2/+8 |
| | | |||||
* | | Issue #10576: Add a progress callback to gcmodule | Kristján Valur Jónsson | 2012-04-15 | 1 | -6/+74 |
| | | |||||
* | | Fix clock_gettime/getres/settime: PyArg_ParseTuple() expects an int | Victor Stinner | 2012-04-13 | 1 | -10/+4 |
| | | | | | | | | Only use a single #ifdef for the 3 functions. | ||||
* | | 1) Remove claim of an input invariant that is only true for static mpd_t. | Stefan Krah | 2012-04-10 | 2 | -4/+2 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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). | ||||
* | | Fix stale comment. | Stefan Krah | 2012-04-10 | 1 | -3/+4 |
| | | |||||
* | | Issue #14478: Cache the hash of a Decimal in the C version. | Stefan Krah | 2012-04-10 | 1 | -1/+14 |
| | | |||||
* | | Issue #14520: Add __sizeof__() method to the Decimal object. | Stefan Krah | 2012-04-09 | 1 | -0/+14 |
| | | |||||
* | | Resize the coefficient to MPD_MINALLOC also if the requested size is below | Stefan Krah | 2012-04-09 | 1 | -11/+15 |
| | | | | | | | | MPD_MINALLOC. Previously the resize was skipped as a micro optimization. | ||||
* | | Speed up _decimal by 30-40% for numerical workloads by improving the cache | Stefan Krah | 2012-04-09 | 1 | -16/+18 |
| | | | | | | | | locality for regularly sized coefficients. | ||||
* | | Use the MPD() accessor macro. | Stefan Krah | 2012-04-09 | 1 | -2/+2 |
| | | |||||
* | | Remove unused variable from gcmodule.c. The code no longer tests for the | Kristján Valur Jónsson | 2012-04-08 | 1 | -9/+0 |
| | | | | | | | | presence of a __del__ attribute on objects, rather it uses the tp_del slot. | ||||
* | | struct timeval.tv_usec is 4 bytes on 64-bit OS X as it should be, but | Brett Cannon | 2012-04-07 | 1 | -1/+5 |
| | | | | | | | | | | is defined as an int while everyone else expects a long regardless of length. | ||||
* | | Merge. | Stefan Krah | 2012-04-07 | 2 | -8/+67 |
|\ \ | |||||
| * | | Issue #14310: inter-process socket duplication for windows | Kristján Valur Jónsson | 2012-04-07 | 1 | -7/+66 |
| | | | |||||
| * | | Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder. | Ross Lagerwall | 2012-04-07 | 1 | -1/+1 |
| | | | | | | | | | | | | Found with Clang's Static Analyzer. | ||||
* | | | 1) Fix comment. | Stefan Krah | 2012-04-07 | 1 | -15/+12 |
|/ / | | | | | | | | | | | | | | | 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. | ||||
* | | Whitespace. | Stefan Krah | 2012-04-05 | 1 | -1/+1 |
| | | |||||
* | | Reduce array size. | Stefan Krah | 2012-04-05 | 1 | -1/+1 |
| | | |||||
* | | Formatting. | Stefan Krah | 2012-04-05 | 1 | -2/+2 |
| | | |||||
* | | Allow printing a leading '-' and the maximum number of exponent digits | Stefan Krah | 2012-04-05 | 1 | -2/+2 |
| | | | | | | | | | | rather than raising RuntimeError (allocated space is sufficient for the additional character). | ||||
* | | Raise InvalidOperation if exponents of zeros are clamped during exact | Stefan Krah | 2012-04-05 | 2 | -2/+3 |
| | | | | | | | | | | conversion in the Decimal constructor. Exact here refers to the representation and not to the value (clamping does not change the value). | ||||
* | | Replace bootstrap imports with real C API calls. | Eli Bendersky | 2012-04-05 | 1 | -8/+9 |
| | | |||||
* | | Rename _PyIter_GetBuiltin to _PyObject_GetBuiltin, and do not include it in ↵ | Antoine Pitrou | 2012-04-04 | 1 | -1/+1 |
| | | | | | | | | the stable ABI. | ||||
* | | Fix Windows compilation errors | Eli Bendersky | 2012-04-04 | 1 | -2/+4 |
| | | |||||
* | | Fixes and enhancements to _elementtree: | Eli Bendersky | 2012-04-03 | 1 | -21/+44 |
| | | | | | | | | | | | | * Fixed refleak problems when GC collection is run (see messages in issue #14065) * Added weakref support to Element objects | ||||
* | | Issue #14288: Serialization support for builtin iterators. | Kristján Valur Jónsson | 2012-04-03 | 3 | -56/+957 |
| | | |||||
* | | Expose clock_settime() as time.clock_settime() | Victor Stinner | 2012-04-02 | 1 | -0/+30 |
| | | |||||
* | | Add time.CLOCK_HIGHRES constant, needed on Solaris | Victor Stinner | 2012-04-02 | 1 | -0/+3 |
| | | |||||
* | | Improve comments. | Stefan Krah | 2012-04-02 | 1 | -5/+5 |
| | | |||||
* | | merge 3.2 | Benjamin Peterson | 2012-04-02 | 1 | -0/+3 |
|\ \ | |/ | |||||
| * | prevent writing to stderr from messing up the exception state (closes #14474) | Benjamin Peterson | 2012-04-02 | 1 | -0/+3 |
| | | |||||
| * | Issue #14437: Fix building the _io module under Cygwin. | Antoine Pitrou | 2012-03-31 | 1 | -1/+1 |
| | | |||||
* | | Clear the context flags if a context is initialized from the DefaultContext. | Stefan Krah | 2012-04-02 | 1 | -0/+8 |
| | | |||||
* | | Fix Overflow exception in the bignum factorial benchmark that is due to | Stefan Krah | 2012-04-01 | 1 | -1/+4 |
| | | | | | | | | the recent change of the default value for context.Emax. | ||||
* | | Issue #14300: Under Windows, sockets created using socket.dup() now allow ↵ | Antoine Pitrou | 2012-03-31 | 1 | -1/+1 |
| | | | | | | | | | | | | overlapped I/O. Patch by sbt. |