[issue18264] enum.IntEnum is not compatible with JSON serialisation

2013-06-19 Thread Eric Snow
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

[issue16991] Add OrderedDict written in C

2013-06-20 Thread Eric Snow
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

[issue16991] Add OrderedDict written in C

2013-06-20 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file30468/cOrderedDict.diff ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Python-bugs-list m

[issue17953] sys.modules cannot be reassigned

2013-06-24 Thread Eric Snow
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

[issue12633] sys.modules doc entry should reflect restrictions

2013-06-24 Thread Eric Snow
Eric Snow added the comment: issue17953 addressed part of this. -- ___ Python tracker <http://bugs.python.org/issue12633> ___ ___ Python-bugs-list mailin

[issue15004] add weakref support to types.SimpleNamespace

2013-06-24 Thread Eric Snow
Changes by Eric Snow : -- assignee: -> eric.snow ___ Python tracker <http://bugs.python.org/issue15004> ___ ___ Python-bugs-list mailing list Unsubscri

[issue17421] Drop restriction that meta.__prepare__() must return a dict (subclass)

2013-06-24 Thread Eric Snow
Changes by Eric Snow : -- assignee: -> eric.snow ___ Python tracker <http://bugs.python.org/issue17421> ___ ___ Python-bugs-list mailing list Unsubscri

[issue17037] Use a test.support helper to wrap the PEP 399 boilerplate

2013-06-24 Thread Eric Snow
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

[issue16251] pickle special methods are looked up on the instance rather than the type

2013-06-24 Thread Eric Snow
Changes by Eric Snow : -- assignee: -> eric.snow ___ Python tracker <http://bugs.python.org/issue16251> ___ ___ Python-bugs-list mailing list Unsubscri

[issue16223] untokenize returns a string if no encoding token is recognized

2013-06-24 Thread Eric Snow
Changes by Eric Snow : -- assignee: -> eric.snow ___ Python tracker <http://bugs.python.org/issue16223> ___ ___ Python-bugs-list mailing list Unsubscri

[issue12598] Move sys variable initialization from import.c to sysmodule.c

2013-06-24 Thread Eric Snow
Changes by Eric Snow : -- assignee: -> eric.snow ___ Python tracker <http://bugs.python.org/issue12598> ___ ___ Python-bugs-list mailing list Unsubscri

[issue12857] Expose called function on frame object

2013-06-24 Thread Eric Snow
Changes by Eric Snow : -- assignee: -> eric.snow ___ Python tracker <http://bugs.python.org/issue12857> ___ ___ Python-bugs-list mailing list Unsubscri

[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2013-06-25 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue11698> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15729] PyStructSequence_NewType enhancement

2013-06-25 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue15729> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7434] general pprint rewrite

2013-06-25 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue7434> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7796] No way to find out if an object is an instance of a namedtuple

2013-06-25 Thread Eric Snow
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):

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-06-25 Thread Eric Snow
Eric Snow added the comment: Would we also want to implement _make(). -- ___ Python tracker <http://bugs.python.org/issue1820> ___ ___ Python-bugs-list mailin

[issue18309] Make python slightly more relocatable

2013-06-26 Thread Eric Snow
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

[issue18093] Move main functions to a separate Programs directory

2013-06-26 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue18093> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16251] pickle special methods are looked up on the instance rather than the type

2013-06-27 Thread Eric Snow
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

[issue18335] Add textwrap.dedent, .indent, as str methods.

2013-07-01 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue18335> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18352] collections.Counter with added attributes are not deepcopied properly.

2013-07-03 Thread Eric Snow
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

[issue18342] Use the repr of a module name for ModuleNotFoundError in ceval.c

2013-07-03 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue18342> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15767] add ModuleNotFoundError

2013-07-03 Thread Eric Snow
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

[issue16251] pickle special methods are looked up on the instance rather than the type

2013-07-03 Thread Eric Snow
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

[issue18093] Move main functions to a separate Programs directory

2013-07-03 Thread Eric Snow
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

[issue18093] Move main functions to a separate Programs directory

2013-07-03 Thread Eric Snow
Eric Snow added the comment: What about Modules/main.c? -- ___ Python tracker <http://bugs.python.org/issue18093> ___ ___ Python-bugs-list mailing list Unsub

[issue18364] Remove _not_found hack from importlib

