Commit graph

5125 commits

Author SHA1 Message Date
Brett Cannon
177381116e Add a reference to module_to_load 2013-05-31 18:00:56 -04:00
Brett Cannon
357c9fb055 Rename importlib.util.ModuleManager to module_to_load so that the name
explains better what the context manager is providing.
2013-05-30 17:31:47 -04:00
Brett Cannon
56dfc2127f Undo a recommendation as load_module() methods might be called directly 2013-05-28 18:40:31 -04:00
Brett Cannon
3dc48d6f69 Issue #18070: importlib.util.module_for_loader() now sets __loader__
and __package__ unconditionally in order to do the right thing for
reloading.
2013-05-28 18:35:54 -04:00
Brett Cannon
a22faca714 Clarify some documentation 2013-05-28 17:50:14 -04:00
Brett Cannon
a3687f0d68 Introduce importlib.util.ModuleManager which is a context manager to
handle providing (and cleaning up if needed) the module to be loaded.

A future commit will use the context manager in
Lib/importlib/_bootstrap.py and thus why the code is placed there
instead of in Lib/importlib/util.py.
2013-05-28 17:29:34 -04:00
Serhiy Storchaka
77a3ad743f Issue #18011: base64.b32decode() now raises a binascii.Error if there are
non-alphabet characters present in the input string to conform a docstring.
Updated the module documentation.
2013-05-28 15:30:38 +03:00
Jason R. Coombs
8f1a8e32b1 Merge with 3.3 2013-05-27 23:26:36 -04:00
Brett Cannon
3b62ca88e4 Issue #18072: Implement get_code() for importlib.abc.InspectLoader and
ExecutionLoader.
2013-05-27 21:11:04 -04:00
Brett Cannon
9ffe85e1e8 Move importlib.abc.SourceLoader.source_to_code() to InspectLoader.
While the previous location was fine, it makes more sense to have the
method higher up in the inheritance chain, especially at a point where
get_source() is defined which is the earliest source_to_code() could
programmatically be used in the inheritance tree in importlib.abc.
2013-05-26 16:45:10 -04:00
Łukasz Langa
eadd8cf507 Fix #16832 - expose cache validity checking support in ABCMeta 2013-05-25 18:41:50 +02:00
Brett Cannon
21cc628e4c merge 2013-05-25 11:29:03 -04:00
Brett Cannon
b39567a00e merge 2013-05-25 11:26:36 -04:00
Brett Cannon
6489d0b380 merge fix for issue #17953 2013-05-24 17:31:37 -04:00
Senthil Kumaran
8307075ce8 Fix #17272 - Make Request.full_url and Request.get_full_url return same result under all circumstances.
Document the change of Request.full_url to a property.
2013-05-24 09:14:12 -07:00
Senthil Kumaran
cbc77bbbc0 merge from 3.3
Fix #18007 : Document CookieJar.add_cookie_header request parameter changes in 3.3 and 3.4.
2013-05-23 05:28:34 -07:00
Nick Coghlan
c633f97808 Merge issue 17844 from 3.3 2013-05-23 20:25:09 +10:00
Serhiy Storchaka
549681c79b Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs. 2013-05-22 15:35:35 +03:00
Giampaolo Rodola'
80e1c43ddf Fix issue #17996: expose socket.AF_LINK constant on BSD and OSX. 2013-05-21 21:02:04 +02:00
Ned Deily
de88c0d2f2 Issue #18026: merge 2013-05-20 14:32:06 -07:00
Charles-Francois Natali
44feda3cd0 Issue #17914: Add os.cpu_count(). Patch by Yogesh Chaudhari, based on an
initial patch by Trent Nelson.
2013-05-20 14:40:46 +02:00
Eli Bendersky
fb625448f8 Clarify docs too: events can be any sequence (not that the C code supports it) 2013-05-19 09:09:24 -07:00
Raymond Hettinger
163e9821b4 Undo the deprecation of _asdict().
Backed out changeset c4ca39bece9d
2013-05-18 00:05:20 -07:00
Raymond Hettinger
4e0172fd9a Deprecate nametuple._asdict() 2013-05-17 17:14:27 -07:00
Benjamin Peterson
e8e14591eb rather than passing locals to the class body, just execute the class body in the proper environment 2013-05-16 14:37:25 -05:00
Barry Warsaw
b710d7e4c3 - Issue #17977: The documentation for the cadefault argument's default value
in urllib.request.urlopen() is fixed to match the code.
2013-05-14 11:38:38 -04:00
Barry Warsaw
d486707d2e - Issue #17977: The documentation for the cadefault argument's default value
in urllib.request.urlopen() is fixed to match the code.
2013-05-14 11:35:16 -04:00
Georg Brandl
7025349aa8 merge with 3.3 2013-05-12 12:37:12 +02:00
Georg Brandl
521ed52131 Closes issue #17732: ignore install-directory specific options in
distutils.cfg when a venv is active.
2013-05-12 12:36:07 +02:00
Raymond Hettinger
3f5228d402 Issue #16694: Add source code link for operator.py 2013-05-10 19:57:44 -07:00
Barry Warsaw
8c01ffa6ed Merge 3.3 2013-05-10 11:36:23 -04:00
Barry Warsaw
d8f870d0fa I was confused before. It's correct to not call .close() inside the with
statement, but add a comment that clarifies the purpose of the code.
2013-05-10 11:35:38 -04:00
Ezio Melotti
9b149b94ff #17841: merge with 3.3. 2013-05-10 05:22:14 +03:00
Ezio Melotti
173d4109b5 #17841: remove missing codecs aliases from the documentation. Patch by Thomas Fenzl. 2013-05-10 05:21:35 +03:00
Ezio Melotti
0fbdf26158 #16523: merge with 3.3. 2013-05-08 10:56:32 +03:00
Ezio Melotti
babc8227cc #16523: improve attrgetter/itemgetter/methodcaller documentation. 2013-05-08 10:53:11 +03:00
Ezio Melotti
3ed3b3b402 #17714: merge with 3.3. 2013-05-07 11:21:21 +03:00
Ezio Melotti
c58a3ea72c #17714: document that the base64 codec adds a trailing newline. 2013-05-07 11:14:27 +03:00
Ezio Melotti
7168879eb2 #17871: merge with 3.3. 2013-05-07 09:47:08 +03:00
Ezio Melotti
9c939bceeb #17871: fix unittest.TextTestRunner signature in the docs. Patch by Yogesh Chaudhari. 2013-05-07 09:46:30 +03:00
Raymond Hettinger
6e6bee8d08 merge 2013-05-06 18:23:10 -07:00
Raymond Hettinger
12f588adeb Issue 17920: Fix-up terminology in the set documentation 2013-05-06 18:22:43 -07:00
Nick Coghlan
b39fd0c9b8 Issue #11816: multiple improvements to the dis module
* get_instructions generator
* ability to redirect output to a file
* Bytecode and Instruction abstractions

