Commit Graph

1995 Commits

Author SHA1 Message Date
Brett Cannon 849113af6b Issue #25791: Warn when __package__ != __spec__.parent.
In a previous change, __spec__.parent was prioritized over
__package__. That is a backwards-compatibility break, but we do
eventually want __spec__ to be the ground truth for module details. So
this change reverts the change in semantics and instead raises an
ImportWarning when __package__ != __spec__.parent to give people time
to adjust to using spec objects.
2016-01-22 15:25:50 -08:00
Victor Stinner f3914eb16d co_lnotab supports negative line number delta
Issue #26107: The format of the co_lnotab attribute of code objects changes to
support negative line number delta.

Changes:

* assemble_lnotab(): if line number delta is less than -128 or greater than
  127, emit multiple (offset_delta, lineno_delta) in co_lnotab
* update functions decoding co_lnotab to use signed 8-bit integers

  - dis.findlinestarts()
  - PyCode_Addr2Line()
  - _PyCode_CheckLineNumber()
  - frame_setlineno()

* update lnotab_notes.txt
* increase importlib MAGIC_NUMBER to 3361
* document the change in What's New in Python 3.6
* cleanup also PyCode_Optimize() to use better variable names
2016-01-20 12:16:21 +01:00
Senthil Kumaran 613065b60d Issue26069 - Update whatsnew/3.6.rst on traceback module's api removals. 2016-01-17 20:12:16 -08:00
Martin Panter e8afd01db8 Issue #23883: Update news 2016-01-16 07:01:46 +00:00
Brett Cannon 63b8505281 Issue #25791: Raise an ImportWarning when __spec__ or __package__ are
not defined for a relative import.

This is the start of work to try and clean up import semantics to rely
more on a module's spec than on the myriad attributes that get set on
a module. Thanks to Rose Ames for the patch.
2016-01-15 13:33:03 -08:00
Yury Selivanov 37dc2b2883 Issue #25486: Resurrect inspect.getargspec in 3.6. Backout a565aad5d6e1.
The decision is that we shouldn't remove popular APIs (however long they
are depreacted) from Python 3, while 2.7 is still around and supported.
2016-01-11 15:15:01 -05:00
Brett Cannon eae3079041 Issue #25802: Deprecate load_module() on importlib.machinery.SourceFileLoader and SourcelessFileLoader.
They were the only remaining implementations of load_module() not
documented as deprecated.
2015-12-28 17:55:27 -08:00
Brett Cannon 1e3c3e906c Issue #25768: Make compileall functions return booleans and document
the return values as well as test them.

