[issue24254] Make class definition namespace ordered by default

2016-06-03 Thread Eric Snow
Changes by Eric Snow : Added file: http://bugs.python.org/file43169/deforder.diff ___ Python tracker <http://bugs.python.org/issue24254> ___ ___ Python-bugs-list mailin

[issue27129] Wordcode, part 2

2016-06-04 Thread Eric Fahlgren
Changes by Eric Fahlgren : -- nosy: +eric.fahlgren ___ Python tracker <http://bugs.python.org/issue27129> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-06-05 Thread Eric Fahlgren
Eric Fahlgren added the comment: Thanks, Serhiy. I sort of figured that it would get fixed with the wordcode rework, and was going to verify that it was when 3.6 settled down. On Sun, Jun 5, 2016 at 8:30 AM, Serhiy Storchaka wrote: > > Serhiy Storchaka added the comment: > >

[issue27361] ValueError on eval after 'from pandas import *'

2016-06-21 Thread Eric Sprigg
New submission from Eric Sprigg: Using 'from pandas import *' leads to a ValueError exception being raised when eval tries to execute an expression like eval("df['Country'] == 'Brazil'") When the alternative form 'import pandas' is used

[issue24254] Make class definition namespace ordered by default

2016-07-05 Thread Eric Snow
Eric Snow added the comment: Here's an updated patch that matches the accepted PEP. Most notably I've added a tp_deforder slot. This was necessary because subclasses should not inherit their parent's __definition_order__ and the ability to delete cls.__definition_ord

[issue23722] During metaclass.__init__, super() of the constructed class does not work

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

[issue24254] Make class definition namespace ordered by default

