Re: Most probably a stupid question, but I still want to ask

2016-04-11 Thread Steven D'Aprano
On Monday 11 April 2016 14:03, Fillmore wrote: > I'll make sure I approach the temple of pythonistas bare-footed and with > greater humility next time Don't forget to rip your clothes into rags and heap ashes on your head too. -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: Most probably a stupid question, but I still want to ask

2016-04-11 Thread Rustom Mody
On Monday, April 11, 2016 at 11:12:39 AM UTC+5:30, Stephen Hansen wrote: > On Sun, Apr 10, 2016, at 10:18 PM, Rustom Mody wrote: > > On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote: > > > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > > > > and the (almost always to be

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Marko Rauhamaa
Terry Reedy : > On 4/10/2016 8:17 PM, Fillmore wrote: > >> apparently my 'discontinuity' is mappable to the fact that there's no >> such thing as one-element tuples in Python, and attempts to create >> one will result in a string (i.e. an object of a different kind!)... > > Please work through the

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 10:18 PM, Rustom Mody wrote: > On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote: > > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > > > and the (almost always to be avoided) use of eval() > > > > FWIW, there's ast.literal_eval which is safe and

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Rustom Mody
On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote: > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > > and the (almost always to be avoided) use of eval() > > FWIW, there's ast.literal_eval which is safe and there's no reason to > avoid it. Its error reporting is clunky

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > and the (almost always to be avoided) use of eval() FWIW, there's ast.literal_eval which is safe and there's no reason to avoid it. You'll still have to deal with the fact that a single string on a line will return a string while multiples will

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Fillmore
On 04/10/2016 11:54 PM, Steven D'Aprano wrote: On Mon, 11 Apr 2016 12:48 pm, Fillmore wrote: funny, but it seems to me that you are taking it personally... thank god i even apologized in advance for what was most probably a stupid question.. I hope you did get a laugh out of it, because it w

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Steven D'Aprano
On Mon, 11 Apr 2016 12:48 pm, Fillmore wrote: > > funny, but it seems to me that you are taking it personally... thank god i > even apologized in advance for what was most probably a stupid question.. I hope you did get a laugh out of it, because it wasn't meant to be nasty. But it was meant to

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Fillmore
funny, but it seems to me that you are taking it personally... thank god i even apologized in advance for what was most probably a stupid question.. On 04/10/2016 09:50 PM, Steven D'Aprano wrote: Fillmore, you should feel very pleased with yourself. All the tens of thousands of Python program

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Steven D'Aprano
On Mon, 11 Apr 2016 08:51 am, Fillmore wrote: > at which point did the language designers decide to betray the > "path of least surprise" principle and create a 'discontinuity' in the > language? It was March 1996, and I was there. I don't remember the date, I'm afraid. Some of the core Python de

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Terry Reedy
On 4/10/2016 8:17 PM, Fillmore wrote: apparently my 'discontinuity' is mappable to the fact that there's no such thing as one-element tuples in Python, and attempts to create one will result in a string (i.e. an object of a different kind!)... Please work through the tutorial before posting wr

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 05:17 PM, Fillmore wrote: > On 04/10/2016 07:30 PM, Stephen Hansen wrote: > > > There's nothing inconsistent or surprising going on besides you doing > > something vaguely weird and not really expressing what you find > > surprising. > > well, I was getting some surprisin

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Fillmore
On 04/10/2016 07:30 PM, Stephen Hansen wrote: There's nothing inconsistent or surprising going on besides you doing something vaguely weird and not really expressing what you find surprising. well, I was getting some surprising results for some of my data, so I can guarantee that I was surpris

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Stephen Hansen
On Sun, Apr 10, 2016, at 03:51 PM, Fillmore wrote: > > let's look at this: > > $ python3.4 > Python 3.4.0 (default, Apr 11 2014, 13:05:11) > [GCC 4.8.2] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> line1 = '"String1" | bla' > >>> parts1 = line1.split("

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Ben Finney
Fillmore writes: > let's look at this: Can you set a “Subject” field that pertains to the actual question? As is, it doesn't help know what you want to discuss. > the question is: at which point did the language designers decide to > betray the "path of least surprise" principle and create a >

Re: Most probably a stupid question, but I still want to ask

2016-04-10 Thread Chris Angelico
On Mon, Apr 11, 2016 at 8:51 AM, Fillmore wrote: > the question is: at which point did the language designers decide to betray > the > "path of least surprise" principle and create a 'discontinuity' in the > language? > Open to the idea that I am getting something fundamentally wrong. I'm new to >