Thanks to Nicholas Chammas for the bug report and initial patch.
2015-12-27 13:17:04 -08:00
Yury Selivanov 2c008d83dc Merge 3.5 2015-12-15 00:38:38 -05:00
Yury Selivanov 4a18b35dbd docs/whatsnew/3.5: Fix ref link 2015-12-15 00:38:28 -05:00
Yury Selivanov e93f407a0f Merge 3.5 2015-12-15 00:30:32 -05:00
Yury Selivanov bf077ee043 whatsnew/3.5: Mention new asyncio APIs in 3.5.1 2015-12-15 00:30:18 -05:00
Martin Panter b4ce1fc31b Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failure 2015-11-30 03:18:29 +00:00
R David Murray 4f09806e66 #25485: Add context manager support to Telnet class.
Patch by Stéphane Wirtel.
2015-11-28 12:24:52 -05:00
Martin Panter 28a465c9e0 Issue #23883: Add news listing modules with new exported APIs 2015-11-14 12:52:08 +00:00
Martin Panter fad4b60074 Adjust grammar and punctuation in whatsnew/3.6.rst 2015-11-14 01:29:17 +00:00
Martin Panter 22fd1c262a Merge typo and grammar fixes from 3.5 2015-11-14 01:29:13 +00:00
Martin Panter 97ce0faa4d Fix grammar in whatsnew/3.5.rst and elsewhere
Mainly missing grammatical articles (the, a).
2015-11-14 01:14:54 +00:00
Martin Panter 6fe39266c8 Issue #25590: Complete attribute names even if they are not yet created 2015-11-13 23:54:02 +00:00
Zachary Ware d545f7f4cb Merge with 3.5 2015-11-11 22:54:28 -06:00
Zachary Ware ccbc8dedec Fix awkward grammar in whatsnew.
Reported on docs@ by Keith Briggs.
2015-11-11 22:53:47 -06:00
Zachary Ware c826ab06c8 Fix typos in whatsnew.
Reported on docs@ by Igor Zhun.
2015-11-11 22:41:43 -06:00
Raymond Hettinger 2fbde51e2f merge 2015-11-09 08:26:28 -08:00
Raymond Hettinger 850be0fb18 Improve namedtuple doc string examples 2015-11-09 08:24:53 -08:00
Serhiy Storchaka 4a7c03aab4 Issue #25523: Merge a-to-an corrections from 3.5. 2015-11-02 14:44:29 +02:00
Serhiy Storchaka a84f6c3dd3 Issue #25523: Merge a-to-an corrections from 3.4. 2015-11-02 14:39:05 +02:00
Serhiy Storchaka d65c9496da Issue #25523: Further a-to-an corrections. 2015-11-02 14:10:23 +02:00
Raymond Hettinger a1fc949b5a Issue #24379: Revert the operator.subscript patch (dccc4e63aef5) pending resolution of the related refcnt leak. 2015-11-02 00:39:56 -05:00
Martin Panter e56a919100 Issue #25523: Merge a-to-an corrections from 3.5 2015-11-02 04:27:17 +00:00
Martin Panter d2ad5718ad Issue #25523: Further a-to-an corrections new in 3.5 2015-11-02 04:20:33 +00:00
Martin Panter 2eb819f7a8 Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5 2015-11-02 04:04:57 +00:00
Martin Panter 7462b64911 Issue #25523: Correct "a" article to "an" article
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
or edited some other way to fix the grammar.
2015-11-02 03:37:02 +00:00
Yury Selivanov 22d4553acb Merge 3.5 2015-10-31 13:34:01 -04:00
Yury Selivanov f97edf1aa6 whatsnew/3.5: NumPy 1.10 has been released 2015-10-31 13:33:49 -04:00
Martin Panter ff99988397 Merge typo fixes from 3.5 2015-10-31 12:23:03 +00:00
Martin Panter 0e5eba25c7 Fix more typos in whatsnew/3.5.rst 2015-10-31 12:18:10 +00:00
Martin Panter 4827e488a4 Merge spelling fixes from 3.4 into 3.5 2015-10-31 12:16:18 +00:00
Martin Panter 1f1177d69a Fix some spelling errors in documentation and code comments 2015-10-31 11:48:53 +00:00
Terry Jan Reedy 6dc9ce1923 Remove double 'error'. 2015-10-20 01:07:53 -04:00
Berker Peksag 8b880c7412 Fix another typo noticed by SilentGhost 2015-10-19 00:56:59 +03:00
Berker Peksag ad56c922b0 Fix another typo noticed by SilentGhost 2015-10-19 00:56:39 +03:00
Berker Peksag 65a73cd8be Issue #25434: Fix typo in whatsnew/3.5rst
Patch by Louis Sautier.
2015-10-18 20:22:38 +03:00
Berker Peksag 5783ee12bd Issue #25434: Fix typo in whatsnew/3.5rst
Patch by Louis Sautier.
2015-10-18 20:22:15 +03:00
Brett Cannon 9b63868f77 Issue #25154: Deprecate the pyvenv script.
This was done so as to move users to `python3 -m venv` which prevents
confusion over which Python interpreter will be used in the virtual
environment when more than one is installed.
2015-10-16 15:14:27 -07:00
Brett Cannon c0d91aff9a Upgrade the imp module's deprecation to DeprecationWarning. 2015-10-16 12:21:37 -07:00
Victor Stinner 2bf8993db9 Optimize bytes.fromhex() and bytearray.fromhex()
Issue #25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now
between 2x and 3.5x faster. Changes:

* Use a fast-path working on a char* string for ASCII string
* Use a slow-path for non-ASCII string
* Replace slow hex_digit_to_int() function with a O(1) lookup in
  _PyLong_DigitValue precomputed table
* Use _PyBytesWriter API to handle the buffer
* Add unit tests to check the error position in error messages
2015-10-14 11:25:33 +02:00
Victor Stinner ebcf9edc05 Document latest optimizations using _PyBytesWriter 2015-10-14 10:10:00 +02:00
Serhiy Storchaka 0d554d7ef1 Issue #24164: Objects that need calling ``__new__`` with keyword arguments,
can now be pickled using pickle protocols older than protocol version 4.
2015-10-10 22:42:18 +03:00
Berker Peksag b6c9572fa9 Sort module names in whatsnew/3.6.rst 2015-10-08 13:58:49 +03:00
Berker Peksag 960e848f0d Issue #16099: RobotFileParser now supports Crawl-delay and Request-rate
extensions.

Patch by Nikolay Bogoychev.
2015-10-08 12:27:06 +03:00