2016-07-14 Thread Eric Snow
Eric Snow added the comment: FTR: PEP 520 "Preserving Class Attribute Definition Order" (https://www.python.org/dev/peps/pep-0520/) -- ___ Python tracker <http://bugs.python.o

[issue24254] Make class definition namespace ordered by default

2016-07-15 Thread Eric Snow
Eric Snow added the comment: post-review updates -- Added file: http://bugs.python.org/file43739/deforder-with-tp-slot.diff ___ Python tracker <http://bugs.python.org/issue24

[issue24254] Make class definition namespace ordered by default

2016-07-19 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file43629/deforder-with-tp-slot.diff ___ Python tracker <http://bugs.python.org/issue24254> ___ ___ Python-bug

[issue24254] Make class definition namespace ordered by default

2016-07-19 Thread Eric Snow
Changes by Eric Snow : -- hgrepos: -310 ___ Python tracker <http://bugs.python.org/issue24254> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Eric Snow added the comment: Are there any objections to this unittest cleanup patch? I'd like to commit it separately prior to anything that will go in for the C OrderedDict. -- Added file: http://bugs.python.org/file29077/cleanup-test-collections

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Eric Snow added the comment: Incidently, I'm just about done with the OrdereDict patch. I'm attaching the current one. At present it passes the unit tests, but I have two memory-related issues and a number of open questions (that I don't think are critical). The patch h

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file28839/cleanup-test-collections.diff ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Pytho

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file28956/odict.diff ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Python-bugs-list mailin

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Eric Snow added the comment: > Why did you copy test_collections.py instead of just creating > a new file? To preserve the history of changes to the bulk of the code in test_ordereddict.py. -- ___ Python tracker <http://bugs.python.org/i

[issue1615] descriptor protocol bug

2013-02-15 Thread Eric Snow
Eric Snow added the comment: Got bit by a variation of this today in 2.7: class Spam(object): def __getattr__(self, attr): raise AttributeError(attr) @property def eggs(self): return self.ham s = Spam() s.eggs Traceback (most recent call last): File "&quo

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Changes by Eric Snow : Added file: http://bugs.python.org/file29083/cleanup-test-collections.diff ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Python-bug

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file29083/cleanup-test-collections.diff ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Pytho

[issue16991] Add OrderedDict written in C

2013-02-15 Thread Eric Snow
Eric Snow added the comment: I should clarify, odict.diff passes test_ordereddict. Regardless, it's pretty close. I'm going to figure out why the review link hates me on this issue, but until then any extra eyes here would be appreciated. The memory-related issues are pushing we

[issue10965] dev task of documenting undocumented APIs

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

[issue16276] OrderedDict constructor do not keep items order

2013-02-16 Thread Eric Snow
Eric Snow added the comment: FWIW, I'm working toward making **kwargs an OrderedDict. First step: issue #16991 -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/is

[issue15003] make PyNamespace_New() public

2013-02-16 Thread Eric Snow
Eric Snow added the comment: At present, I don't see a need to make the C API public. -- status: open -> closed ___ Python tracker <http://bugs.python.org

[issue15022] types.SimpleNamespace needs to be picklable

2013-02-16 Thread Eric Snow
Changes by Eric Snow : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: +Python 3.4 -Python 3.3 ___ Python tracker <http://bugs.python.or

[issue15004] add weakref support to types.SimpleNamespace

2013-02-16 Thread Eric Snow
Eric Snow added the comment: I've yanked the __weakref__ attr--apparently builtins don't have them. I've also update the test. Is the updated test sufficient? I expect that if weakref.ref(ns) works, the rest of the weakref functionality works as well. -- A

[issue13124] Add "Running a Build Slave" page to the devguide

2013-02-16 Thread Eric Snow
Eric Snow added the comment: Looking this over, it seems like there were outstanding objections to adding this to the devguide and to the content. I still think the devguide is the right place and that something like my second patch would be appropriate. Before I take any time to update the

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

2013-02-16 Thread Eric Snow
Eric Snow added the comment: I've posted to python-dev about this: http://mail.python.org/pipermail/python-dev/2013-February/124114.html At the very least the pickle docs deserve some mention of the behavior. That way people won't need to spend as much time trying to figure out

[issue12633] sys.modules doc entry should reflect restrictions

2013-02-16 Thread Eric Snow
Eric Snow added the comment: One proposal would lead to the sys module growing descriptors: http://mail.python.org/pipermail/python-ideas/2013-January/019075.html In that case, sys.modules could update the underlying interp->modules. -- ___ Pyt

[issue15767] add ModuleNotFoundError

2013-02-16 Thread Eric Snow
Eric Snow added the comment: +1 on just getting it done with ModuleNotFoundError. FWIW, I'd be glad to do it. I'm taking a self-imposed break from the nearly finished C-OrderedDict! -- ___ Python tracker <http://bugs.python.o

[issue15767] add ImportNotFoundError

2013-02-19 Thread Eric Snow
Eric Snow added the comment: The common case for catching ImportError is exactly what ModuleNotFoundError represents. If people are already going to change their code to handle just this special case, I'd think having the subclass would be the better route. I find it simpler (both to u

[issue15767] add ImportNotFoundError

2013-02-19 Thread Eric Snow
Eric Snow added the comment: Right. Sorry I wasn't more clear. Existing code will continue to work either way. The point is in exposing the distinct module/name-not-found case, which I consider to be the common case for catching ImportError. My examples cover the case where you wa

[issue15004] add weakref support to types.SimpleNamespace

2013-02-19 Thread Eric Snow
Eric Snow added the comment: Good point. Thanks. I've updated the test. Does that cover it? -- Added file: http://bugs.python.org/file29127/simplenamespace-weakref.diff ___ Python tracker <http://bugs.python.org/is

[issue15004] add weakref support to types.SimpleNamespace

2013-02-19 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file29094/simplenamespace-weakref.diff ___ Python tracker <http://bugs.python.org/issue15004> ___ ___ Pytho

[issue1615] descriptor protocol bug

2013-02-22 Thread Eric Snow
Eric Snow added the comment: The whole AttributeError gaining an attribute seems impractical, but the second approach still seems reasonable to me. I've attached a rough patch to demonstrate. If that looks okay, I can flesh it out. -- keywords: +patch Added file:

[issue17330] Stop checking for directory cache invalidation in importlib

2013-03-01 Thread Eric Snow
Eric Snow added the comment: Yanking the implicit cache validation does seem to be the simplest solution here. Perhaps we could come up with a complex way of making this work, but I don't think it's worth it. What may be worth it is making the admonition of "use invalidate_ca

[issue17372] provide pretty printer for xml.etree.ElementTree

2013-03-06 Thread Eric Snow
New submission from Eric Snow: minidom already has something like this: http://docs.python.org/3/library/xml.dom.minidom.html#xml.dom.minidom.Node.toprettyxml This is something that appears to have almost made it in quite a while ago: http://effbot.org/zone/element-lib.htm#prettyprint http

[issue17373] Add inspect.Signature.from_callable()

2013-03-06 Thread Eric Snow
New submission from Eric Snow: While working on a subclass of inspect.Signature, I realized that inspect.signature is treated as the constructor. So subclassing isn't so simple. At first I considered adding an extra parameter to inspect.signature allowing different Signature classes.

[issue17146] Improve test.support.import_fresh_module()

2013-03-07 Thread Eric Snow
Eric Snow added the comment: I'm closing this as #17037 offers a better solution and it's unlikely this proposal would make it if that one doesn't. -- resolution: -> wont fix status: open -> closed ___ Python tracker &l

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

2013-03-14 Thread Eric Snow
New submission from Eric Snow: Currently type_new() in Objects/typeobject.c enforces a restriction that the namespace be a dict or dict subclass. It does this via the PyArg_ParseTupleAndKeywords() call there. This means that valid mappings may not be used even though they should work just

[issue17422] language reference should specify restrictions on class namespace

2013-03-14 Thread Eric Snow
New submission from Eric Snow: (related to PEP 422 and issue #17044) The execution namespace from a class definition is passed as the third argument to the metaclass (see builtin___build_class__() in Python/bltinmodule.c). When applicable, which is almost always, the subsequent call to type

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-03-14 Thread Eric Snow
Eric Snow added the comment: We should definitely have a way to expose the original dictionary from __prepare__(). Along with Nick's point, another reason is to allow class decorators to have access to that original, which is important to any use case that involves post-cre

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-03-14 Thread Eric Snow
Eric Snow added the comment: I've also opened #17421 for dropping the restriction on the namespace passed to the metaclass and #17422 for documenting that the passed namespace is copied into a new dict. -- ___ Python tracker

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-03-14 Thread Eric Snow
Eric Snow added the comment: > Given that, it is probably also better to revert the namespace keyword > to accepting an instance rather than a factory function, since the copy > operation after execution of the class body is automatic. Agreed. Of course, the related note is

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

2013-03-14 Thread Eric Snow
Eric Snow added the comment: Sorry I wasn't clear. Later in type.__new__() it copies that passed namespace into a new dict (see issue #17422). So as long as the namespace argument is a valid argument to dict(), it's going to work fine. We don't need the extra explicit che

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-03-16 Thread Eric Snow
Eric Snow added the comment: I'm fine with that. Would it make sense to have the signature of __init_class__ parallel meta.__init__(): __init_class__(cls, name, bases, namespace) or even __init_class__(cls, name, bases, ns, *, namespace=None, *

[issue16991] Add OrderedDict written in C

2013-03-20 Thread Eric Snow
Eric Snow added the comment: My current patch ends up with O(n) deletion, which won't fly, so I'm refactoring. While I'm at it I'm also planning on using the BSD queue.h doubly-linked list rather than the one that I rolled. I'm also going to pull the ordered dict

[issue17546] rename type returned by locals() to livedict

2013-03-25 Thread Eric Snow
Eric Snow added the comment: The documentation seems pretty clear on the nature of the dict returned by locals(). [1] What documentation are you referring to? [1] http://docs.python.org/3.4/library/functions.html#locals -- nosy: +eric.snow type: -> enhancement versions: -Python

[issue17546] rename type returned by locals() to livedict

2013-03-25 Thread Eric Snow
Eric Snow added the comment: Sorry, didn't mean to change the attributed version. However the 2.7 documentation says the same thing. -- versions: +Python 2.7 -Python 3.4 ___ Python tracker <http://bugs.python.org/is

[issue9420] gdbm with /usr/include/ndbm.h

2013-03-25 Thread Eric Wald
Eric Wald added the comment: The approach used in 2.7.4rc1 also works, building cleanly on LFS 7.2; thank you. -- nosy: +eswald ___ Python tracker <http://bugs.python.org/issue9

[issue5135] Expose simplegeneric function in functools module

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

[issue17546] rename type returned by locals() to livedict

2013-03-26 Thread Eric Snow
Eric Snow added the comment: So the problem you are having is that inside functions the dict returned by locals() does not get updated when the "current local symbol table" changes? Keep in mind that for modules and classes (the other two execution blocks), the dict returned by loc

[issue17546] rename type returned by locals() to livedict

2013-03-26 Thread Eric Snow
Eric Snow added the comment: Thanks for the details, Anatoly. I am surprised by the behavior you've described. It may be that functions don't use fast locals when tracing is turned on. I'll have to check. If that's the case, I think the documentation for locals(

[issue17546] Document the circumstances where the locals() dict gets updated

2013-03-27 Thread Eric Snow
Eric Snow added the comment: Thanks for the script Anatoly. That's pretty much what I was imagining from your description. This definitely reinforces my belief that profiling. -- versions: +Python 3.3, Python 3.4 ___ Python tracker

[issue17546] Document the circumstances where the locals() dict gets updated

2013-03-27 Thread Eric Snow
Eric Snow added the comment: Okay, I found it. sys.settrace() ultimately results in the setting of tstate->use_tracing to true and sets tstate->c_tracefunc and tstate_c_traceobj (see sys_settrace() in Python/sysmodule.c and PyEval_SetTrace() in Python/ceval.c). tstate->c_tracefu

[issue17546] Document the circumstances where the locals() dict gets updated

2013-03-27 Thread Eric Snow
Eric Snow added the comment: I should also point out that the following from that note may actually also be a CPython implementation detail: Each call to locals() will return the same dictionary, updated to the contents of the current local symbol table. We'd want to be sure that

[issue7083] locals() behaviour differs when tracing is in effect

2013-03-27 Thread Eric Snow
Changes by Eric Snow : -- superseder: -> Document the circumstances where the locals() dict gets updated ___ Python tracker <http://bugs.python.org/iss

[issue17546] Document the circumstances where the locals() dict gets updated

2013-03-27 Thread Eric Snow
Eric Snow added the comment: I've indicated that this issue supercedes issue #7083. -- stage: -> needs patch ___ Python tracker <http://bugs.python.org

[issue17546] Document the circumstances where the locals() dict gets updated

2013-03-28 Thread Eric Snow
Eric Snow added the comment: > Changing the type of the locals() return isn't the right way to solve > this problem. Better docs is the way to do it. If someone is calling > locals(), they should read the docs. Examining the type of values is > discouraged in Python, we

[issue17568] re: Infinite loop with repeated empty alternative

2013-03-28 Thread Eric Promislow
New submission from Eric Promislow: >>> import re >>> p = re.compile(r'^(?:\\"|.|)*?"', re.S|re.M) >>> s = 'sub foo {\n\tprint "\n\t\tbar\n\t\t";\n}\n' >>> m = p.findall(s) Python doesn't return. Dropping the

[issue17563] Excessive resizing of dicts when used as a cache

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

[issue17576] PyNumber_Index() is not int-subclass friendly (or operator.index() docos lie)

2013-03-29 Thread Eric Snow
Eric Snow added the comment: Would it be okay to do a check on __index__ after the PyLong_Check() succeeds? Something like this: if (PyLong_Check(item) && item->ob_type->tp_as_number->nb_index == PyLong_Type.tp_as_number->nb_index) { Py_INCREF(item);

[issue17628] str==str: compare the first and last character before calling memcmp()

2013-04-04 Thread Eric Snow
Eric Snow added the comment: > Marc-Andre Lemburg added the comment: > Same here. The heuristic may work for short strings that easily fit > into the CPU cache, but as soon as you use it on longer strings, > this will result in much slower comparisons. When testing both, would it

[issue17636] Modify IMPORT_FROM to fallback on sys.modules

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

[issue17788] Add a with expression, for use in comprehensions

2013-04-18 Thread Eric Wieser
New submission from Eric Wieser: It would be nice if there was a `with` "expression". Such that instead of: with open(...) as f: result = foo(f) One could write: result = foo(f) with open(...) as f This would be particularly useful in comprehensions. Instead of:

[issue17788] Add a with expression, for use in comprehensions

2013-04-18 Thread Eric Wieser
Changes by Eric Wieser : -- components: +Interpreter Core ___ Python tracker <http://bugs.python.org/issue17788> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

2013-04-19 Thread Eric Snow
Eric Snow added the comment: FWIW this has come up before: http://mail.python.org/pipermail/python-dev/2012-October/122504.html and relatedly: issue16429 -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue17

[issue16177] IDLE Crash on Open Parens

2013-04-25 Thread Eric Schulz
Changes by Eric Schulz : -- nosy: +lostdog ___ Python tracker <http://bugs.python.org/issue16177> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16177] IDLE Crash on Open Parens

2013-04-30 Thread Eric Schulz
Eric Schulz added the comment: I can repo with MacOS 10.8.3 and Tcl 8.5.13. I'm fairly certian it is triggered by the calltip. However, it is intermittent. I can work for a while, get comfortable and let my guard down, then hit the crash. Typically after I have a good amount of un

[issue17971] Weird interaction between Komodo Python debugger C module & Python 3

2013-05-13 Thread Eric Promislow
New submission from Eric Promislow: While much of Komodo's source code has been released under MIT/GPL/LGPL, the Python debugger hasn't, so I can't post it here. We can work out an arrangement later, although it might not be necessary once I describe the problem: Komodo&#x

[issue17971] Weird interaction between Komodo Python debugger C module & Python 3

2013-05-13 Thread Eric Promislow
Eric Promislow added the comment: I'm running it inside gdb to see if I can figure it out. I don't see a way of isolating this from the whole product. -- ___ Python tracker <http://bugs.python.o

[issue17971] Weird interaction between Komodo Python debugger C module & Python 3

2013-05-15 Thread Eric Promislow
Eric Promislow added the comment: I found a workaround in our debugger code, so you can lower the priority on this, or even mark it "Wontfix", although I still think the frame stack is getting messed up. One thing about our debugger, it essentially runs all the Python code in a

[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow
Eric Snow added the comment: It's worth noting that issue10977 is pretty closely related to this isssue. -- ___ Python tracker <http://bugs.python.org/is

[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow
Eric Snow added the comment: > I just looked at the test-collections patch and don't want it > committed. It is full of trivial edits that make it hard to > review and doesn't make the test suite better. Thanks for the feedback, Raymond. I agree that there are a number of t

[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow
Eric Snow added the comment: Raymond, do you have any objections to splitting the OrderedDict-related tests into their own module. Doing so allows for testing all the those test classes at once, which is handy when working on OrderedDict. This is more relevant now with the extra PEP-399

[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow
Eric Snow added the comment: I finally had some time so here's an updated patch (including O(1) deletions). I've also added a bunch of notes at the top of odictobject.c. Some notable things left to do: * address two recently failing tests due to r83881 (issue 17900) * che

[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file29077/cleanup-test-collections.diff ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Pytho

[issue16991] Add OrderedDict written in C

2013-05-23 Thread Eric Snow
Changes by Eric Snow : Removed file: http://bugs.python.org/file29078/odict.diff ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Python-bugs-list mailin

[issue21288] hashlib.pbkdf2_hmac Hash Constructor

2014-11-09 Thread Eric Beurre
Changes by Eric Beurre : -- nosy: +egbutter ___ Python tracker <http://bugs.python.org/issue21288> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22855] csv writer with blank lineterminator breaks quoting

2014-11-12 Thread Eric Haszlakiewicz
New submission from Eric Haszlakiewicz: I'm trying to emit a single line of csv without any line terminators, but specifying lineterminator=None results in a "lineterminator must be set" error, and setting lineterminator='' results in lack of quotes around certa

[issue22986] Improved handling of __class__ assignment

2014-12-02 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker <http://bugs.python.org/issue22986> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22123] Provide a direct function for types.SimpleNamespace()

2014-12-08 Thread Eric Snow
Eric Snow added the comment: > It's not a builtin yet, solely because we get far fewer arguments about the > contents of the types module than we do builtins :) Exactly. As Mark noted, I did have hopes of it reaching that status though. :) So +1 from me for adding the namesp

[issue21600] mock.patch.stopall doesn't work with patch.dict to sys.modules

2014-12-09 Thread Eric Snow
Eric Snow added the comment: FYI, you probably don't want to be patching out sys.modules. It isn't guaranteed that doing so will have the expected effect on import semantics. -- nosy: +eric.snow ___ Python tracker <http://bu

[issue16991] Add OrderedDict written in C

2014-12-09 Thread Eric Snow
Eric Snow added the comment: I haven't had time for a while to do much work on this. At the last posting this patch was basically done. I'm sure it no longer applies cleanly. The biggest obstacle to wrapping this issue up is the size of the patch. It's hard to get a

[issue21600] mock.patch.stopall doesn't work with patch.dict to sys.modules

2014-12-10 Thread Eric Snow
Eric Snow added the comment: At least for CPython sys.modules is initially set to the modules dict on the interpreter struct. As of 3.4 the import system itself only cares about sys.modules (I'll have to double check on builtin___import__). However, if I recall correctly at least pa

[issue21600] mock.patch.stopall doesn't work with patch.dict to sys.modules

2014-12-11 Thread Eric Snow
Eric Snow added the comment: Ah. Never mind then. :) -- ___ Python tracker <http://bugs.python.org/issue21600> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-15 Thread Eric Snow
Eric Snow added the comment: Thanks for bringing this up, Brett. The goal and approach seem good to me. Did you bring this up during the PEP 451 discussions? If so, sorry I missed it. You've made a good point. And hopefully this will encourage people to subclass Loader

[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-15 Thread Eric Snow
Eric Snow added the comment: At some point should we make create_module (and exec_module) always required? In other words, when should would drop the legacy loader support? I expect the answer is Python 4. :) -- ___ Python tracker <h

[issue19698] Implement _imp.exec_builtin and exec_dynamic

2014-12-15 Thread Eric Snow
Eric Snow added the comment: Same here. -- ___ Python tracker <http://bugs.python.org/issue19698> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-16 Thread Eric Snow
Eric Snow added the comment: @Nick As long as those esoteric cases can be handled without much work via create_module and exec_module, we should have a goal in mind for yanking legacy load_module support. If there are valid use cases that can't be handled via PEP 451 then I'd say

[issue23014] Don't have importlib.abc.Loader.create_module() be optional

2014-12-16 Thread Eric Snow
Eric Snow added the comment: @Brett Discussing this at PyCon sounds good. I'm in favor of dropping load_module as soon as possible (if possible), as you might have guessed by the way I implemented the module spec code. :) I agree that we should make a decision about load_module one w

[issue23068] Add a way to determine if the current thread has the import lock

2014-12-16 Thread Eric Snow
Eric Snow added the comment: Keep in mind that the global import lock is only held long enough to create a module-level lock. The cache of module locks is found at line 166 of Lib/importlib/_bootstrap.py and the code related to module-level locking follows. So unfortunately it won't

[issue16991] Add OrderedDict written in C

2014-12-16 Thread Eric Snow
Eric Snow added the comment: I'm open to suggestions on how to help make the patch more reviewable. Currently at roughly +2500 lines of code it's a lot to ask someone to review. While probably not the only way to help reviewers, I expect the best thing I could do is to split th

[issue23068] Add a way to determine if the current thread has the import lock

2014-12-17 Thread Eric Snow
Eric Snow added the comment: > (Unless I've missed something, we don't run user code with the global import lock held any more) Ah. You are correct. -- ___ Python tracker <http://bugs.pytho

[issue16991] Add OrderedDict written in C

2014-12-17 Thread Eric Snow
Eric Snow added the comment: Suggestions from Antoine on python-dev: * do not make cOrderedDict "builtin"; drop changes to: - Include/Python.h - Objects/object.c - Makefile.pre.in * do not add a C-API * include the linked list pointers in the hash entries? (may simplify things)

[issue23103] ipaddress should be Flyweight

2014-12-24 Thread Eric Snow
Eric Snow added the comment: @sbromberger, there's no need for your own package. Just use something like this: _addr_cache = {} def ipaddr(addr): try: return _addr_cache[addr] except KeyError: _addr_cache[addr] = ipaddress.ipaddress(addr) return _addr_

[issue23159] argparse: Provide equivalent of optparse.OptionParser.{option_groups, option_list, get_option}

2015-01-03 Thread Eric McDonald
New submission from Eric McDonald: There are several use cases for having the equivalent of the optparse.OptionParser 'get_option' method and the 'option_groups' and 'option_list' properties in argparse.ArgumentParser class. (1) Easy alteration of the text of

[issue23389] pkgutil.find_loader raises an ImportError on PEP 420 implicit namespace packages

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

[issue23389] pkgutil.find_loader raises an ImportError on PEP 420 implicit namespace packages

2015-02-03 Thread Eric Snow
Eric Snow added the comment: Hmm. If I recall correctly, we set __spec__ for namespace packages... What's a quick way to consistently reproduce the ImportError? -- ___ Python tracker <http://bugs.python.org/is

[issue23461] Building on windows modifies importlib.h

2015-02-13 Thread Eric Snow
Eric Snow added the comment: This implies to me that someone didn't include importlib.h in their commit when they changed something that required it to be rebuilt. However, if it's a Windows-only thing then perhaps there is something else afoot. Steve? -- nosy: +br

[issue16991] Add OrderedDict written in C

2015-05-25 Thread Eric Snow
Eric Snow added the comment: > I'm going to echo the previous comment that maybe trying to emulate the > existing dict implementation too carefully just adds complexity. The whole dance with _odict_get_index and _odict_resize is due to the requirement that OrderedDict maintain O(1

[issue16991] Add OrderedDict written in C

2015-05-25 Thread Eric Snow
Eric Snow added the comment: > Should dictobject.h get a bit more changes? In particular, should the > following be expanded? > > #define PyDictKeys_Check(op) (Py_TYPE(op) == &PyDictKeys_Type) > #define PyDictItems_Check(op) (Py_TYPE(op) == &PyDictItems_Type) > #de

<    30   31   32   33   34   35   36   37   38   39   >