2013-07-04 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue18364> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18362] Make build_cpython.py from dev-in-a-box work outside of a box

2013-07-05 Thread Eric Snow
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

[issue18357] add tests for dictview set difference operations

2013-07-05 Thread Eric Snow
Eric Snow added the comment: Same here. -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue18357> ___ ___ Python-bugs-list mailing list Unsub

[issue18364] Remove _not_found hack from importlib

2013-07-08 Thread Eric Snow
Eric Snow added the comment: That'll work. :) -- ___ Python tracker <http://bugs.python.org/issue18364> ___ ___ Python-bugs-list mailing list Unsubsc

[issue18626] Make "python -m inspect " dump the source of a module

2013-08-01 Thread Eric Snow
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

[issue11619] On Windows, don't encode filenames in the import machinery

2013-08-07 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue11619> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18677] Enhanced context managers with ContextManagerExit and None

2013-08-07 Thread Eric Snow
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 ___

[issue18698] importlib.reload() does not return the module in sys.modules

2013-08-09 Thread 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

[issue18416] Move to absolute file paths for module.__file__

2013-08-10 Thread Eric Snow
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

[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2013-08-11 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue14465> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Eric Snow
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

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Eric Snow
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__

[issue18698] importlib.reload() does not return the module in sys.modules

2013-08-13 Thread Eric Snow
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

[issue18698] importlib.reload() does not return the module in sys.modules

2013-08-14 Thread Eric Snow
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

[issue18706] test failure in test_codeccallbacks

2013-08-16 Thread Eric Snow
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

[issue18712] Pure Python operator.index doesn't match the C version.

2013-08-17 Thread Eric Snow
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

[issue3158] Doctest fails to find doctests in extension modules

2013-08-20 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue3158> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16938] pydoc confused by __dir__

2013-08-21 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue16938> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17972] inspect module docs omits many functions

2013-08-21 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue17972> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18801] inspect.classify_class_attrs() misclassifies object.__new__()

2013-08-21 Thread Eric Snow
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

[issue18812] PyImport_Import redundant calls to find module

2013-08-22 Thread Eric Snow
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

[issue18810] Stop doing stat calls in importlib.machinery.FileFinder to see if something is a file or folder

2013-08-23 Thread Eric Snow
Eric Snow added the comment: Isn't this related somewhat to #7732? -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue18810> ___ ___ Pytho

[issue18862] Implement __subclasshook__() for Finders and Loaders in importlib.abc

2013-08-27 Thread Eric Snow
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

[issue18864] Implementation for PEP 451 (importlib.machinery.ModuleSpec)

2013-08-27 Thread Eric Snow
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

[issue18898] Apply the setobject optimizations to dictionaries

2013-08-31 Thread Eric Snow
Eric Snow added the comment: +1 This is worth trying. -- nosy: +Mark.Shannon, eric.snow ___ Python tracker <http://bugs.python.org/issue18898> ___ ___ Python-bug

[issue18924] Enum members are easily replaced

2013-09-04 Thread Eric Snow
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

[issue18924] Enum members are easily replaced

2013-09-05 Thread Eric Snow
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

[issue18955] Confusing documentation in Lib/importlib/util.py

2013-09-06 Thread Eric Snow
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

[issue12599] Use 'is not None' where appropriate in importlib

2012-04-17 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue12599> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14609] can't modify sys.modules during import with importlib

2012-04-17 Thread Eric Snow
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

[issue14609] can't modify sys.modules during import with importlib

2012-04-17 Thread Eric Snow
Eric Snow added the comment: 3.3.0a2+: >>> import x >>> x >>> import sys >>> sys.modules['x'] 5 >>> x 5 -- ___

[issue14609] can't modify sys.modules during import with importlib

2012-04-17 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-17 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-17 Thread Eric Snow
Eric Snow added the comment: rather, tokenize.detect_encoding() -- ___ Python tracker <http://bugs.python.org/issue13959> ___ ___ Python-bugs-list mailin

[issue14609] can't modify sys.modules during import with importlib

2012-04-18 Thread Eric Snow
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)

[issue14609] can't modify sys.modules during import with importlib

2012-04-18 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-18 Thread Eric Snow
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

[issue12633] sys.modules doc entry should reflect restrictions

2012-04-18 Thread Eric Snow
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

[issue12598] Move sys variable initialization from import.c to sysmodule.c

