Re: Python wart

2013-11-01 Thread Peter Cacioppi
Chris said : "It does look cool on paper. " Sure, I'll buy that Bjarne designed something intellectually pretty that just doesn't flow very well in practice. Most of his C++ worked very well both in theory and practice, so I can forgive him one nerdy overreach, if that's what it was. Python i

Re: Python wart

2013-11-01 Thread Chris Angelico
On Sat, Nov 2, 2013 at 12:11 PM, Peter Cacioppi wrote: > In general, I liked all the C++ additions a lot. I really liked the STL. But > I don't know what Bjarne was thinking with the streams. It does look cool on paper. You can "see" the flow of data. Everything's type-safe - unlike C's scanf fa

Re: Python wart

2013-11-01 Thread Peter Cacioppi
Chris said : " I almost exclusively use C-style formatted strings, even sometimes going to the extent of using fopen() just so I can use fprintf() rather than fstream. Also, I often create a class something like this: " Ditto all that, to include the special class I cooked up to handle printf

Re: Python wart

2013-11-01 Thread Chris Angelico
On Sat, Nov 2, 2013 at 8:47 AM, Peter Cacioppi wrote: > I always thought printf was sort of crappy. > > I thought the C++ << business even worse. Oh, you'll get no argument from me about the std::*stream types! When I write C++ code, I almost exclusively use C-style formatted strings, even someti

Re: Python wart

2013-11-01 Thread Peter Cacioppi
Mark said : "so I can get an extremely large pair of pliers with which I can extract my tongue from my cheek :) " OK fair enough, and my post was in the same spirit. Chris said : "Maybe, but it's supported by so many languages that it is of value. " Sure, I suppose someone should make a modul

Re: Python wart

2013-11-01 Thread Chris Angelico
On Fri, Nov 1, 2013 at 8:32 PM, Mark Lawrence wrote: > I wondered if the idea of deprecating printf style formatting might also > come up again. It was discussed in some depth here > https://mail.python.org/pipermail/python-dev/2012-February/116789.html I don't see any reason for it to go. Anyon

Re: Python wart

2013-11-01 Thread Mark Lawrence
On 01/11/2013 09:17, Chris Angelico wrote: On Fri, Nov 1, 2013 at 8:08 PM, Mark Lawrence wrote: I'm heading into town in maybe an hour. I'll stop here http://www.toolbankexpress.com/shop/castle/ so I can get an extremely large pair of pliers with which I can extract my tongue from my cheek :)

Re: Python wart

2013-11-01 Thread Chris Angelico
On Fri, Nov 1, 2013 at 8:08 PM, Mark Lawrence wrote: > I'm heading into town in maybe an hour. I'll stop here > http://www.toolbankexpress.com/shop/castle/ so I can get an extremely large > pair of pliers with which I can extract my tongue from my cheek :) I think you may have a bit of trouble.

Re: Python wart

2013-11-01 Thread Mark Lawrence
On 01/11/2013 07:11, Peter Cacioppi wrote: Mark said : "Do I have to raise a PEP to get this stupid language changed so that it dynamically recognises what I want it to do and acts accordingly?" The printf syntax in C isn't any wonderful thing, and there is no obligation to provide some Python

Re: Python wart

2013-11-01 Thread Chris Angelico
On Fri, Nov 1, 2013 at 6:11 PM, Peter Cacioppi wrote: > The printf syntax in C isn't any wonderful thing, and there is no obligation > to provide some Python version of it. Maybe, but it's supported by so many languages that it is of value. Though Python's use of the % operator does lead to edge

Re: Python wart

2013-11-01 Thread Peter Cacioppi
Mark said : "Do I have to raise a PEP to get this stupid language changed so that it dynamically recognises what I want it to do and acts accordingly?" The printf syntax in C isn't any wonderful thing, and there is no obligation to provide some Python version of it. I have to say, there were

Re: Python wart

2013-10-31 Thread Michael Torrie
On 10/31/2013 08:56 PM, Mark Lawrence wrote: > On 01/11/2013 02:41, Michael Torrie wrote: >> On 10/31/2013 07:45 PM, Mark Lawrence wrote: >>> Quite often I type this >>> >>> print('Total of accounts %.2f', total) >>> >>> when I meant to type this >>> >>> print('Total of accounts %.2f' % total) >>>

Re: Python wart

2013-10-31 Thread Mark Lawrence
On 01/11/2013 02:41, Michael Torrie wrote: On 10/31/2013 07:45 PM, Mark Lawrence wrote: Quite often I type this print('Total of accounts %.2f', total) when I meant to type this print('Total of accounts %.2f' % total) Do I have to raise a PEP to get this stupid language changed so that it dyn

Re: Python wart

2013-10-31 Thread Michael Torrie
On 10/31/2013 07:45 PM, Mark Lawrence wrote: > Quite often I type this > > print('Total of accounts %.2f', total) > > when I meant to type this > > print('Total of accounts %.2f' % total) > > Do I have to raise a PEP to get this stupid language changed so that it > dynamically recognises what

Re: Python wart

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 12:45 PM, Mark Lawrence wrote: > Quite often I type this > > print('Total of accounts %.2f', total) > > when I meant to type this > > print('Total of accounts %.2f' % total) > > Do I have to raise a PEP to get this stupid language changed so that it > dynamically recognises

Re: Python wart

2013-10-31 Thread MRAB
On 01/11/2013 01:45, Mark Lawrence wrote: Quite often I type this print('Total of accounts %.2f', total) when I meant to type this print('Total of accounts %.2f' % total) Do I have to raise a PEP to get this stupid language changed so that it dynamically recognises what I want it to do and ac

Re: Python wart

2013-10-31 Thread Chris Angelico
On Fri, Nov 1, 2013 at 12:53 PM, Chris Angelico wrote: > orig_print = print > def print(fmt, *args, **kwargs): > orig_print(fmt%args, **kwargs) PS. To be courteous to subsequent developers, you might want to instead leave print as it is, and create your own printf: def printf(fmt, *args, **k

Python wart

2013-10-31 Thread Mark Lawrence
Quite often I type this print('Total of accounts %.2f', total) when I meant to type this print('Total of accounts %.2f' % total) Do I have to raise a PEP to get this stupid language changed so that it dynamically recognises what I want it to do and acts accordingly? Yours most frustratedly.