Patch by Nick Coghlan, Ryan Kelly and Thomas Kluyver.
2013-05-06 23:59:20 +10:00
Raymond Hettinger
77371a5eea merge 2013-05-05 19:54:04 -07:00
Raymond Hettinger
44571daf0e Issue 17862: Improve the signature of itertools grouper() recipe.
Putting *n* after the *iterable* matches the signature of other itertools
and recipes.  Also, it reads better.

Suggested by Ezio Melotti.
2013-05-05 19:53:41 -07:00
Richard Oudkerk
7a3dae056d Issue #15528: Add weakref.finalize to support finalization using
weakref callbacks.

This is 2e446e87ac5b except that collections/__init__.py has been
modified to import proxy from _weakref instead of weakref.  This
eliminates an import cycle which seems to cause a problem on Unix but
not Windows.
2013-05-05 23:05:00 +01:00
Richard Oudkerk
39b17c513a Backout 2e446e87ac5b; it breaks the unix buildbots. 2013-05-05 22:12:34 +01:00
Richard Oudkerk
f3593026de Issue #15528: Add weakref.finalize to support finalization using
weakref callbacks.
2013-05-05 20:59:04 +01:00
Antoine Pitrou
1a6cb30a34 Issue #5845: Enable tab-completion in the interactive interpreter by default, thanks to a new sys.__interactivehook__.
(original patch by Éric Araujo)
2013-05-04 20:08:35 +02:00
Brett Cannon
4c14b5de1c #17115,17116: Have modules initialize the __package__ and __loader__
attributes to None.

The long-term goal is for people to be able to rely on these
attributes existing and checking for None to see if they have been
set. Since import itself sets these attributes when a loader does not
the only instances when the attributes are None are from someone
overloading __import__() and not using a loader or someone creating a
module from scratch.

This patch also unifies module initialization. Before you could have
different attributes with default values depending on how the module
object was created. Now the only way to not get the same default set
of attributes is to circumvent initialization by calling
ModuleType.__new__() directly.
2013-05-04 13:56:58 -04:00