Eric Snow added the comment:
(changing the title to disassociate it from a particular solution)
>> * make sure the original test case does not get used (#16835),
>
> PEP 399 dictates that the base class does not inherit from
> unittest.TestCase, so why would it be used?
Sorry fo
Eric Snow added the comment:
> I think something similar has already been proposed and rejected on another
> issue.
Wouldn't surprise me. I'll look for it. I know there's been a bunch of
traffic relative to PEP 399 and to test discovery, so I'm guessing I missed
Eric Snow added the comment:
Here's an updated patch after feedback. Thanks Ezio!
--
Added file: http://bugs.python.org/file28865/typeobj-doc.diff
___
Python tracker
<http://bugs.python.org/is
Changes by Eric Snow :
Removed file: http://bugs.python.org/file28864/typeobj-doc.diff
___
Python tracker
<http://bugs.python.org/issue17045>
___
___
Python-bugs-list m
Eric Snow added the comment:
+1 to where Brett's taking this. I really like having the PEP399Tests class
encapsulating the various boilerplate parts, with some of them as methods,
rather than trying to pack them all into one all-powerful decorator.
It would be worth raising an excepti
Eric Snow added the comment:
FWIW, here's a little more explanation on my original thoughts, none of which
I'm married to.
Most of the magic in my patch came messing with the globals (swap out the
module and module attrs; add in the two new classes; ditch the original class).
Eric Snow added the comment:
+1 on requires_accelerator(). It could also be used for individual test
methods. Similar decorators-as-methods could be added later, where
appropriate, for other special cases, like handling the pickle situation
described in #16817
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17093>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17099>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17098>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17100>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Are you thinking of issue 15833?
--
___
Python tracker
<http://bugs.python.org/issue13192>
___
___
Python-bugs-list mailing list
Unsub
Eric Snow added the comment:
Yeah, at some point I will. :) I've been pretty focused on implementing a
C-OrderedDict, which I'm (hopefully) wrapping up pretty soon. Once that
happens I'm going to revisit a bunch of the open tickets I have. If you want
to push this sooner
Eric Snow added the comment:
Other than the language reference (with its updated info on imports--thanks
Barry!), what other documentation would benefit from a note on this? Somwhere
in http://docs.python.org/dev/tutorial/modules.html?
--
nosy: +eric.snow
Eric Snow added the comment:
> By the way,...
Yeah, PEP 420 (implemented in 3.3) introduced namespace packages. The new
behavior you're thinking of is where a package doesn't need a __init__.py. So
path-based lookup for modules, the order goes like this (for "import
spa
Eric Snow added the comment:
My vote is for making this a ValueError in both cases (and amending the doc
appropriately as well). The error amounts to the same thing: the module did
not have loader (implicitly or explicitly). If someone wants to distinguish
between the two they can
Eric Snow added the comment:
+1
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17117>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
> In all honesty I would like to tweak imp.new_module()/PyModule_Create()...
+1
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issu
Eric Snow added the comment:
> [document that] the language reference and importlib docs now supersede the
> PEP
Agreed. PEP 302 is even crustier now than it was a year ago and Barry's new
import page in the language reference obviates the need for 302 as the de
Eric Snow added the comment:
Here's an updated patch. I still have some ref-counting issues, but the patch
is much closer to what I expect will be the final version. At this point it
passes all the main unit tests (segfaults in some of the supplemental Mapping
tests).
One key thing is
Changes by Eric Snow :
Removed file: http://bugs.python.org/file28762/odict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Looks like I didn't get the patch lined up to tip so the review link isn't
showing up. I'll have to fix that tomorrow.
--
___
Python tracker
<http://bugs.pyt
Eric Snow added the comment:
Agreed. It should also link to the new import section in the language
reference rather than to the import statement.
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17
Changes by Eric Snow :
Added file: http://bugs.python.org/file28971/cleanup-test-collections.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bug
Changes by Eric Snow :
Added file: http://bugs.python.org/file28972/odict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list mailin
Changes by Eric Snow :
Removed file: http://bugs.python.org/file28971/cleanup-test-collections.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Pytho
Changes by Eric Snow :
Removed file: http://bugs.python.org/file28972/odict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list mailin
Eric Snow added the comment:
Any objections to what Brett proposed? Any preferences on a name? How about
DualImplementationTests? Here's a patch with tests.
I added a pure_python_only() decorator in addition to accelerated_only(). I
also made both work as decorators for classe
New submission from Eric Snow:
(+nosy list from #17037)
In issue 17037 (related to hiding PEP 399 boilerplate), Ezio and Eli
recommended improving on the API of import_fresh_module(). I agree that it
could be simplified, wrapped, or otherwise improved.
import_fresh_module() is used in the
Eric Snow added the comment:
First of all, I agree that the API for import_fresh_module() isn't ideal and
could stand some improvement. I've created issue 17146 for pursuing that
avenue.
More importantly for this issue, simplifying import_fresh_module() is not
nearly enough of a
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue5308>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
My sentiment also.
--
___
Python tracker
<http://bugs.python.org/issue17146>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Fine with me.
--
___
Python tracker
<http://bugs.python.org/issue17037>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Deprecating pkg/__init__.py and having pkg.py coexist with pkg/ was on the
table in an earlier proposal (PEP 402). In that case pkg/__init__.py would
have been tried first for backward compatbility (until eliminated in Python 4
or whenever). PEP 420 (namespace
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
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
Changes by Eric Snow :
Removed file: http://bugs.python.org/file28839/cleanup-test-collections.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Pytho
Changes by Eric Snow :
Removed file: http://bugs.python.org/file28956/odict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list mailin
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
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
Changes by Eric Snow :
Added file: http://bugs.python.org/file29083/cleanup-test-collections.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bug
Changes by Eric Snow :
Removed file: http://bugs.python.org/file29083/cleanup-test-collections.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Pytho
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
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue10965>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
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
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
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
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
Changes by Eric Snow :
Removed file: http://bugs.python.org/file29094/simplenamespace-weakref.diff
___
Python tracker
<http://bugs.python.org/issue15004>
___
___
Pytho
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:
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
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
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.
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
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
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
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
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
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
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
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, *
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
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
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
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue5135>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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(
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
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
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
Changes by Eric Snow :
--
superseder: -> Document the circumstances where the locals() dict gets updated
___
Python tracker
<http://bugs.python.org/iss
Eric Snow added the comment:
I've indicated that this issue supercedes issue #7083.
--
stage: -> needs patch
___
Python tracker
<http://bugs.python.org
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
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17563>
___
___
Python-bugs-list mailing list
Unsubscribe:
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);
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
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17636>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
Changes by Eric Snow :
Removed file: http://bugs.python.org/file29077/cleanup-test-collections.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Pytho
Changes by Eric Snow :
Removed file: http://bugs.python.org/file29078/odict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list mailin
Changes by Eric Snow :
--
nosy: +eric.snow
___
Python tracker
<http://bugs.python.org/issue17449>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eric Snow added the comment:
Without too many optimzations, the C implementation of OrderedDict is basically
between 1x and 4x the performance of raw dict. This contrasts with the pure
Python OrderedDict, which falls in roughly between 4x and 100x.
I've attached an addition to pybench
Changes by Eric Snow :
Removed file: http://bugs.python.org/file30357/cOrderedDict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list m
Eric Snow added the comment:
Here's an updated patch that has fixes for recursive pickles and for a couple
memory-related segfaults that I missed before. That leaves the following to be
done:
* handle the case where a node is deleted during iteration
* check for any reference cycles (s
Eric Snow added the comment:
Here's one solution to the deletion-during-iteration problem. It makes the
iterators track the key rather than the node, at the expense of a sliver of
speed on __iter__() and keys().
--
Added file: http://bugs.python.org/file30467/cOrderedDict-iter
Eric Snow added the comment:
The concern about reference cycles here lies in their existence in the
linked-list. To see what I mean, check out the use of weakrefs in the pure
Python implementation at Lib/collections/__init__.py. As the current
implementation does not use PyObjects for the
Changes by Eric Snow :
Removed file:
http://bugs.python.org/file30467/cOrderedDict-iterators-by-key.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Changes by Eric Snow :
Removed file: http://bugs.python.org/file30462/cOrderedDict.diff
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bugs-list m
Eric Snow added the comment:
Here's what I feel is a nearly complete patch. The only outstanding issues
that I feel need to be answered are 4 spots where calls into the interpreter
may result in unexpected changes to the object or make the current function
state out-of-dat
601 - 700 of 736 matches
Mail list logo