Nick Coghlan added the comment:
There's a fairly sophisticated tapdance in object.__new__ that deals with this
problem at that level.
See: http://hg.python.org/cpython/file/default/Objects/typeobject.c#l2869
The new IOError may require something similarly sophisticated to cope
Changes by Nick Coghlan :
--
hgrepos: -93
___
Python tracker
<http://bugs.python.org/issue11816>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Nick Coghlan :
--
hgrepos: +94
___
Python tracker
<http://bugs.python.org/issue11816>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Nick Coghlan :
Added file: http://bugs.python.org/file23853/5ce60675e572.diff
___
Python tracker
<http://bugs.python.org/issue11816>
___
___
Python-bugs-list m
Nick Coghlan added the comment:
MvL pointed out I hadn't updated the Hg repo reference when I moved my sandbox
over to BitBucket - the diff it was generating was from the last time I updated
my pydotorg sandbox in order to try something on the buil
New submission from Nick Coghlan :
This RFE proposes two new methods "to_signed" and "to_unsigned" on 'int'
objects and on the numbers.Integral ABC.
Semantics (and number.Integral implementation):
def to_unsigned(self, bits):
"Convert this integer to its u
Nick Coghlan added the comment:
Dict and Set comprehensions are also broken:
>>> {1 for x in ()}
set([])
>>> {1:2 for x in ()}
{}
>>> ast.literal_eval("{1 for x in ()}")
Traceback (most recent call last):
File "", line 1, in
File "/u
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file23819/abc_descriptor.patch
___
Python tracker
<http://bugs.python.org/issue11610>
___
___
Python-bug
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file22729/abc_descriptor.patch
___
Python tracker
<http://bugs.python.org/issue11610>
___
___
Python-bug
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file22407/abc_descriptor.patch
___
Python tracker
<http://bugs.python.org/issue11610>
___
___
Python-bug
Nick Coghlan added the comment:
Added some review comments in Reitveld - core functionality changes look good,
but there are some other aspects that need addressing before the patch will be
good to go (primarily relating to only doing a minimal documented deprecation
of the legacy APIs
New submission from Nick Coghlan :
functools.update_wrapper() and functools.wraps() should copy the new property
by default.
--
keywords: easy
messages: 148943
nosy: ncoghlan
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Add __qualname__ to
Changes by Nick Coghlan :
--
priority: normal -> release blocker
___
Python tracker
<http://bugs.python.org/issue12555>
___
___
Python-bugs-list mailing list
Un
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file23216/0001.diff
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bugs-list mailin
Changes by Nick Coghlan :
Removed file:
http://bugs.python.org/file23570/issue11682_pep380_branch_2031.diff
___
Python tracker
<http://bugs.python.org/issue11
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file23759/0001-2.diff
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bugs-list mailin
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file23639/test.py
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bugs-list mailin
Changes by Nick Coghlan :
--
hgrepos: -11
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bugs-list mailing list
Unsubscribe:
Nick Coghlan added the comment:
OK, I removed all the old files and repo links (they're still available in the
history below if needed). (well, the link to Renaud's hg patch queue is gone,
but that's also present in one of the early comments). (Ron: your comment makes
me
Nick Coghlan added the comment:
As far as *why* yield expressions aren't special cased the way generator
expressions are - just an oversight when yield expressions were added, no real
grand master plan. It's not a big deal in practice, so nobody has ever cared
enough to argue for
Nick Coghlan added the comment:
No, it's only class objects that have __name__ and __qualname__, not class
instances.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Nick Coghlan :
subprocess.check_output() is nice, but doesn't help if you want to process the
piped data line-by-line.
Currently, that means you have to do the full Popen dance if you want access to
each line of output as it becomes available.
This RFE is
New submission from Nick Coghlan :
As the subject line says:
>>> fmt = "{0!a}"
>>> fmt.format(10)
'10'
>>> import string
>>> string.Formatter().format(fmt, 10)
Traceback (most recent call last):
File "", line 1, in
F
Nick Coghlan added the comment:
You can see a version of this here:
https://bitbucket.org/ncoghlan/shell_command/src/2b1988b072aa/shell_command.py#cl-157
--
___
Python tracker
<http://bugs.python.org/issue13
Nick Coghlan added the comment:
The PyPI package to prototype the API details is now available:
http://pypi.python.org/pypi/shell_command
http://shell-command.readthedocs.org
https://bitbucket.org/ncoghlan/shell_command/
--
___
Python tracker
Nick Coghlan added the comment:
Explicitly spelling out __qualname__ like that makes the tests a bit too
sensitive to otherwise irrelevant details of the test layout.
I suggest using comparisons like "self.assertEqual(wrapper.__qualname__,
f.__qualname__)" and "self.assertN
Nick Coghlan added the comment:
Given the existence of tempfile.TemporaryDirectory in recent Python versions, I
suggest finding a new cleanup function example that doesn't duplicate native
stdlib functionality :)
I do see value in the feature itself though - I believe the precedent of
Nick Coghlan added the comment:
At first glance, I thought this might be just the circular import problem
(#992389) appearing in a different guise. However, if that was the case,
switching to an import statement or __import__ shouldn't have made any
difference.
What do you see if you p
Nick Coghlan added the comment:
TestCase.setUp() and TestCase.tearDown() were amongst the precursors
to__enter__() and __exit__(). addCleanUp() fills exactly the same role here -
and I've seen *plenty* of positive feedback directed towards Michael for that
addition to the unittest API.
Nick Coghlan added the comment:
Given the history of API design errors in contextlib (cf. contextlib.nested in
general, making contextlib._GeneratorContextManager a subclass of
contextlib.ContextDecorator), I've realised Raymond is right in wanting to see
this idea more thoroughly v
Nick Coghlan added the comment:
In the meantime, I put my version up as a cookbook recipe:
http://code.activestate.com/recipes/577981-cleanupmanager-for-with-statements/
--
___
Python tracker
<http://bugs.python.org/issue13
Nick Coghlan added the comment:
And the backport: http://contextlib2.readthedocs.org/
I haven't tested on anything other than 2.7 as yet - I have an account request
in train with the Shining Panda folks, so I'll set up multi-version CI for this
project (along with a couple of ot
Nick Coghlan added the comment:
There are a *lot* of characters with semantic significance that are reported by
the tokenize module as generic "OP" tokens:
token.LPAR
token.RPAR
token.LSQB
token.RSQB
token.COLON
token.COMMA
token.SEMI
token.PLUS
token.MINUS
token.STAR
token.SLASH
Nick Coghlan added the comment:
Sure, but what does that have to do with anything? tokenize isn't a general
purpose tokenizer, it's specifically for tokenizing Python source code.
The *problem* is that it doesn't currently fully tokenize everything, but
doesn't explic
Nick Coghlan added the comment:
Ah, I didn't read it as suggested documentation at all - you moved seamlessly
from personal commentary to a docs suggestion without separating the two, so it
appeared to be a complete non sequitur to me.
As for the docs suggestion, I think it works a
Nick Coghlan added the comment:
The keyword-only idea is a backwards compatibility hack we discussed at the
PyCon US sprints because ImportError currently accepts an arbitrary number of
arguments:
>>> raise ImportError(1, 2, 3)
Traceback (most recent call last):
File "
Nick Coghlan added the comment:
I'm prototyping a public version of the recreation API as
"ContextDecorator.refresh_cm()" in contextlib2:
http://contextlib2.readthedocs.org/en/latest/index.html#contextlib2.ContextDecorator.refresh_cm
--
type: behavior
Nick Coghlan added the comment:
Meador's patch looks good to me. The docs change for 2.7 and 3.2 would be
similar, just with text like "Specific tokens can be distinguished by checking
the ``string`` attribute of OP tokens for a match with the expected character
sequence."
Nick Coghlan added the comment:
The thing that most appeals to me with this concept is moving closer to making
it possible to experiment with generator-style functionality in *extension*
modules (albeit extension modules that are coupled to private CPython APIs).
So, for me, "not worse
New submission from Nick Coghlan :
The http://docs.python.org/library/multiprocessing#windows section of the docs
should document the limitations that multiprocessing on Windows places on
__main__ module invocation.
- no execution of modules inside packages with -m
- no execution of packages
Nick Coghlan added the comment:
The fix from #10845 should be backported to Python 2.7 (bypassing the assertion
isn't enough - you want to skip re-executing __main__ entirely)
--
nosy: +ncoghlan
___
Python tracker
<http://bugs.py
Nick Coghlan added the comment:
(Actually the latter isn't true - the __main__ bypass handles that case. Since
none of the code gets executed in the child process, it doesn't generally
matter that __package__ isn't set properly)
--
___
Nick Coghlan added the comment:
My earlier descriptions here aren't really adequate - as soon as I started
putting contextlib2 together, this CleanupManager idea quickly morphed into
ContextStack [1], which is a far more powerful tool for manipulating context
managers in a way that do
Nick Coghlan added the comment:
Updated issue title to reflect what I'll eventually be proposing (once the
ContextStack API has had a chance to mature on PyPI as part of contextlib2)
--
title: Add contextlib.CleanupManager -> Add contextlib.Cont
Nick Coghlan added the comment:
Yeah, adding a "Recipes" section for contextlib2 is definitely on my to-do list
(along with adding more examples in general).
--
___
Python tracker
<http://bugs.python.o
Nick Coghlan added the comment:
ContextStack is intended to be a building block that makes it easy to compose
context managers and other callbacks, not necessarily an API you'd regularly
use directly. For example, given ContextStack (as currently implemented in
contextlib2), it's
Nick Coghlan added the comment:
The comparison to Go's defer statement is interesting, though:
ContextStack.register basically *is* the same as defer. While a nested with
statement is a better option in Python, if we ignore that for the moment, you
*could* write that simply copying ex
Nick Coghlan added the comment:
It is indeed unfortunate that these two functions weren't killed off in the
Py3k transition instead of being migrated from the commands module to
subprocess (their current implementation runs counter to the entire subprocess
security design by impli
Nick Coghlan added the comment:
I believe the current "check_chown" could be passed by a no-op (since the file
will be owned by the current user even *before* the call to chowntree). Testing
this properly is actually rather difficult (since the only uid and gid we can
rely on ar
Nick Coghlan added the comment:
I'm working on a library of general directory walking tools that will hopefully
make their way back into the stdlib at some point
(http://walkdir.readthedocs.org).
They're designed to filter and transform the output of os.walk (and similar
ite
Nick Coghlan added the comment:
Since walkdir is currently entirely based on returning filesystem paths as
strings (just like os.walk()) and hence shares the pervasive symlink attack
vulnerability, I'm particularly interested in the question of whether or not
the various *at APIs can be
Nick Coghlan added the comment:
Another, possibly better, alternative would be to produce a tuple-subclass that
adds a separate "dirfd" attribute to the (dirpath, subdirs, files) triple.
I'll stop talking about the walkdir implications here. Instead, I've created a
co
Nick Coghlan added the comment:
Thanks for that Charles-François - do you mind if I adapt that for walkdir?
The changes I would make are basically those that Antoine pointed out:
- rather than replacing the dirpath entry, instead yield a 4-tuple that appends
the dirfd attribute at the end
Nick Coghlan added the comment:
OK, os.walkfd is sounding good:
- accepts a file descriptor, byte sequence or string for "top"
- produces 4-tuples, with the dirfd added at the end
- documents clearly that the dirfd is normally only valid until the next
iteration step, so you ne
Changes by Nick Coghlan :
Added file: http://bugs.python.org/file24213/494c976c41c4.diff
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bugs-list m
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file23774/0d1d76f68750.diff
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bug
Changes by Nick Coghlan :
Removed file: http://bugs.python.org/file24213/494c976c41c4.diff
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bug
Changes by Nick Coghlan :
Added file: http://bugs.python.org/file24214/f8349cbc1b26.diff
___
Python tracker
<http://bugs.python.org/issue11682>
___
___
Python-bugs-list m
Nick Coghlan added the comment:
Nice milestone this evening: by incorporating doc updates based on Zbysek's
efforts and dropping the explicit bytecode generation tests, I now have
something that appears ready to commit *without* a dependency on the proposed
dis module updates.
So, ass
Nick Coghlan added the comment:
This topic came up again on python-ideas:
http://mail.python.org/pipermail/python-ideas/2011-May/010293.html
--
stage: -> needs patch
___
Python tracker
<http://bugs.python.org/iss
Nick Coghlan added the comment:
Just to articulate the rationale, I'm guessing the reasoning behind this is to
make it feasible for source->AST->source translators to retain the original
grouping?
--
___
Python tracker
<http://b
Nick Coghlan added the comment:
Visual scan of the patch in Reitveld looks fine to me.
--
___
Python tracker
<http://bugs.python.org/issue12106>
___
___
Pytho
Changes by Nick Coghlan :
--
assignee: -> ncoghlan
nosy: +ncoghlan
___
Python tracker
<http://bugs.python.org/issue12182>
___
___
Python-bugs-list mai
Changes by Nick Coghlan :
--
nosy: +jnoller, ncoghlan
___
Python tracker
<http://bugs.python.org/issue12174>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Nick Coghlan :
--
nosy: +ncoghlan
___
Python tracker
<http://bugs.python.org/issue12191>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Nick Coghlan :
A complete build on Ubuntu currently requires fiddling with LDFLAGS before
invoking configure (otherwise the build process fails to find the necessary
pieces to build some modules):
http://www.technobits.net/articles/8919/christian-heimes-how-to-compile
Nick Coghlan added the comment:
In the time since 2.3, pydoc.visiblename() has been updated to use the correct
definition of visibility.
A "developer" mode that exposes internal details doesn't make sense. When
you're developing something and want to see internal details
Nick Coghlan added the comment:
>From my review:
"""One genuine problem with a stale assert and comment in ast.c, and a small
objection to style in compile.c (I'd like a new compile_try() function to match
the new AST node).
Otherwise looke
Nick Coghlan added the comment:
The AST version changed, and, more importantly, if other implementations pick
up our AST changes without updating their compilers accordingly, their symbol
table analysis and code compilation processes will break.
So yes, the test suite does already cover this
Nick Coghlan added the comment:
One other thing I should mention is that in a later checkin, Benjamin did add a
couple of explicit with statement examples to test_ast. These will fail if
other implementations don't update the front end of their compilation processes
correctly, so that s
Nick Coghlan added the comment:
Looks good to me.
--
___
Python tracker
<http://bugs.python.org/issue12199>
___
___
Python-bugs-list mailing list
Unsubscribe:
Nick Coghlan added the comment:
Some comments on the follow-up changes I just committed:
- It's an illustration of the fact that coverage data is only step 1 in
improving tests.
- I added additional assertions regarding the error message contents to a
couple of tests, and also verified
Changes by Nick Coghlan :
--
resolution: -> fixed
stage: commit review -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Nick Coghlan added the comment:
Note that Yaniv Aknin (author of the Python's Innards series of blog posts) has
a recursive dis variant that may be useful for inspiration:
https://bitbucket.org/yaniv_aknin/pynards/src/c4b61c7a1798/common/blog.py
As shown there, this recursive behaviou
Nick Coghlan added the comment:
Hmm, that behaviour looks unrelated to the specific problem Michael reported.
The initial problem in this space was that defining __dir__() completely
determined the result of dir() calls, but object.__dir__() didn't actually
work, so you couldn't
Nick Coghlan added the comment:
Ah, I wondered about that when I saw Barry was using old-style classes in his
example. Perhaps the answer then is to add a PyInstance_Check() to skip
invocation of __dir__() completely for old-style classes
Nick Coghlan added the comment:
It would be broken in the same way that it was broken in 2.7.1 though. That can
be a plus when it comes to maintenance releases.
OTOH, this does turn a silent failure (__dir__() ignored on old-style classes)
into a noisy failure (must return a list).
If you
Nick Coghlan added the comment:
Looks good in a desk review. Assuming the full test suite passes, +1 from me.
--
nosy: +ncoghlan
___
Python tracker
<http://bugs.python.org/issue12
Nick ODell added the comment:
I've added a short note regarding breakpoints in Doc/library/idle.rst
Ned, I'm not an experienced user with IDLE by any means, but I think some
documentation is better than none, no?
--
nosy: +Nick.ODell
Added file: http://bugs.python.org
Nick Coghlan added the comment:
On a related note, http://docs.python.org/devguide/docquality.html should
mention that the devguide itself lives in a different repo but the process is
otherwise similar to contributing to the main docs
Nick Coghlan added the comment:
Eugene raised the question of AST changes on python-dev [1] and the verdict was
that so long as ast.__version__ is updated, AST clients will be able to cope
with changes.
Benjamin Peterson made some subsequent changes to the AST (bringing the AST for
try and
New submission from Nick Coghlan :
Benjamin's AST modification checkins switched directly from the SVN revision
number (as a string) to the hg revision hash.
While that preserves uniqueness, it makes ordering difficult to determine.
The last AST version in 3.2 was '82163' (an
Nick Coghlan added the comment:
As Raymond noted though, some of the block stack fiddling doesn't make sense
until after the bytecode has already been generated. It's OK to have multiple
optimisers at different layers, each taking care of the elements that are best
suited to that l
Changes by Nick Coghlan :
--
assignee: -> ncoghlan
___
Python tracker
<http://bugs.python.org/issue1294232>
___
___
Python-bugs-list mailing list
Unsubscri
Nick Coghlan added the comment:
Thanks for getting started with such a detailed review on this Graham. We've
known the documentation in this area has been flawed for a long time, but
actually *fixing* seemed like such a big task that it has tended to get pushed
to the bottom o
Nick Coghlan added the comment:
inspect.getattr_static has the necessary logic to search for descriptors
without invoking them.
However, it may be better to revert to the idea of pushing this functionality
back onto the individual descriptors and have the problematic descriptors like
Nick Coghlan added the comment:
"Public name" is a term that describes a convention, not anything enforced by
the interpreter. Names starting with underscores typically aren't public either
(unless documented otherwise), but that has no effect on the ability to
retrieve them a
Nick Coghlan added the comment:
Remember the goal here is *not* to completely eliminate the need to test that
objects implement an ABC correctly. It's to make it easier to declare the
expected interface in a way that helps readers of the ABC definition to figure
out what is going on, a
Nick Coghlan added the comment:
Ah, now I get your point re .pkg vs .pth. I naturally read that as ".pth
entries are to sys.path entries as .pkg entries are to pkg.__path__ entries",
without any hint that those are the same *kind* of thing. However, I already
know that sys.pa
Nick Coghlan added the comment:
In that paragraph, I was only talking about cases where "foo = 1" *isn't* a
valid override (which, I hope you'll agree, it typically won't be).
Your described approach of declaring an abstract property and then overriding
it with an or
Nick Coghlan added the comment:
Non-conformant explicit registration is permitted on purpose to allow
developers to only supply partial implementations when it is known that that is
all a given application requires. Extremely impure, but quite practical :)
Note that the core logic of
New submission from Nick Coghlan :
I'd like to add a new constant to the math module:
tau = 2*math.pi
Rather than repeating all the reasons for why tau makes more sense than pi as
the fundamental circle constant, I'll just refer interested readers to
http://tauday.com/
-
Nick Coghlan added the comment:
The golden ratio is more commonly denoted with phi (although tau does get used
sometimes).
Popularity isn't the point though, it's the fact that tau *makes geometric
sense* in ways that 2*pi doesn't.
--
___
Changes by Nick Coghlan :
--
assignee: -> ncoghlan
___
Python tracker
<http://bugs.python.org/issue12278>
___
___
Python-bugs-list mailing list
Unsubscri
Nick Coghlan added the comment:
Comms FAQ: http://hg.python.org/devguide/rev/f1ebfb53437f
Devguide note: http://hg.python.org/devguide/rev/5ab42baba771
--
resolution: -> fixed
stage: -> committed/rejected
___
Python tracker
Changes by Nick Coghlan :
--
resolution: -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
___
Python tracker
<http://bugs.python.or
Changes by Nick Coghlan :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue11690>
___
___
Python-bugs-list mailing list
Unsubscri
Nick Coghlan added the comment:
Enhanced committer guidelines: http://hg.python.org/devguide/rev/774fb024b152
--
___
Python tracker
<http://bugs.python.org/issue11
Nick Coghlan added the comment:
Added (with further adjustments) to devguide in
http://hg.python.org/devguide/rev/63f3521fe8f8
--
resolution: -> accepted
stage: -> committed/rejected
status: open -> closed
___
Python track
Nick Coghlan added the comment:
And to record the workaround for 3.1 and 3.2 (courtesy of Michael):
Adding a "_super = super" alias at the module level and using the Python 2.x
style long form invocation on _super() in affected methods will avoid the
compiler games played when u
201 - 300 of 6501 matches
Mail list logo