2012-04-18 Thread Eric Snow
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

[issue14615] pull some import state out of the interpreter state

2012-04-18 Thread Eric Snow
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

[issue12633] sys.modules doc entry should reflect restrictions

2012-04-18 Thread Eric Snow
Eric Snow added the comment: also, issue 14615 is related to making sys.modules authoritative. -- ___ Python tracker <http://bugs.python.org/issue12633> ___ ___

[issue14615] pull some import state out of the interpreter state

2012-04-18 Thread Eric Snow
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

[issue14615] pull some import state out of the interpreter state

2012-04-18 Thread Eric Snow
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

[issue14615] pull some import state out of the interpreter state

2012-04-18 Thread Eric Snow
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_

[issue14618] remove modules_reloading from the interpreter state

2012-04-18 Thread Eric Snow
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

[issue14615] pull some import state out of the interpreter state

2012-04-18 Thread Eric Snow
Eric Snow added the comment: for modules_reloading, issue14618 -- ___ Python tracker <http://bugs.python.org/issue14615> ___ ___ Python-bugs-list mailin

[issue14615] pull some import state out of the interpreter state

2012-04-18 Thread Eric Snow
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

[issue14618] remove modules_reloading from the interpreter state

2012-04-18 Thread Eric Snow
Eric Snow added the comment: see issue14615 for the broader picture -- ___ Python tracker <http://bugs.python.org/issue14618> ___ ___ Python-bugs-list mailin

[issue13959] Re-implement parts of imp in pure Python

2012-04-19 Thread Eric Snow
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

[issue14628] Clarify import statement documentation regarding what gets bound

2012-04-19 Thread Eric Snow
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

[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()

2012-04-19 Thread Eric Snow
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

[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()

2012-04-19 Thread Eric Snow
Changes by Eric Snow : Added file: http://bugs.python.org/file25284/setup.py ___ Python tracker <http://bugs.python.org/issue14629> ___ ___ Python-bugs-list mailin

[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()

2012-04-20 Thread Eric Snow
Eric Snow added the comment: Thanks, Martin! That did the trick. -- versions: +Python 3.2 ___ Python tracker <http://bugs.python.org/issue14629> ___ ___ Pytho

[issue14633] test_find_module_encoding should test for a less specific message (or

2012-04-20 Thread Eric Snow
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

[issue14633] test_find_module_encoding should test for a less specific message

2012-04-20 Thread Eric Snow
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

[issue14633] test_find_module_encoding should test for a less specific message

2012-04-20 Thread Eric Snow
Eric Snow added the comment: or even _not_ check the message string? -- ___ Python tracker <http://bugs.python.org/issue14633> ___ ___ Python-bugs-list mailin

[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()

2012-04-20 Thread Eric Snow
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

[issue14628] Clarify import statement documentation regarding what gets bound

2012-04-20 Thread Eric Snow
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

[issue14633] test_find_module_encoding should test for a less specific message

2012-04-20 Thread Eric Snow
Eric Snow added the comment: thanks, Brett! That did the trick. -- ___ Python tracker <http://bugs.python.org/issue14633> ___ ___ Python-bugs-list mailin

[issue14629] discrepency between tokenize.detect_encoding() and PyTokenizer_FindEncodingFilename()

2012-04-20 Thread Eric Snow
Eric Snow added the comment: Looks good. Thanks for the help, Martin and Brett. -- ___ Python tracker <http://bugs.python.org/issue14629> ___ ___ Python-bug

[issue13959] Re-implement parts of imp in pure Python

2012-04-20 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-21 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow
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.

[issue14618] remove modules_reloading from the interpreter state

2012-04-22 Thread Eric Snow
Eric Snow added the comment: patch added to issue13959. -- ___ Python tracker <http://bugs.python.org/issue14618> ___ ___ Python-bugs-list mailing list Unsub

[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow
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

[issue14646] Require loaders set __loader__ and __package__

2012-04-22 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-22 Thread Eric Snow
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

[issue14657] Avoid two importlib copies

2012-04-23 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue14657> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13959] Re-implement parts of imp in pure Python

2012-04-23 Thread Eric Snow
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

[issue13959] Re-implement parts of imp in pure Python

2012-04-23 Thread Eric Snow
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

[issue14657] Avoid two importlib copies

2012-04-24 Thread Eric Snow
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

<    16   17   18   19   20   21   22   23   24   25   >