New submission from Eric Snow:
In recent PEP 451-related discussions, the subject of reloading has come up
multiple times. Most recently, PJE suggested that reload semantics are
under-specified (and under-tested). [1][2]
It may be worth adding a dedicated section on reloading to the
Eric Snow added the comment:
Here's a new patch that is mostly up to date with the PEP. I still need to
work on Docs and add more tests. There are a few failing tests (due to the
recent reload patch) that I need to fix when I get a minute.
This patch also implements find_spec
Changes by Eric Snow :
Removed file: http://bugs.python.org/file32408/modulespec-primary-changes.diff
___
Python tracker
<http://bugs.python.org/issue18864>
___
___
Pytho
Changes by Eric Snow :
Added file: http://bugs.python.org/file32457/modulespec-primary-changes.diff
___
Python tracker
<http://bugs.python.org/issue18864>
___
___
Pytho
Changes by Eric Snow :
Removed file: http://bugs.python.org/file32456/modulespec-primary-changes.diff
___
Python tracker
<http://bugs.python.org/issue18864>
___
___
Pytho
Eric Snow added the comment:
You could add the following to the bottom of this.py:
import sys
del sys.modules['this']
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.o
Eric Snow added the comment:
+0 to just doing a reload. At the point you show someone "import this", it may
be premature to be explaining reloading to them. Python is great because you
usually don't have to hand-wave through some concepts in order to explain
others. [1]
Als
Eric Snow added the comment:
The view objects aren't sequences. od.items() and od.keys() implement Set.
od.values() doesn't even do that much, only implementing __len__(), __iter__(),
and __contains__().
The glossary implies that you should use "reversed(list(view))". [1
Eric Snow added the comment:
PEP 432 relates pretty closely here.
--
nosy: +eric.snow, ncoghlan
___
Python tracker
<http://bugs.python.org/issue19518>
___
___
Eric Snow added the comment:
PEP 432 is all about the PyRun_* API and especially relates to refactoring it
with the goal of improving extensibility and maintainability. I'm sure Nick
could expound, but the PEP is a response to the cruft that has accumulated over
the years in P
Eric Snow added the comment:
A lot of thought went into Python 3 changes, including making print a function
(see PEP 3105). While typing efficiency may be appealing, keep in mind that
generally code will be read more than written. There are other programming
languages that highly value
Eric Snow added the comment:
Hurray!
--
___
Python tracker
<http://bugs.python.org/issue16803>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
I've created a server-side clone for the implementation:
http://hg.python.org/features/pep-451/
--
___
Python tracker
<http://bugs.python.org/is
Eric Snow added the comment:
Okay, I've updated the pep451 branch in the clone to include as much of the
implementation as I've completed, which is the bulk of the functional changes.
It's enough to pass the test suite.
Here's what I'd like to get done before th
Eric Snow added the comment:
"1." was intentionally left blank
--
___
Python tracker
<http://bugs.python.org/issue18864>
___
___
Python-bugs-l
Eric Snow added the comment:
Sorry that wasn't more clear. I committed the changes from the
modulespec-primary-changes.diff patch to the pep451 branch in the server-side
clone. Those changes are:
Step 1
--
1. added ModuleSpec class
2. added _SpecMethods wrapper class
3. added Modul
Eric Snow added the comment:
Regarding tests, a bunch of importlib (and other?) tests make direct calls to
find_module(), find_loader(), or load_module(). These are still working, as
expected. However, we should probably either replace them or supplement them
with equivalent tests that make
Eric Snow added the comment:
> Yeah, don't replace any tests, add new ones for the new APIs.
That's what makes the most sense to me too.
> Given the
> needs of 2/3 compatible loader implementations, the deprecations referred
> to in the PEP should also be documentation-o
Eric Snow added the comment:
> (I still like the idea of passing
> a target to importlib.find_spec - I just no longer think we should be
> passing that down to the finders themselves).
Passing the target to the finders isn't just for the sake of any implicit
"check_target
Eric Snow added the comment:
Sounds good. It will be worth adding a note to the load_module() docs
indicating the limited cases where it is still appropriate, and encouraging the
use of exec_module() instead.
--
___
Python tracker
<h
Eric Snow added the comment:
I'm running the pep-451 clone against 2 buildbots for now:
*
http://buildbot.python.org/all/builders/x86%20Windows%20Server%202003%20%5BSB%5D%20custom
* http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%20custom
The ubuntu one is happy with the fe
Eric Snow added the comment:
The OS X buildbot I used [1] did not exhibit any of the failures that Windows
server 2003 showed.
[1] http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%20custom
--
___
Python tracker
<http://bugs.python.
Eric Snow added the comment:
The Windows 7 buildbot I tried [1] shows the exact same failures that the
server 2003 does.
[1] http://buildbot.python.org/all/builders/x86%20Windows7%20custom
--
___
Python tracker
<http://bugs.python.org/issue18
Eric Snow added the comment:
Naturally the other Windows buildbot I tried did not fail any import-related
tests. So much for consistency. :(
http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%20custom
--
___
Python tracker
<h
Eric Snow added the comment:
> The three Windows machines look like they have very different system
> versions of Python (ActiveState, cygwin, vanilla CPython). Any chance we're
> accidentally invoking the system Python instead of the built one somewhere?
Good point. I'll ch
Eric Snow added the comment:
> I think worrying about more API expansions to handle edge case/advanced
> reload scenarios is not worth it (or at least not in Python 3.4).
Agreed.
--
___
Python tracker
<http://bugs.python.org/i
Eric Snow added the comment:
Regarding the to-do list, I'm going to add a TODO file to the root of the
feature clone (in the pep451 branch) so we don't have to keep updating this
ticket. :)
--
___
Python tracker
<http://bugs.python.o
Eric Snow added the comment:
FYI, as of cc7ebd952777 the bulk of the implementation in features/pep-451 is
working.
There is a failing test on the Windows Server 2003 buildbot (which I'm trying
to track down). I haven't been able to reproduce the failure on other
buildbots, o
Eric Snow added the comment:
Cool. Roundup linked the revision hash to the feature clone. :)
--
___
Python tracker
<http://bugs.python.org/issue18864>
___
___
Eric Snow added the comment:
The this module was actually the subject of a similar proposal recently:
issue19499. The same arguments there for leaving the module alone apply here.
(Amon other things, it's a neat little artifact:
http://www.wefearchange.org/2010/06/import-this-and-z
Eric Snow added the comment:
I left a review relative to the use of the _path attribute (which shouldn't be
used).
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/is
Eric Snow added the comment:
Sorry for any confusion, Claudiu. the_module.__path__ only indicates that the
module is a package. So until you can take advantage of PEP 451, you're stuck
with the _path check (or several other unappealing hack) on line 224 of
unittest-17457-3.patch.
Ho
Eric Snow added the comment:
Brett: looks like something frozen-related broke due to 6d1656ab2c85a527c.
test_frozen in test_frozen.py is failing now because frozen modules no longer
have a __cached__ attribute (which was previously set to None). Previously it
was set in
Changes by Eric Snow :
--
nosy: +benjamin.peterson
___
Python tracker
<http://bugs.python.org/issue19655>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
As far as I'm aware, the performance of __repr__() for any object is not much
of a concern. Repr is mostly for debugging and interactive use, so it's
already fast/efficient enough for the target consumers: us. :) Making
__repr__() easier to write or m
Eric Snow added the comment:
Larry: thoughts?
--
nosy: +larry
___
Python tracker
<http://bugs.python.org/issue3158>
___
___
Python-bugs-list mailing list
Unsub
Eric Snow added the comment:
> they make the decorator harder to read.
I agree.
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issu
Eric Snow added the comment:
I've updated the TODO a little as well as cleaning up the XXX markers. The
relevant ones are mostly just open questions on implementation tweaks, so
nothing major. Otherwise my goal is to finish as much as possible of the
non-critical items before the
Eric Snow added the comment:
FYI, the C OrderedDict implementation in #16991 implements its own
doubly-linked list, built around the needs of OrderedDict. I looked into BSD's
queue.h [1], but it ended up simpler to roll my own.
[1] http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/queue.
Eric Snow added the comment:
As an alternative, how about turning _source into a property?
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue19
New submission from Eric Snow:
This is closely related to issue #19697.
--
___
Python tracker
<http://bugs.python.org/issue19700>
___
___
Python-bugs-list mailin
New submission from Eric Snow:
Isn't this basically the same thing as issue #19697?
--
___
Python tracker
<http://bugs.python.org/issue19709>
___
___
Pytho
Eric Snow added the comment:
See http://www.python.org/dev/peps/pep-0451/#deprecations.
--
___
Python tracker
<http://bugs.python.org/issue19713>
___
___
Pytho
Eric Snow added the comment:
Failing buildbot:
http://buildbot.python.org/all/builders/x86%20XP-4%203.x/builds/9630/steps/test/logs/stdio
test.test_module.ModuleTests.test_module_repr_source
test.test_pkgutil.ExtendPathTests.test_iter_importers (passed when retried
New submission from Eric Snow:
Some exceptions in importlib are raised from within except blocks, resulting in
chained tracebacks. [1] For at least some of these we should consider
suppressing the exception context.
For example (for [1]):
try:
path = parent_module
Changes by Eric Snow :
--
resolution: -> duplicate
status: pending -> closed
superseder: -> refactor pythonrun.c to make use of specs (__main__.__spec__)
___
Python tracker
<http://bugs.python.or
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue19701>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
+1
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue19696>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
I was thinking the same thing as Antoine. 18 fits in more closely to what I
understand is the purpose of asyncio (the focus on IO).
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue19
Eric Snow added the comment:
+1
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue19721>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
FWIW, I agree with Antoine about making those PyCompile_ functions private
(leading "_").
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.o
New submission from Eric Snow:
http://buildbot.python.org/all/builders/x86%20Gentoo%203.x/builds/5448/steps/test/logs/stdio
==
ERROR: test_iter_importers (test.test_pkgutil.ExtendPathTests
Eric Snow added the comment:
This appears to be order-related, like the last failure was. To reproduce:
$ ./python -m test test_importlib test_pkgutil
--
___
Python tracker
<http://bugs.python.org/issue19
Changes by Eric Snow :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue19724>
___
___
Python-bugs-list
Eric Snow added the comment:
A while back, because of those python-ideas discussions, Raymond added a link
at the bottom of the namedtuple section of the docs at
http://docs.python.org/3.4/library/collections.html#namedtuple-factory-function-for-tuples-with-named-fields.
The link points to a
Eric Snow added the comment:
It's definitely worth it to be more explicit. (Brett had referenced
msg202663.) When I get some time I'll update this ticket with a list of the
specific deprecation items.
--
___
Python trac
Eric Snow added the comment:
I've already started on this somewhat. However, I'm going to close out more of
the other PEP 451 issues before going any further.
Nick: when do you think things will settle down that you could field a question
or two and some reviews relative to th
Eric Snow added the comment:
The concern, as far as I understand it, is that any change might introduce
regressions or even new bugs in the next beta. Something like swapping out the
parser generator implementation isn't a bug fix, but it isn't a new language
(incl. stdlib) feat
Changes by Eric Snow :
--
keywords: +easy
___
Python tracker
<http://bugs.python.org/issue19820>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric Snow:
The docs for the inspect module and the types module do not list all the
import-related module attributes. I'm guessing they've been out of sync a
while.
The docstring for for inspect.ismodule() is likewise missing information.
--
assignee: d
New submission from Eric Snow:
The inspect module doesn't need any changes.
--
resolution: -> works for me
stage: -> committed/rejected
type: -> enhancement
___
Python tracker
<http://bugs.pyth
New submission from Eric Snow:
I don't recall the specifics of how we'd talked about making use of module
specs in pickle. I vaguely remember (or misremember ) something related
to saving __main__.__spec__.name in the pickle rather than __main__.__name__.
Anyone have anything mor
New submission from Eric Snow:
pydoc.ispackage() is a best-effort guess at whether or not a path is the
location of a package. However, it uses hard-coded suffixes when matching file
names, which can miss files (e.g. extension modules and sourceless packages on
Windows). It should probably
New submission from Eric Snow:
Here are the functions that should (?) be updated:
synopsis()
importfile()
safeimport()?
HTMLDoc.docmodule()
HTMLDoc.index()
TextDoc.docmodule()
ModuleScanner.run()?
--
___
Python tracker
<http://bugs.python.
Eric Snow added the comment:
In Lib/multiprocessing/spawn.py the following need changing:
get_preparation_data()
import_main_path()
--
dependencies: +refactor pythonrun.c to make use of specs (__main__.__spec__)
___
Python tracker
<h
Changes by Eric Snow :
--
title: Upate pydoc to PEP 451 -> Update pydoc to PEP 451
___
Python tracker
<http://bugs.python.org/issue19703>
___
___
Python-
Changes by Eric Snow :
--
dependencies: +Update runpy for PEP 451
___
Python tracker
<http://bugs.python.org/issue19697>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Is the problem here that builtins (and extension modules) don't necessarily
obey the rules to the letter? load_module() is supposed to use whatever is in
sys.modules. [1] (BuiltinImporter.load_module() is essentially a synonym for
_imp.init_builtin(),
Eric Snow added the comment:
_run_module_as_main() is particularly related to #19697.
--
___
Python tracker
<http://bugs.python.org/issue19700>
___
___
Python-bug
Eric Snow added the comment:
This is actually a problem with importlib.reload() (which imp.reload() simply
wraps). The attached patch provides a test that reproduces the error. I'll
work on a fix ASAP.
Interestingly, the kind of failure depends on frozen vs. source impo
Eric Snow added the comment:
Actually, they're both getting the same error:
AttributeError: 'NoneType' object has no attribute 'name'
I forgot to clear the submodule from sys.modules first.
--
___
Python tracker
<http:
New submission from Eric Snow:
ModuleSpec.__eq__() does a comparision of its various attributes, one of them
being the loader. However, the __eq__() of the path-based loaders is just the
stock one that compares object identity. So most
--
messages: 205515
nosy: brett.cannon
Eric Snow added the comment:
(my browser farted the half finished report into existence :P )
The __eq__() implementation of the path-based loaders in importlib is just the
stock one that compares object identity. So two that are effectively the same
compare unequal. This has a material
Changes by Eric Snow :
--
Removed message: http://bugs.python.org/msg205515
___
Python tracker
<http://bugs.python.org/issue19927>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
The problem was that importlib.reload() was not passing the parent's __path__
to importlib._bootstrap._find_spec(). This was a consequence of us restoring
the pre-3.3 reload semantics.
Patch attached. (Note to self: add Misc/NEWS entry)
--
stage:
Changes by Eric Snow :
Removed file: http://bugs.python.org/file33033/issue19851-test.diff
___
Python tracker
<http://bugs.python.org/issue19851>
___
___
Python-bug
Eric Snow added the comment:
Here's a patch.
--
keywords: +patch
stage: test needed -> patch review
Added file: http://bugs.python.org/file33038/issue19927-loader-eq.diff
___
Python tracker
<http://bugs.python.org
Eric Snow added the comment:
Good catch. My preference would be for (c) simply add a setter for the
property that sets the underlying private variable to True or False.
--
___
Python tracker
<http://bugs.python.org/issue18
New submission from Eric Galloway:
In Python 3 on Windows, pydoc fails to display source file listings in the
browser.
To reproduce in Python 3.4:
1. start pydoc:
python -m pydoc -p
2. Navigate to the url:
http://127.0.0.1:/getfile?key=///C:/python34/lib
Changes by Eric Woudenberg :
--
versions: +Python 2.7 -Python 3.4
Added file: http://bugs.python.org/file36465/wave.py
___
Python tracker
<http://bugs.python.org/issue1483
Changes by Eric Woudenberg :
Added file: http://bugs.python.org/file36466/test_wave.py
___
Python tracker
<http://bugs.python.org/issue1483545>
___
___
Python-bugs-list m
New submission from Eric Fulton:
I believe the diagram showing how slices works from
https://docs.python.org/2/tutorial/introduction.html is incorrect. There
should be no 6.
>>> word = 'Python'
>>> word[6]
IndexError: string index out of range
Original:
+-
Changes by Eric Snow :
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Eric Snow added the comment:
Good point, Nick. Here's a patch that follows your recommendation on both
points.
--
Added file: http://bugs.python.org/file33072/issue19927-loader-eq.diff
___
Python tracker
<http://bugs.python.org/is
Changes by Eric Snow :
Removed file: http://bugs.python.org/file33038/issue19927-loader-eq.diff
___
Python tracker
<http://bugs.python.org/issue19927>
___
___
Python-bug
Eric Snow added the comment:
Here's a patch for adding a setter for ModuleSpec.has_location.
--
Added file: http://bugs.python.org/file33073/issue18864-has-location-setter.diff
___
Python tracker
<http://bugs.python.org/is
New submission from Eric Snow:
In the last Python releases, particularly 3.3 and 3.4, we've made improvements
to the import machinery that render (at least) portions of pkgutil obsolete.
Here's a breakdown of the public API of pkgutil:
get_importer() - duplicate of
Eric Snow added the comment:
patch LGTM
--
___
Python tracker
<http://bugs.python.org/issue19700>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
As a testament to counter-intuitive API, I did not even realize this about
either find_loader() or find_spec() until the bug the other day with reloading
submodules. So I'm on board!
As to the best approach, I'll argue for keeping just 1 function. I
Eric Snow added the comment:
This came up in issue19946.
--
nosy: +sbt
___
Python tracker
<http://bugs.python.org/issue19701>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
There is definitely room for improvement relative to module specs and __main__
(that's the topic of issue #19701). That issue is waiting for __main__ to get
a proper spec (see issues #19700 and #19697).
--
___
P
Eric Snow added the comment:
Here's a patch for the deprecations (and API additions) in the importlib docs.
--
keywords: +patch
Added file: http://bugs.python.org/file33088/issue19713-importlib-docs.diff
___
Python tracker
<http://bugs.py
Eric Snow added the comment:
I've attached a patch to issue19713 (file33088) that adds documentation for the
new APIs. Also, there were some good reviews in issue18864 (especially for
file32381) that never got fully addressed.
--
___
P
Changes by Eric Snow :
--
dependencies: -Implement _imp.exec_builtin and exec_dynamic
___
Python tracker
<http://bugs.python.org/issue18864>
___
___
Python-bug
Changes by Eric Snow :
--
nosy: +loewis
___
Python tracker
<http://bugs.python.org/issue19714>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
It looks like there are two concepts at play though:
1. side-effect-free vs. may-have-side-effects
2. just-find-the-spec-dangit vs.
find-the-spec-relative-to-submodule-search-locations-I-already-know
In the case of #1, providing the path is just a means to an end
Changes by Eric Snow :
--
nosy: +lemburg
___
Python tracker
<http://bugs.python.org/issue19968>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Nick: that sounds good to me. I like the idea of find_spec() being the same as
import_module(), minus actually loading the module.
In that spirit, here's a rough patch that accomplishes that. It refactors
things a bit to get there. Considering where we a
Eric Snow added the comment:
Here's a version that I'd feel more comfortable with for 3.4 (with the intent
of refactoring in 3.5).
--
Added file:
http://bugs.python.org/file33112/issue19944-find-spec-mirror-import-module-simple.diff
Eric Snow added the comment:
New changeset 2c27c0e5bc50 by Eric Snow in branch 'default':
Issue #19713: Update importlib docs for module spec changes, including
deprecations.
http://hg.python.org/cpython/rev/2c27c0e5bc50
New changeset b78de8029606 by Eric Snow in branch 'default
2701 - 2800 of 6587 matches
Mail list logo