Re: [Python-Dev] Avoiding error from repr() of recursive dictview

2013-07-22 Thread Ben North
Hi Greg, Thanks for the feedback. On 22 July 2013 23:01, Gregory P. Smith wrote: > On Mon, Jul 22, 2013 at 2:44 PM, Ben North wrote: >> [... proposed change of behaviour such that a recursive >> dictview gives a repr() with "..." rather than a RuntimeError ...] > &g

[Python-Dev] Avoiding error from repr() of recursive dictview

2013-07-22 Thread Ben North
Hi, A friend of mine, Ruadhan O'Flanagan, came across a bug which turned out to be the one noted in [http://bugs.python.org/issue18019], i.e.: >>> d={} >>> d[42]=d.viewvalues() >>> d This issue has been fixed in hg; the behaviour now is that a RuntimeError is produced for a recursive dictionary

Re: [Python-Dev] Suggested doc patch for tarfile

2009-04-23 Thread Ben North
>> The current documentation for tarfile.TarFile.extractfile() does not >> mention that the returned 'file-like object' supports close() and also >> iteration.  The attached patch (against svn trunk) fixes this. > > Please post the patch to bugs.python.org Done: http://bugs.python.org/issue582

[Python-Dev] Suggested doc patch for tarfile

2009-04-23 Thread Ben North
Hi, The current documentation for tarfile.TarFile.extractfile() does not mention that the returned 'file-like object' supports close() and also iteration. The attached patch (against svn trunk) fixes this. (Background: I was wondering whether I could write def process_and_close_file(f_in):

[Python-Dev] Partial function application 'from the right'

2009-02-09 Thread Ben North
Hi, As suggested, I've created http://bugs.python.org/issue5191 to hold the patches for this feature, and the relation to the 'partial.skip' feature request. Could somebody with appropriate privileges close the issue as rejected, if indeed that is the decision? Thanks, Ben. ___

[Python-Dev] Partial function application 'from the right'

2009-02-05 Thread Ben North
Hi, My reading of the most recent set of emails on this topic is that the balance of opinion is against adding a 'partial_right' or 'partial.skip' feature. I still think such a feature would be of real use, although I can see the arguments against adding it. Is the conclusion 'no thanks', then?

[Python-Dev] Partial function application 'from the right'

2009-02-03 Thread Ben North
Hi, Thanks for the further responses. Again, I'll try to summarise: Scott David Daniels pointed out an awkward interaction when chaining partial applications, such that it could become very unclear what was going to happen when the final function is called: > If you have: > def button(root,

[Python-Dev] Partial function application 'from the right'

2009-01-30 Thread Ben North
Hi, > [ Potential new "functools.partial_right", e.g., > >split_comma = partial_right(str.split, '.') > ] Thanks for the feedback. Apologies if (as was suggested) this should have gone to python-ideas; I thought as a fairly small extension to existing functionality it would be OK here. I'l

[Python-Dev] Partial function application 'from the right'

2009-01-29 Thread Ben North
Hi, I find 'functools.partial' useful, but occasionally I'm unable to use it because it lacks a 'from the right' version. E.g., to create a function which splits a string on commas, you can't say # Won't work when called: split_comma = partial(str.split, sep = ',') and to create a 'log to

[Python-Dev] Wrapping up 'dynamic attribute' discussion

2007-02-19 Thread Ben North
I wrote: > I've sent an updated version of PEP 363 to the editors, which > includes the following summary of the discussion. I hope I've > captured the important points, but please let me know if there's > something important I've left out or misrepresented. There were a couple of points made off

[Python-Dev] Summary: rejection of 'dynamic attribute' syntax

2007-02-15 Thread Ben North
[EMAIL PROTECTED] wrote: > > > I really, really wish that every feature proposal for Python had to meet > > > some burden of proof Ben North wrote: > > This is what I understood the initial posting to python-ideas to be > > about. [EMAIL PROTECTED] wro

[Python-Dev] Wrapping up 'dynamic attribute' discussion

2007-02-15 Thread Ben North
I've sent an updated version of PEP 363 to the editors, which includes the following summary of the discussion. I hope I've captured the important points, but please let me know if there's something important I've left out or misrepresented. - - - - 8< - - - - Mailing Lists Discussion Initi

[Python-Dev] Summary: rejection of 'dynamic attribute' syntax

2007-02-14 Thread Ben North
Guido van Rossum wrote: > This seems to be the overwhelming feedback at this point, so I'm > withdrawing my support for the proposal. I hope that Ben can write up > a PEP and mark it rejected, to summarize the discussion; it's been a > useful lesson. The feedback is clear, yes. The "new syntax se

[Python-Dev] Summary of "dynamic attribute access" discussion

2007-02-13 Thread Ben North
The support for the including the feature at all is still not unanimous. Perhaps the way forward is to try to reach consensus on the favourite (or least-unfavourite) syntax, and I'll revise the PEP and sample implementation. I think the "obj.[attr_name]" syntax has the most support. To stop this

[Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Ben North
Guido van Rossum wrote: > - There's near-universal dislike for the two-arg form, so let's drop > that part of the proposal. This is a strong consensus, definitely, so we can conclude that this point has been decided. I will remove it from the PEP. Guido also wrote: > - There's a lot of suppor

[Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Ben North
Apologies: I overlooked a couple of replies in my summary earlier. Tim Delaney and Terry Reedy both responded in positive terms to the one-argument form and its syntax, and in negative terms to the two-argument form. Also, I missed the fact that Neil Toronto had made the same point as me when he

[Python-Dev] New syntax for 'dynamic' attribute access

2007-02-12 Thread Ben North
Thanks for the comments so far on this. First, on the general idea: Neil Toronto: > I like it. > [...] > > obj.(attr_name) += 1 > Even nicer; much, much better than the current spelling. Brett Cannon: > +0 on the one-item version. Anthony Baxter: > -1 from me. Collin Winter: > I like the gen

[Python-Dev] New syntax for 'dynamic' attribute access

2007-02-11 Thread Ben North
access using the new syntax over getattr etc. Is 1% "too much" for this feature? Ben. - - - - 8< - - - - PEP: 363 [PROVISIONAL NUMBER] Title: Syntax For Dynamic Attribute Access Version: $Revision$ Last-Modified: $Date$ Author: Ben North Status: Draft Type: Standards Track C