Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Nick Coghlan
James Y Knight wrote: > I'm resending a message I sent in June, since it seems the same thread > has come up again, and I don't believe anybody actually responded > (positively or negatively) to the suggestion back then. > > http://mail.python.org/pipermail/python-dev/2009-June/090176.html > > On

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Steven Bethard
On Tue, Sep 29, 2009 at 10:04 PM, James Y Knight wrote: > It'd possibly be helpful if there were builtin objects which forced the > format style to be either newstyle or oldstyle, independent of whether % or > format was called on it. > > E.g. > x = newstyle_formatstr("{} {} {}") > x % (1,2,3) ==

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Mark Dickinson
On Wed, Sep 30, 2009 at 1:44 AM, Nick Coghlan wrote: > Martin v. Löwis wrote: >>> I would say that there certainly are precedents in other areas for >>> keeping the information about the input form around. For example, >>> occasionally it would be handy if parsing a hex integer returned an >>> obj

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Paul Moore
2009/9/30 Greg Ewing : > Paul Moore wrote: >> >> I'd rather argparse (or any library function) >> didn't call sys.exit on my behalf - it should raise an exception. > > Actually, sys.exit() *does* raise an exception (i.e. > SystemExit) that you can catch if you want. That's a good point... Paul ___

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Paul Moore
2009/9/30 Steven Bethard : > On Tue, Sep 29, 2009 at 10:04 PM, James Y Knight wrote: >> It'd possibly be helpful if there were builtin objects which forced the >> format style to be either newstyle or oldstyle, independent of whether % or >> format was called on it. > So I understand how this migh

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Paul Moore
2009/9/30 Mark Dickinson : > Please could someone who understands the uses of IPNetwork better than > I do explain why the following wouldn't be a significant problem, if __eq__ > and __hash__ were modified to disregard the .ip attribute as suggested: > linus = IPv4Network('172.16.200.1/24') >

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Mark Dickinson
On Wed, Sep 30, 2009 at 10:52 AM, Paul Moore wrote: > 2009/9/30 Mark Dickinson : >> Please could someone who understands the uses of IPNetwork better than >> I do explain why the following wouldn't be a significant problem, if __eq__ >> and __hash__ were modified to disregard the .ip attribute as

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Eric Smith
Martin v. Löwis wrote: Steven Bethard wrote: There's a lot of code already out there (in the standard library and other places) that uses %-style formatting, when in Python 3.0 we should be encouraging {}-style formatting. I don't agree that we should do that. I see nothing wrong with using %

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Mark Dickinson
On Wed, Sep 30, 2009 at 12:06 PM, Nick Coghlan wrote: > Mark Dickinson wrote: >> Okay, so maybe this is an abuse of IPv4Network.  But I'd (mis?)understood >> that the retention of the .ip attribute was precisely a convenience to allow >> this sort of use.  If not, then what's it for?  I've read th

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Stephen J. Turnbull
Mark Dickinson writes: > >> Please could someone who understands the uses of IPNetwork > >> better than I do explain why the following wouldn't be a > >> significant problem, if __eq__ and __hash__ were modified to > >> disregard the .ip attribute as suggested: > > linus = IPv4Network('1

Re: [Python-Dev] test_thread tracebacks

