Eric Snow added the comment:
> Serialization isn't the only issue - you have to know how
> to deserialize as well.
+1
> (TBH, I wish the json module had better hooks for extending
> both serialization and deserialization of non-basic types.)
+1
There's at least one s
Eric Snow added the comment:
I figured out what I hope were the last memory-related issues. Apparently
tp_traverse is not inherited if tp_flags is set. I had it set on all the view
types and all the iterator types. So during GC it would blow up when it tried
to call tp_traverse
Changes by Eric Snow :
Removed file: http://bugs.python.org/file30468/cOrderedDict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list m
Eric Snow added the comment:
For the record, issue12633 has some more discussion on this.
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17
Eric Snow added the comment:
issue17953 addressed part of this.
--
___
Python tracker
<http://bugs.python.org/issue12633>
___
___
Python-bugs-list mailin
Changes by Eric Snow :
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue15004>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric Snow :
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue17421>
___
___
Python-bugs-list mailing list
Unsubscri
Eric Snow added the comment:
The gains here aren't worth the hassle in my mind, and I've lost interest in
pushing this forward any further. If anyone else wants to pick this up, feel
free to re-open the issue.
--
assignee: eric.snow ->
resolution: -> rejected
status
Changes by Eric Snow :
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue16251>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric Snow :
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue16223>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric Snow :
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue12598>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric Snow :
--
assignee: -> eric.snow
___
Python tracker
<http://bugs.python.org/issue12857>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue11698>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue15729>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue7434>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
A NamedTuple ABC doesn't have to define any API (so that part could wait?)[1].
I see it as most useful for isinstance checks. Here's a solution along those
lines:
class NamedTuple(Sequence):
@classmethod
def __subclasshook__(cls, C):
Eric Snow added the comment:
Would we also want to implement _make().
--
___
Python tracker
<http://bugs.python.org/issue1820>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Hi Mathias. There is a current proposal
(http://www.python.org/dev/peps/pep-0432/) for improving interpreter startup.
So changes in this area are subject to extra caution. The changes you are
talking about are at least indirectly impacted by the proposal
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18093>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
A backward compatible solution would be to do lookup on the class after trying
the instance (and that came back None or isn't callable).
--
___
Python tracker
<http://bugs.python.org/is
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18335>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
OrderedDict already copies the instance dict in __reduce__(). Are you talking
about something more than that?
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18342>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
> I'm sorry, but this seems like it should be an importlib internal
> affair. The new exception is too much in everyone's face, because
> the exception name gets printed on every traceback.
That's the crux of the issue. If there is
Eric Snow added the comment:
> I think you are overreacting.
Yeah, maybe so. :) I just found the problem I ran into to be really hard to
diagnose due to how pickle does lookup, and figured it would be worth
addressing to save someone else the same headache la
Eric Snow added the comment:
Looks good to me. What else needs to be done in this area that will help with
work on PEP 432?
--
___
Python tracker
<http://bugs.python.org/issue18
Eric Snow added the comment:
What about Modules/main.c?
--
___
Python tracker
<http://bugs.python.org/issue18093>
___
___
Python-bugs-list mailing list
Unsub
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18364>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Out of the box thinking, eh?
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18362>
___
___
Python-bugs-list m
Eric Snow added the comment:
Same here.
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18357>
___
___
Python-bugs-list mailing list
Unsub
Eric Snow added the comment:
That'll work. :)
--
___
Python tracker
<http://bugs.python.org/issue18364>
___
___
Python-bugs-list mailing list
Unsubsc
Eric Snow added the comment:
At the risk of unnecessary complication, there is also other information that
could be output, depending on the referenced object (module vs. class/func via
qualname). For instance, a module's __file__ would be handy. So, the output
could have a "he
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue11619>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Nick was probably talking about what is further elaborated in PEP 343. I'd
recommend taking a particular look at the "Motivation and Summary" section
regarding flow control macros.
--
nosy: +eric.snow
___
New submission from Eric Snow:
Currently reload() returns the module that loader.load_module() returns, rather
than returning the one in sys.modules. This is different from what happens
during normal import. I would expect reload() to return what's in sys.modules.
Perhaps thi
Eric Snow added the comment:
> I'm currently leaning towards having sys.path_importer_cache store
> the actual directory name.
Makes sense to me. It the problem that sys.path will still have '' in it and
it may be hard to figure out what it means (and how it maps to
sy
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue14465>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
This bit me today (under 2.7).
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue5516>
___
___
Python-bugs-list m
Eric Snow added the comment:
I'm doing some string-based serialization of datetimes and need to be able to
specify the type somewhat declaratively. So I'm using a datetime subclass.
This is more or less the code I'm using:
class Timestamp(datetime.datetime):
def __new__
Eric Snow added the comment:
Yep. In 2.7 and 3.2 the PyImport_ExecCodeModuleEx() function in
Python/importlib.c returns the module found in sys.modules. Here is a patch.
I suppose this should be fixed in 2.7 as well. Thoughts?
--
keywords: +patch
stage: -> patch review
Added f
Eric Snow added the comment:
oops. That commit message for 3.3 should have read "imp.reload()". :)
--
resolution: -> fixed
stage: patch review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs
Eric Snow added the comment:
Regarding this:
>>> def f():
... import html.entities
... del sys.modules['html']
...
>>> f()
>>> import html.entities
>>> html.entities
Traceback (most recent call last):
File "", line 1, in
At
Eric Snow added the comment:
Couldn't you make use of inspect.getattr_static()?
getattr_static(obj.__class__, '__index__').__get__(obj)()
getattr_static() does some extra work to get do the right lookup. I haven't
verified that it matches _PyType_Lookup() exactly, but
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue3158>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue16938>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17972>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Eric Snow:
>>> pprint.pprint(inspect.classify_class_attrs(object))
[Attribute(name='__class__', kind='data', defining_class=,
object=),
...
Attribute(name='__init__', kind='method', defining_class=,
object=),
...
Attr
Eric Snow added the comment:
My guess is that, in part, it's left-over code from before the switch to
importlib. However, it relies on builtins.__import__(), which isn't guaranteed
to work correctly, hence one last sync with sys.modules. I'm not convinced
that justifies not s
Eric Snow added the comment:
Isn't this related somewhat to #7732?
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue18810>
___
___
Pytho
New submission from Eric Snow:
It would be helpful to have __subclasshook__() implemented on the finders and
loaders in importlib.abc, following the approach taken by ABCs in
collections.abc. This came up relative to PEP 431, but would be generally
useful (if only to a limited audience
New submission from Eric Snow:
This ticket will track the implementation for PEP 451 (ModuleSpec). I'll have
a patch up in the next couple days.
--
assignee: eric.snow
components: Interpreter Core, Library (Lib)
messages: 196352
nosy: eric.snow
priority: normal
severity: normal
Eric Snow added the comment:
+1 This is worth trying.
--
nosy: +Mark.Shannon, eric.snow
___
Python tracker
<http://bugs.python.org/issue18898>
___
___
Python-bug
Eric Snow added the comment:
I'm also -1, though I do appreciate the "indicating intent" argument. What's
the risk that someone will accidentally overwrite an enum item? Also, is there
other enum functionality that relies on the continued existence of the initial
enum
Eric Snow added the comment:
> I would agree with Eli and Eric if it wasn't for that problem.
Agreed. That was the gist of my question that led to Ethan's example. If it's
easy to accidentally break an enum, particularly in a subtle way, then it may
not be worth taking a
Eric Snow added the comment:
It is the module that gets removed. I suppose it could say, "...created the
module, then that module is subsequently...". Would that help?
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.o
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue12599>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Loaders are in charge of adding the module to sys.modules (per PEP 302).
importlib codifies this in the module_for_loader() decorator, which the default
loaders use.
--
nosy: +eric.snow
___
Python tracker
<h
Eric Snow added the comment:
3.3.0a2+:
>>> import x
>>> x
>>> import sys
>>> sys.modules['x']
5
>>> x
5
--
___
Eric Snow added the comment:
_find_and_load() in importlib._bootstrap returns whatever the loader returns,
which is the new module object. The old code in import.c pulled it from
sys.modules rather than using what the loader returned. In both cases the
respective object is what eventually
Eric Snow added the comment:
2 "problems" with that last patch:
* the types of the loaders that get returned by _bootstrap._find_module() are
not the classes in _bootstrap (e.g. _frozen_importlib._SourceFileLoader). That
doesn't smell right.
* tokenize.get_encoding? is sayin
Eric Snow added the comment:
rather, tokenize.detect_encoding()
--
___
Python tracker
<http://bugs.python.org/issue13959>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
that's a pretty sneaky hack, but I can see the (weak) point of it. So, to keep
backward compatibility, importlib._bootstrap._find_and_load() would have to
return sys.modules[fullname] instead of the module returned by
loader.load_module(fullname)
Eric Snow added the comment:
> I would advocate breaking any compatability.
Did you mean "against breaking any compatability"? The problem is that it's
just one more sticky little detail that adds to the complexity of understanding
the import system. It's things lik
Eric Snow added the comment:
On the _frozen_importlib point, I'm fine with that. It was just
counter-intuitive that the importlib._bootstrap functions were returning
loaders whose classes weren't also defined there.
I'll have another look at that test tonight and run the pa
Eric Snow added the comment:
The original motivator:
http://mail.python.org/pipermail/python-dev/2011-July/112497.html
--
___
Python tracker
<http://bugs.python.org/issue12
Eric Snow added the comment:
The patch is out of date, but the question is still somewhat applicable.
--
versions: +Python 3.3
___
Python tracker
<http://bugs.python.org/issue12
New submission from Eric Snow :
Once the dust clears from the issue 2377 and issue 13959, we should consider
what import-state-related members of PyInterpreterState (Include/pystate.h) can
be removed. This is in the interest of simplifying the interpreter state.
The most straightforward
Eric Snow added the comment:
also, issue 14615 is related to making sys.modules authoritative.
--
___
Python tracker
<http://bugs.python.org/issue12633>
___
___
Eric Snow added the comment:
Curse you, undocumented API that we have to support! It could still wrap a
simple get() on sys.modules, roughly like this:
PyObject*
PyState_FindModule(struct PyModuleDef* m)
{
PyObject* modules, module;
modules = PyImport_GetModuleDict();
if (modules
Eric Snow added the comment:
Sorry, Martin, for not looking at PEP 3121 before. I was thinking
modules_by_index was a lot older.
--
___
Python tracker
<http://bugs.python.org/issue14
Eric Snow added the comment:
Rather than being arbitrary, the motivation here is to limit amount of the
import state that is specific to CPython. I apologize that that wasn't clear.
The three import-related members of PyInterpreterState (modules,
modules_reloading, and modules_by_
New submission from Eric Snow :
Once imp.reload() is moved to imp.py, and the code is stripped from
Python/import.c, we can see where modules_reloading stands. I expect that it
will have become entirely superfluous at that point.
--
components: Interpreter Core
messages: 158691
nosy
Eric Snow added the comment:
for modules_reloading, issue14618
--
___
Python tracker
<http://bugs.python.org/issue14615>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Thanks for your feedback, Martin. I'll go ahead and make a new issue for
modules_reloading (and one for interp->modules when appropriate).
--
resolution: -> rejected
status: open -> closed
___
Python
Eric Snow added the comment:
see issue14615 for the broader picture
--
___
Python tracker
<http://bugs.python.org/issue14618>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Looking it over, I'm confident that tokenizer.detect_encoding() does not raise
a SyntaxError where PyTokenizer_FindEncodingFilename() does. I've run out of
time tonight, but I'll look at it more tomorrow.
Once find_module() is done, I'd like
New submission from Eric Snow :
(see #14609 and #14582)
http://docs.python.org/dev/reference/simple_stmts.html#the-import-statement
The specification for the import statement says the following:
"The first form of import statement binds the module name in the local
namespace to the m
New submission from Eric Snow :
(see http://mail.python.org/pipermail/python-dev/2012-April/118889.html)
The behavior of tokenize.detect_encoding() and
PyTokenizer_FindEncodingFilename() is unexpectedly different and this has
bearing on the current work on imports.
When a file has no
Changes by Eric Snow :
Added file: http://bugs.python.org/file25284/setup.py
___
Python tracker
<http://bugs.python.org/issue14629>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Thanks, Martin! That did the trick.
--
versions: +Python 3.2
___
Python tracker
<http://bugs.python.org/issue14629>
___
___
Pytho
New submission from Eric Snow :
test_find_module_encoding (in Lib/test/test_imp.py), has the following check:
self.assertRaisesRegex(SyntaxError,
r"Non-UTF-8 code starting with '\\xf6'"
r" in file .*badsyntax_pep3120.py",
imp.find_mod
Changes by Eric Snow :
--
components: +Tests
title: test_find_module_encoding should test for a less specific message (or ->
test_find_module_encoding should test for a less specific message
versions: +Python 3.3
___
Python tracker
&l
Eric Snow added the comment:
or even _not_ check the message string?
--
___
Python tracker
<http://bugs.python.org/issue14633>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Apparently the message string contained by the SyntaxError is different between
the two. I noticed due to the hard-coded check in test_find_module_encoding
(in Lib/test/test_imp.py). I've brought up the specific issue of that
hard-coded message che
Eric Snow added the comment:
Sounds mostly right. sys.modules[name] won't necessarily contain a module
object, as Benjamin brought up in issue14609.
--
___
Python tracker
<http://bugs.python.org/is
Eric Snow added the comment:
thanks, Brett! That did the trick.
--
___
Python tracker
<http://bugs.python.org/issue14633>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Looks good. Thanks for the help, Martin and Brett.
--
___
Python tracker
<http://bugs.python.org/issue14629>
___
___
Python-bug
Eric Snow added the comment:
I'd still like to consider this a bit more. When you're trying to understand
imports, having one place to look (Lib/importlib/_bootstrap.py) is better than
two, especially when the one is pure Python code. So it still may be worth it
to pull in th
Eric Snow added the comment:
Yeah, I'm hoping to keep pressing those odds and ends forward. I have one
lingering, oddball bug in find_module, but that patch is pretty much standing
on its own.
--
___
Python tracker
<http://bugs.py
Eric Snow added the comment:
Ported _imp.reload() (Python/import.c) to Lib/imp.py. Included is the change
to PyImport_ReloadModule() to make it simply a wrapper around the pure Python
imp.reload(). There's a good chance I don't have this right or that I have
some reference leak.
Eric Snow added the comment:
patch added to issue13959.
--
___
Python tracker
<http://bugs.python.org/issue14618>
___
___
Python-bugs-list mailing list
Unsub
Eric Snow added the comment:
A patch for magic and tag. It's not quite finished, but I wanted to see if the
approach was palatable. FYI, I'm also trying to push forward the
sys.implementation stuff, which would help on the pyc tag.
--
Added file: http://bugs.python.org
Eric Snow added the comment:
After thinking about it, is MAGIC an implementation detail? It certainly
reflects changes specific to the CPython interpreter. I'm much more
comfortable with leaving implementation details in Python/import.c.
On the other hand, there's already no sm
Eric Snow added the comment:
Yeah, that patch for reload() in issue13959 relies on this.
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue14
Eric Snow added the comment:
Good feedback. The some of that code was the result of directly translating
the C. I'll get a new, simpler patch up probably tomorrow night. Thanks.
--
___
Python tracker
<http://bugs.python.org/is
Eric Snow added the comment:
How consistent do the semantics of reload() need to remain? (The C version
does more type checking than the Python version probably needs to worry about.
reload() seems to be one of those bits that doesn't have much test coverage.)
Also, what's the b
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue14657>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
updated patch for magic number support in imp/importlib
--
Added file: http://bugs.python.org/file25335/issue13959_magic.diff
___
Python tracker
<http://bugs.python.org/issue13
Eric Snow added the comment:
updated patch for moving TAG to importlib/imp.py
--
Added file: http://bugs.python.org/file25336/issue13959_tag.diff
___
Python tracker
<http://bugs.python.org/issue13
Eric Snow added the comment:
> would be great if we had a
> command to stop module execution or code execution for a block to
> make that more elegant, e.g. "break" at module scope :-)
I floated that proposal on python-list a while back and the reaction was mixed.
[1] May
2001 - 2100 of 6441 matches
Mail list logo