2009-09-30 Thread skip
>> It's been awhile since I rebuilt Python and ran the test suite. This >> evening I noticed this on my Mac (OS X 10.5): Sorry, trunk. Skip ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Un

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Barry Warsaw
On Sep 29, 2009, at 11:15 PM, Martin v. Löwis wrote: I would propose that the format argument gets an argument name, according to the syntax it is written in. For PEP 3101 format, I would call the argument "format" (like the method name of the string type), i.e. logging.Formatter( format="{asc

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Paul Moore
2009/9/30 Barry Warsaw : > Although I hate the name 'dicttemplate', this seems like the best solution > to me.  Maybe it's good that 'dicttemplate' is so ugly though so that people > will naturally prefer 'format' :).  But I like this because there's not > really any magic, it's explicit, and the d

Re: [Python-Dev] Python 2.6.3

2009-09-30 Thread Barry Warsaw
On Sep 30, 2009, at 12:29 AM, Ned Deily wrote: In my opinion, the standard python.org OS X installer for 2.6.3 now "works well" on 10.4, 10.5, and 10.6 and is ready for release. Fantastic, thanks. Martin's uploaded the Windows binaries so I'll make the announcement now. No commits to the 2

[Python-Dev] Python 2.6.3rc1 available

2009-09-30 Thread Barry Warsaw
The first (and hopefully last) release candidate for Python 2.6.3 is now available via http://www.python.org/download/releases/2.6.3/ Source releases and Windows binaries are currently available, and Mac OS X binaries should be forthcoming. Nearly 100 bugs have been fixed since 2.6.2. Bar

[Python-Dev] Python logging and 1.5.2 compatibility

2009-09-30 Thread Vinay Sajip
I'm planning to "officially" drop support for Python 1.5.2 in the logging package. When the logging package was introduced in Python 2.3, many Linux distros were shipping 1.5.2 as the system's Python, even though 2.2 had been out for a while. So it seemed important to support 1.5.2 for those sysad

Re: [Python-Dev] Python logging and 1.5.2 compatibility

2009-09-30 Thread Antoine Pitrou
Le Wed, 30 Sep 2009 13:27:41 +, Vinay Sajip a écrit : > I'm planning to "officially" drop support for Python 1.5.2 in the > logging package. Thanks for the announcement. So, what is the minimum supported version now? Regards Antoine. ___ Python-D

Re: [Python-Dev] Python logging and 1.5.2 compatibility

2009-09-30 Thread R. David Murray
On Wed, 30 Sep 2009 at 13:27, Vinay Sajip wrote: I'm planning to "officially" drop support for Python 1.5.2 in the logging package. What's the minimum version of Python that the logging module now officially supports? --David (RDM) ___ Python-Dev mai

Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-30 Thread Chris Withers
s...@pobox.com wrote: Dino> For IronPython we wrote a set of tests which go through and define Dino> the various operator methods in all sorts of combinations on both Dino> new-style and old-style classes as well as subclasses of those Dino> classes and then do the comparisons w/

Re: [Python-Dev] sharing stdlib across python implementations

2009-09-30 Thread Chris Withers
Frank Wierzbicki wrote: Talk has started up again on the stdlib-sig list about finding a core stdlib + tests that can be shared by all implementations, potentially living apart from CPython. I have volunteered to put together a PEP on the subject, with Jessie Noller and Brett Canon are helping m

Re: [Python-Dev] Python logging and 1.5.2 compatibility

2009-09-30 Thread Vinay Sajip
Antoine Pitrou pitrou.net> writes: > So, what is the minimum supported version now? Well, each version is tested with the release of Python which it's part of, and in theory it would be possible for the code in logging for that release to use features only available in that release of Python. So

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Steven D'Aprano
On Wed, 30 Sep 2009 03:04:05 pm James Y Knight wrote: > It'd possibly be helpful if there were builtin objects which forced > the format style to be either newstyle or oldstyle, independent of > whether % or format was called on it. > > E.g. > x = newstyle_formatstr("{} {} {}") > x % (1,2,3) == x.

Re: [Python-Dev] sharing stdlib across python implementations

2009-09-30 Thread Antoine Pitrou
Chris Withers simplistix.co.uk> writes: > > I'm on on stdlib-sig and I'm afraid I don't have the bandwidth to start > on it, but I'd just like to throw in (yet again) that it would be great > if the stdlib was actually a set of separate python packages with their > own version metadata so that

Re: [Python-Dev] sharing stdlib across python implementations

2009-09-30 Thread Chris Withers
Antoine Pitrou wrote: This sounds like a bad idea to me. Each Python release is tested and debugged as a whole. If you have a lot of possible combinations (module A version 1.1 with module B version 1.2, etc.), it becomes impossible for us to ensure proper QA for the whole and as a result the qua

Re: [Python-Dev] a new setuptools release?

2009-09-30 Thread Chris Withers
P.J. Eby wrote: Here's what actually happened, if anyone cares. Tarek and friends announced a fork of setuptools. I reviewed the work and saw that -- for the most part -- I was happy with it, and opined as how I might be willing to bless the the "package inquisition" team as official maintai

Re: [Python-Dev] Distutils ML wrap-up: setup.cfg new format

2009-09-30 Thread Chris Withers
Antoine Pitrou wrote: As far as I'm concerned, anything which looks intuitive enough (e.g. ini-style) and not overly complicated is fine. The details of the syntax aren't really important as long as they make sense, and don't get in the way. This is a variant of "as simple as possible and requi

Re: [Python-Dev] sharing stdlib across python implementations

2009-09-30 Thread Olemis Lang
On Wed, Sep 30, 2009 at 9:28 AM, Chris Withers wrote: > Frank Wierzbicki wrote: >> >> Talk has started up again on the stdlib-sig list about finding a core >> stdlib + tests that can be shared by all implementations, potentially >> living apart from CPython. > [...] > > if the > stdlib was actuall

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Steven Bethard
On Wed, Sep 30, 2009 at 5:21 AM, Barry Warsaw wrote: > On Sep 29, 2009, at 11:15 PM, Martin v. Löwis wrote: > >> I would propose that the format argument gets an argument name, >> according to the syntax it is written in. For PEP 3101 format, >> I would call the argument "format" (like the method

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Barry Warsaw
On Sep 30, 2009, at 11:22 AM, Steven Bethard wrote: On Wed, Sep 30, 2009 at 5:21 AM, Barry Warsaw wrote: On Sep 29, 2009, at 11:15 PM, Martin v. Löwis wrote: I would propose that the format argument gets an argument name, according to the syntax it is written in. For PEP 3101 format, I woul

Re: [Python-Dev] sharing stdlib across python implementations

2009-09-30 Thread Olemis Lang
On Wed, Sep 30, 2009 at 9:43 AM, Antoine Pitrou wrote: > Chris Withers simplistix.co.uk> writes: >> >> I'm on on stdlib-sig and I'm afraid I don't have the bandwidth to start >> on it, but I'd just like to throw in (yet again) that it would be great >> if the stdlib was actually a set of separate

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Steven Bethard
On Wed, Sep 30, 2009 at 8:31 AM, Barry Warsaw wrote: > On Sep 30, 2009, at 11:22 AM, Steven Bethard wrote: >> On Wed, Sep 30, 2009 at 5:21 AM, Barry Warsaw wrote: >>> On Sep 29, 2009, at 11:15 PM, Martin v. Löwis wrote: I would propose that the format argument gets an argument name, acc

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Barry Warsaw
On Sep 30, 2009, at 11:39 AM, Steven Bethard wrote: Thanks for the clarification. I generally like this approach, though it's not so convenient for argparse which already takes format strings like this:: parser = ArgumentParser(usage='%(prog)s [--foo]') parser.add_argument( '--foo'

Re: [Python-Dev] sharing stdlib across python implementations

2009-09-30 Thread Olemis Lang
On Wed, Sep 30, 2009 at 10:37 AM, Olemis Lang wrote: > On Wed, Sep 30, 2009 at 9:43 AM, Antoine Pitrou wrote: >> Chris Withers simplistix.co.uk> writes: >>> [...] > > For instance, I have started something like that has been dome by the > FLiOOPS  project [1]_ Sorry for the missing reference an

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread R. David Murray
On Wed, 30 Sep 2009 at 10:52, Paul Moore wrote: 2009/9/30 Mark Dickinson : Please could someone who understands the uses of IPNetwork better than I do explain why the following wouldn't be a significant problem, if __eq__ and __hash__ were modified to disregard the .ip attribute as suggested:

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Vinay Sajip
Yuvgoog Greenle gmail.com> writes: > +1 for adding argparse and eventually deprecating optparse, -0 for deprecating getopt. > 2. Big modules - 1 uber-module for each subject that does everything. Maybe logging is an example of this. I'm not sure that it is, if you mean code size. In Python 2.5,

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread James Y Knight
On Sep 30, 2009, at 10:34 AM, Steven D'Aprano wrote: E.g. x = newstyle_formatstr("{} {} {}") x % (1,2,3) == x.format(1,2,3) == "1 2 3" Moving along, let's suppose the newstyle_formatstr is introduced. What's the intention then? Do we go through the std lib and replace every call to (say)

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Vinay Sajip
Brett Cannon python.org> writes: > Obviously if one of the getopt supporters has a better way of doing > this then please speak up. I'm not a getopt supporter per se - I'm +1 for argparse - but Opster provides some nice syntax sugar on top of getopt, and can be seen here: http://blogg.ingspree.

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Raymond Hettinger
The positional parameter would also mean dicttemplate, and would be deprecated (eventually requiring a keyword-only parameter). Although I hate the name 'dicttemplate', this seems like the best solution to me. Maybe it's good that 'dicttemplate' is so ugly though so that people will naturally

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Terry Reedy
Mark Dickinson wrote: On Wed, Sep 30, 2009 at 1:44 AM, Nick Coghlan wrote: Please could someone who understands the uses of IPNetwork better than I do explain why the following wouldn't be a significant problem, if __eq__ and __hash__ were modified to disregard the .ip attribute as suggested:

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Guido van Rossum
On a tangent -- a use case that I see happening frequently but which is pretty poorly supported by optparse is a command-line that has a bunch of general flags, then a 'subcommand name', and then more flags, specific to the subcommand. Most here are probably familiar with this pattern from SVN, Hg,

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Robert Kern
On 2009-09-29 18:38 PM, Steven Bethard wrote: I don't really use GUI libraries, so I wouldn't be able to come up with such an example. I'd also rather not make API changes based on speculative use cases, so before I spend time documenting these things, I'd really like to hear from someone who ha

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Martin v. Löwis
>>> There's a lot of code already out there (in the standard library and >>> other places) that uses %-style formatting, when in Python 3.0 we >>> should be encouraging {}-style formatting. >> >> I don't agree that we should do that. I see nothing wrong with using >> % substitution. > > It's a ma

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Terry Reedy
James Y Knight wrote: > allow users to use newstyle string substitution with every API. However it is done, I think someone (like new Python programmers) should be able to program in Python3, and use everything in the stdlib, without ever learning % formatting -- and that I should be able to fo

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Martin v. Löwis
> Although I hate the name 'dicttemplate', this seems like the best > solution to me. Maybe it's good that 'dicttemplate' is so ugly though > so that people will naturally prefer 'format' :). But I like this > because there's not really any magic, it's explicit, and the decision is > made by the

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Robert Kern
On 2009-09-30 11:38 AM, Guido van Rossum wrote: On a tangent -- a use case that I see happening frequently but which is pretty poorly supported by optparse is a command-line that has a bunch of general flags, then a 'subcommand name', and then more flags, specific to the subcommand. Most here are

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Antoine Pitrou
James Y Knight fuhm.net> writes: > > The user could write either: > logging.Formatter("%(asctime)s - %(name)s - %(level)s - %(msg)s") > (as always -- that can't be changed without a long deprecation > period), or: > logging.Formatter(newstyle_formatstr("{asctime} - {name} - {level} - > {msg}"

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Raymond Hettinger
[Terry Reedy] However it is done, I think someone (like new Python programmers) should be able to program in Python3, and use everything in the stdlib, without ever learning % formatting -- and that I should be able to forget about it ;-). +10 on the goal. If that were possible, it would b

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Steven Bethard
On Wed, Sep 30, 2009 at 8:50 AM, Barry Warsaw wrote: > On Sep 30, 2009, at 11:39 AM, Steven Bethard wrote: > >> Thanks for the clarification. I generally like this approach, though >> it's not so convenient for argparse which already takes format strings >> like this:: >> >>   parser = ArgumentPar

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Guido van Rossum
On Wed, Sep 30, 2009 at 9:48 AM, "Martin v. Löwis" wrote: >> I'd note that PEP 3101 calls str.format() a replacement for >> %-formatting, not an alternate mechanism to achieve the same end. > > I think this is a mis-wording; the intent of the PEP apparently is > to propose this mechanism as an opt

Re: [Python-Dev] Python logging and 1.5.2 compatibility

2009-09-30 Thread Martin v. Löwis
> PEP 291 (Backward Compatibility for Standard Library) mentions logging as > having > 1.5.2 compatibility, and I'm thinking that it can be removed from that PEP > altogether. Done! Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.p

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Barry Warsaw
On Sep 30, 2009, at 12:58 PM, Robert Kern wrote: I don't think argparse supports the "foo --help subcommand" OOB. I think it would be simple to modify argparse to make it do so. It does support general options followed by a subcommand with options, though. Right. I've made it kind of wor

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Barry Warsaw
On Sep 30, 2009, at 1:01 PM, Antoine Pitrou wrote: Why not allow logging.Formatter to take a callable, which would in turn call the callable with keyword arguments? Therefore, you could write: logging.Formatter("{asctime} - {name} - {level} - {msg}".format) This is a very interesting idea

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Brett Cannon
On Wed, Sep 30, 2009 at 09:21, Vinay Sajip wrote: > Brett Cannon python.org> writes: > >> Obviously if one of the getopt supporters has a better way of doing >> this then please speak up. > > I'm not a getopt supporter per se - I'm +1 for argparse - but Opster provides > some nice syntax sugar on

Re: [Python-Dev] Python 2.6.3

2009-09-30 Thread Sridhar Ratnakumar
2.6.3rc1 builds fine on Linux x86/x86_64, MacOSX 10.4 ppc/x86, Windows 32bit/64bit, HP-UX, AIX and Solaris just like 2.6.2 did. -srid On Wed, 30 Sep 2009 05:34:02 -0700, Barry Warsaw wrote: On Sep 30, 2009, at 12:29 AM, Ned Deily wrote: In my opinion, the standard python.org OS X installe

Re: [Python-Dev] Python 2.6.3

2009-09-30 Thread Barry Warsaw
On Sep 30, 2009, at 3:36 PM, Sridhar Ratnakumar wrote: 2.6.3rc1 builds fine on Linux x86/x86_64, MacOSX 10.4 ppc/x86, Windows 32bit/64bit, HP-UX, AIX and Solaris just like 2.6.2 did. Thanks for the feedback! Did you run the test suite on any of these? -Barry PGP.sig Description: This is

Re: [Python-Dev] Python 2.6.3

2009-09-30 Thread Raymond Hettinger
[Sridhar Ratnakumar] 2.6.3rc1 builds fine on Linux x86/x86_64, MacOSX 10.4 ppc/x86, Windows 32bit/64bit, HP-UX, AIX and Solaris just like 2.6.2 did. Did the test suite pass too? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail

Re: [Python-Dev] Python 2.6.3

2009-09-30 Thread Sridhar Ratnakumar
On Wed, 30 Sep 2009 12:44:14 -0700, Barry Warsaw wrote: 2.6.3rc1 builds fine on Linux x86/x86_64, MacOSX 10.4 ppc/x86, Windows 32bit/64bit, HP-UX, AIX and Solaris just like 2.6.2 did. Thanks for the feedback! Did you run the test suite on any of these? I will run the tests sometime tonight

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Guido van Rossum
On Wed, Sep 30, 2009 at 4:33 AM, Mark Dickinson wrote: > On Wed, Sep 30, 2009 at 12:06 PM, Nick Coghlan wrote: >> Mark Dickinson wrote: >>> Okay, so maybe this is an abuse of IPv4Network.  But I'd (mis?)understood >>> that the retention of the .ip attribute was precisely a convenience to allow >>

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread R. David Murray
On Wed, 30 Sep 2009 at 13:11, Guido van Rossum wrote: On Wed, Sep 30, 2009 at 4:33 AM, Mark Dickinson wrote: On Wed, Sep 30, 2009 at 12:06 PM, Nick Coghlan wrote: Mark Dickinson wrote: Okay, so maybe this is an abuse of IPv4Network. ?But I'd (mis?)understood that the retention of the .ip att

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Andrew McNabb
On Wed, Sep 30, 2009 at 02:22:53PM -0400, Barry Warsaw wrote: > > Right. I've made it kind of work in Mailman 3, but it would be nice for > argparse to support this out of the box. Note that I think you want two > forms: > > foo help subcommand > foo subcommand --help > > to basically print the

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Robert Kern
On 2009-09-30 15:17 PM, Andrew McNabb wrote: On Wed, Sep 30, 2009 at 02:22:53PM -0400, Barry Warsaw wrote: Right. I've made it kind of work in Mailman 3, but it would be nice for argparse to support this out of the box. Note that I think you want two forms: foo help subcommand foo subcommand

Re: [Python-Dev] Announcing PEP 3136

2009-09-30 Thread Yuvgoog Greenle
I like how python has a minimalistic and powerful syntax (-1 for the break ___ PEP). Also, I really dislike the for/else ambiguity "butterflies". When is the else after a loop executed?1. When the loop isn't entered at all. 2. When the loop terminates through exhaustion of the list (does this inclu

Re: [Python-Dev] Announcing PEP 3136

2009-09-30 Thread Michael Foord
Yuvgoog Greenle wrote: I like how python has a minimalistic and powerful syntax (-1 for the break ___ PEP). Also, I really dislike the for/else ambiguity "butterflies". When is the else after a loop executed? 1. When the loop isn't entered at all. If you mean because the list / iterator is emp

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Vinay Sajip
Brett Cannon python.org> writes: > I am reluctant to jump on these argument parsing decorators until they > have existed outside the standard library for a while and have settled > down as I suspect some people want to use annotations to do type > conversion/checking, others don't, etc. > I agr

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Martin v. Löwis
> I don't know -- this is (from what Peter told me) a common use case so > he (and presumably others) would from time to time have to write > extra code to keep track of that IP address in a new app. I, and probably others, would really, REALLY like to see one such "common use case". I do find it

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Steven Bethard
On Wed, Sep 30, 2009 at 1:17 PM, Andrew McNabb wrote: > >From my cursory reading of the documentation, it looks like argparse can > only add subparsers for subcommands.  Is there any way to add subparsers > based on options instead (as iptables does)? Currently this is not supported, but it would

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Nick Coghlan
Steven Bethard wrote: > So I understand how this might help a user to move from %-style > formatting to {}-style formatting, but it's still not clear to me how > to use this to evolve an API. In particular, if the goal is for the > API to move from accepting %-style format strings to {}-style forma

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Peter Moody
[...@google.com] this is what I wrote: it's not so much a need as it is useful. it's useful to take an address like 192.168.1.100/24 and derive a bunch of information from it (like the network address, broadcast address, containing supernets, etc), but still remember that the original address wa

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Raymond Hettinger
I don't know -- this is (from what Peter told me) a common use case so he (and presumably others) would from time to time have to write extra code to keep track of that IP address in a new app. [MvL] I, and probably others, would really, REALLY like to see one such "common use case". I do fi

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Peter Moody
[...@google.com] On Wed, Sep 30, 2009 at 2:51 PM, Raymond Hettinger wrote: > >>> I don't know -- this is (from what Peter told me) a common use case so >>> he (and presumably  others) would from time to time have to write >>> extra code to keep track of that IP address in a new app. > > [MvL] >>

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Daniel Stutzbach
.On Wed, Sep 30, 2009 at 3:33 PM, R. David Murray wrote: >1) do not add another class, just pass around (IPvXAddress, >IPVXNetwork) tuples when the address needs to be retained (or write >your own tailored trivial class, like I did in my example). > I've been puzzled by objections to

Re: [Python-Dev] Python 2.6.3rc1 available

2009-09-30 Thread Ben Finney
Barry Warsaw writes: > The first (and hopefully last) release candidate for Python 2.6.3 is > now available […] Thank you for this announcement, and the efforts that go into making this work available. *Especially* thank you for avoiding the oxymoronic “Released: 2.6.3 release candidate” or sim

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-30 Thread Andrew McNabb
On Wed, Sep 30, 2009 at 02:40:20PM -0700, Steven Bethard wrote: > > > Also, is it possible to add these subparsers dynamically?  For example, > > you would want to be able to load a module immediately after parsing the > > name instead of having to keep a predetermined list of all module names. >

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Vinay Sajip
Steven Bethard gmail.com> writes: > There's a lot of code already out there (in the standard library and > other places) that uses %-style formatting, when in Python 3.0 we > should be encouraging {}-style formatting. We should really provide > some sort of transition plan. Consider an example fr

Re: [Python-Dev] Announcing PEP 3136

2009-09-30 Thread Terry Reedy
Yuvgoog Greenle wrote: I like how python has a minimalistic and powerful syntax (-1 for the break ___ PEP). Also, I really dislike the for/else ambiguity "butterflies". Properly understood, no ambiguity. while c: x() is equivalent to hypothetical label z: if c: x() goto: z So while

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Brett Cannon
On Wed, Sep 30, 2009 at 16:03, Vinay Sajip wrote: > Steven Bethard gmail.com> writes: > >> There's a lot of code already out there (in the standard library and >> other places) that uses %-style formatting, when in Python 3.0 we >> should be encouraging {}-style formatting. We should really provi

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Antoine Pitrou
Vinay Sajip yahoo.co.uk> writes: > > Does it seems too onerous to expect people to pass an additional "use_format" > keyword argument with every logging call to indicate how to interpret the > message format string? Or does the PercentMessage/BraceMessage type approach > have any mileage? What do

Re: [Python-Dev] PEP 3144 review.

2009-09-30 Thread Stephen J. Turnbull
Daniel Stutzbach writes: > People have voiced support for the IPNetwork class The obvious use cases are 1. parsing and validating strings that purport to describe networks, 2. providing a received for the result of a function that deduces the network from an arbitrary address and a mask

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Vinay Sajip
Antoine Pitrou pitrou.net> writes: > Why not allow logging.Formatter to take a callable, which would in turn call > the callable with keyword arguments? > > Therefore, you could write: >logging.Formatter("{asctime} - {name} - {level} - {msg}".format) > > and then: >logging.critical(name

Re: [Python-Dev] transitioning from % to {} formatting

2009-09-30 Thread Vinay Sajip
Barry Warsaw python.org> writes: > > This is a very interesting idea. > > Note that one of the reasons to /at least/ support {}-strings also is > that %-strings are simply too error prone in many situations. For > example, if I decide to support internationalization of log format > strin