Re: Rawest raw string literals

2017-04-20 Thread Jussi Piitulainen
Tim Chase writes: > A number of tools use a custom quote-string: > > Bash: > > cat < "single and double" with \ and / > EOT [snip] > PS: yes, bash's does interpolate strings, so you still need to do > escaping within, but the arbitrary-user-specified-delimiter idea still > holds. If you p

Re: Bigotry (you win, I give up)

2017-04-20 Thread Rurpy via Python-list
On 04/20/2017 01:46 PM, Ben Finney wrote: >[...] > I am not obliged to address every point of every post, and the absence > of comment on any particular point is not generally to be read as full > assent. Certainly anyone is free to choose to ignore bigotry on the list, because one agrees with it,

Re: Rawest raw string literals

2017-04-20 Thread MRAB
On 2017-04-21 01:11, Tim Chase wrote: On 2017-04-20 16:40, Grant Edwards wrote: How can there exist a "universal solution" even in theory? There has to be some sort of "end of literal" terminator character sequence. That means there has to be some sort of escaping mechanism when that "end of l

Re: Rawest raw string literals

2017-04-20 Thread Tim Chase
On 2017-04-20 16:40, Grant Edwards wrote: > How can there exist a "universal solution" even in theory? > > There has to be some sort of "end of literal" terminator character > sequence. That means there has to be some sort of escaping > mechanism when that "end of literal" sequence appears in the

Re: Rawest raw string literals

2017-04-20 Thread MRAB
On 2017-04-20 22:03, Mikhail V wrote: On 20 April 2017 at 22:43, Random832 wrote: On Thu, Apr 20, 2017, at 16:01, Grant Edwards wrote: On 2017-04-20, MRAB wrote: > There _is_ a "universal solution"; it's called a Hollerith constant. :-) Wow, I haven't seen one of those in a _long_ time -- pr

Re: Rawest raw string literals

2017-04-20 Thread Chris Angelico
On Fri, Apr 21, 2017 at 7:37 AM, Stefan Ram wrote: > Mikhail V writes: >>But the less probable it is, the more complex or ugly would the tag >>become. >>E.g. curly braces {} seems to be much less frequent characters >>for filenames and command line arguments. > > When one uses brackets to delim

Re: Rawest raw string literals

2017-04-20 Thread Mikhail V
On 20 April 2017 at 22:43, Random832 wrote: > On Thu, Apr 20, 2017, at 16:01, Grant Edwards wrote: >> On 2017-04-20, MRAB wrote: >> > There _is_ a "universal solution"; it's called a Hollerith constant. :-) >> >> Wow, I haven't seen one of those in a _long_ time -- probably about 45 >> years. I

Re: Metaclass conundrum - binding value from an outer scope

2017-04-20 Thread Lele Gaifax
Skip Montanaro writes: > underlying = getattr(SomeOtherClass, a) > def _meth(self, *args): > return underlying(self._instance, *args) Does underlying = getattr(SomeOtherClass, a) def _meth(self, *args, _underlying=underlying): return _unde

Re: Rawest raw string literals

2017-04-20 Thread Mikhail V
On 20 April 2017 at 19:27, Chris Angelico wrote: > On Fri, Apr 21, 2017 at 2:26 AM, wrote: >> I find this:- >> >> s = r"ffmpeg -i '\\server-01\D\SER_Bigl.mpg' " >> >> vastly superior. > > It's semantically different though. I don't know whether single quotes > are valid in that context, on Wind

Re: Rawest raw string literals

2017-04-20 Thread Random832
On Thu, Apr 20, 2017, at 16:01, Grant Edwards wrote: > On 2017-04-20, MRAB wrote: > > There _is_ a "universal solution"; it's called a Hollerith constant. :-) > > Wow, I haven't seen one of those in a _long_ time -- probably about 45 > years. I think the first FORTAN implementation I used was WA

Re: Metaclass conundrum - binding value from an outer scope

2017-04-20 Thread Peter Otten
Skip Montanaro wrote: > For various reasons, I have a class which delegates much functionality to > a singleton instance of another class (exposed by pybind11) instead of > inheriting from that class. So, the construction looks like this (this is > in Python 2.7): > > from someothermodule import

Re: Rawest raw string literals

2017-04-20 Thread Grant Edwards
On 2017-04-20, MRAB wrote: > On 2017-04-20 17:40, Grant Edwards wrote: > >> There has to be some sort of "end of literal" terminator character >> sequence. That means there has to be some sort of escaping mechanism >> when that "end of literal" sequence appears in the literal itself. >> > There

Re: Bigotry (you win, I give up)

2017-04-20 Thread Ben Finney
Like most people here, I think this thread has long ago served whatever usefulness it will have. I'm not interested in continuing it. I'll just respond to some direct questions, but don't take any lack of response on particular points as agreement. Rurpy via Python-list writes: > Rereading your

Metaclass conundrum - binding value from an outer scope

2017-04-20 Thread Skip Montanaro
For various reasons, I have a class which delegates much functionality to a singleton instance of another class (exposed by pybind11) instead of inheriting from that class. So, the construction looks like this (this is in Python 2.7): from someothermodule import SomeOtherClass as _SomeOtherClass

Re: Rawest raw string literals

2017-04-20 Thread MRAB
On 2017-04-20 17:40, Grant Edwards wrote: On 2017-04-20, Mikhail V wrote: On 20 April 2017 at 17:59, Grant Edwards wrote: On 2017-04-20, Mikhail V wrote: Quite often I need raw string literals for concatenating console commands. I want to input them exactly as they are in python sources. T

Re: Bigotry (you win, I give up)

2017-04-20 Thread Rurpy via Python-list
On 04/20/2017 09:25 AM, Rustom Mody wrote: >[...] > No one seems to have noticed who Rurpy is defending : Ranting Rick and Bart. > Sheesh! > A rhinocerous would have gossamer skin compared to these 'gentlemen' > Sheesh² ! You are mistaken. I am not defending Rick or Bart both of whom I am well a

Re: Bigotry (you win, I give up)

2017-04-20 Thread Rurpy via Python-list
On 04/19/2017 08:27 PM, Ben Finney wrote: > Rurpy via Python-list writes: > >> You and Chris refused to find any fault with the use of the two >> stereotypes under discussion one of which was "unable-to-learn old >> people". > > I expressed absolutely nothing on that topic, so I didn't “refuse t

Re: Bigotry and hate speech on the python mailing list

2017-04-20 Thread Rurpy via Python-list
On 04/17/2017 03:39 AM, Marko Rauhamaa wrote: >[...] I meant to respond to this earlier but forgot to. I'll respond to the following part now since there seems to be some confusion about my motives/intent. > In my experience, the bar for banning participants is pretty high, and > rightly so. Car

Re: Rawest raw string literals

2017-04-20 Thread Arthur Havlicek
No escaping is not something possible, in your suggested syntax ") is ambigous. E.g. raw("abcd")") is ambigous. Any sequence delimited string involves escaping, the only thing that wouldnt would be size-defined strings but they are impractical. Le 20/04/2017 à 18:03, Mikhail V a écrit : On 2

Re: Rawest raw string literals

2017-04-20 Thread eryk sun
On Thu, Apr 20, 2017 at 5:27 PM, Chris Angelico wrote: > On Fri, Apr 21, 2017 at 2:26 AM, wrote: >> I find this:- >> >> s = r"ffmpeg -i '\\server-01\D\SER_Bigl.mpg' " >> >> vastly superior. > > It's semantically different though. I don't know whether single quotes > are valid in that context, o

Re: How to obtain an up-to-date document of tkinter

2017-04-20 Thread Terry Reedy
On 4/20/2017 3:19 AM, Mok-Kong Shen wrote: Am 20.04.2017 um 02:16 schrieb breamore...@gmail.com: On Thursday, April 20, 2017 at 1:09:45 AM UTC+1, Mok-Kong Shen wrote: How could one obtain an up-to-date document of tkinter. I ask this question because apparently there are stuffs of tkinter that

Re: Bigotry and hate speech on the python mailing list

2017-04-20 Thread jmp
On 04/18/2017 02:48 AM, Ethan Furman wrote: On 04/17/2017 03:23 PM, Ben Finney wrote: So I will continue to treat all those topics equally: peripheral comments on beliefs are just part of respectful human discourse, so long as I'm respectful of the people who may hold such beliefs. So you're o

Re: [Python-ideas] Callable Enum values

2017-04-20 Thread Ethan Furman
On 04/20/2017 10:40 AM, Steve D'Aprano wrote: On Fri, 21 Apr 2017 03:20 am, Ethan Furman wrote: [redirecting back to the list] Possibly the wrong list? This isn't Python-Ideas. Woops! Thanks. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] Callable Enum values

2017-04-20 Thread Steve D'Aprano
On Fri, 21 Apr 2017 03:20 am, Ethan Furman wrote: > [redirecting back to the list] Possibly the wrong list? This isn't Python-Ideas. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/pyth

Re: Rawest raw string literals

2017-04-20 Thread Chris Angelico
On Fri, Apr 21, 2017 at 2:26 AM, wrote: > I find this:- > > s = r"ffmpeg -i '\\server-01\D\SER_Bigl.mpg' " > > vastly superior. It's semantically different though. I don't know whether single quotes are valid in that context, on Windows. ChrisA -- https://mail.python.org/mailman/listinfo/pyth

Re: [Python-ideas] Callable Enum values

2017-04-20 Thread Ethan Furman
[redirecting back to the list] On 04/19/2017 11:15 PM, Stephan Hoyer wrote: Ethan and Steven, Thanks for your feedback on this one. I agree that it probably doesn't make sense for the standard library. I'm still not really happy with any of the standard approaches for choosing a function bas

Re: Rawest raw string literals

2017-04-20 Thread breamoreboy
On Thursday, April 20, 2017 at 4:59:48 PM UTC+1, Grant Edwards wrote: > On 2017-04-20, Mikhail V wrote: > > Quite often I need raw string literals for concatenating console commands. > > I want to input them exactly as they are in python sources. > > > > There is r"" string, but it is obviously not

Re: Rawest raw string literals

2017-04-20 Thread Grant Edwards
On 2017-04-20, Mikhail V wrote: > On 20 April 2017 at 17:44, Mikhail V wrote: >> Quite often I need raw string literals for concatenating console commands. >> I want to input them exactly as they are in python sources. >> >> There is r"" string, but it is obviously not enough because e.g. this: >

Re: Rawest raw string literals

2017-04-20 Thread Grant Edwards
On 2017-04-20, Mikhail V wrote: > On 20 April 2017 at 17:59, Grant Edwards wrote: >> On 2017-04-20, Mikhail V wrote: >>> Quite often I need raw string literals for concatenating console commands. >>> I want to input them exactly as they are in python sources. >>> >>> There is r"" string, but it

Re: Rawest raw string literals

2017-04-20 Thread Chris Angelico
On Fri, Apr 21, 2017 at 2:16 AM, Mikhail V wrote: > On 20 April 2017 at 17:59, Grant Edwards wrote: >> On 2017-04-20, Mikhail V wrote: >>> Quite often I need raw string literals for concatenating console commands. >>> I want to input them exactly as they are in python sources. >>> >>> There is r

Re: Rawest raw string literals

2017-04-20 Thread Mikhail V
On 20 April 2017 at 17:59, Grant Edwards wrote: > On 2017-04-20, Mikhail V wrote: >> Quite often I need raw string literals for concatenating console commands. >> I want to input them exactly as they are in python sources. >> >> There is r"" string, but it is obviously not enough because e.g. thi

Re: Rawest raw string literals

2017-04-20 Thread Chris Angelico
On Fri, Apr 21, 2017 at 2:03 AM, Mikhail V wrote: > On 20 April 2017 at 17:55, Chris Angelico wrote: >> On Fri, Apr 21, 2017 at 1:44 AM, Mikhail V wrote: >>> What I think: why there is no some built-in function, for example like: >>> s = raw("ffmpeg -i "\\server-01\D\SER_Bigl__"") >>> >>> which

Re: Rawest raw string literals

2017-04-20 Thread Mikhail V
On 20 April 2017 at 17:55, Chris Angelico wrote: > On Fri, Apr 21, 2017 at 1:44 AM, Mikhail V wrote: >> What I think: why there is no some built-in function, for example like: >> s = raw("ffmpeg -i "\\server-01\D\SER_Bigl__"") >> >> which would just need *one* quote sign in the beginning and on

RE: Bigotry (you win, I give up)

2017-04-20 Thread Deborah Swanson
And the moral to the story is: Don't worry. Be happy. And reach fot the stars (while still being mindful of those around you). -- https://mail.python.org/mailman/listinfo/python-list

Re: Rawest raw string literals

2017-04-20 Thread Grant Edwards
On 2017-04-20, Mikhail V wrote: > Quite often I need raw string literals for concatenating console commands. > I want to input them exactly as they are in python sources. > > There is r"" string, but it is obviously not enough because e.g. this: > s = r"ffmpeg -i "\\server-01\D\SER_Bigl.mpg" "

Re: Rawest raw string literals

2017-04-20 Thread Mikhail V
On 20 April 2017 at 17:44, Mikhail V wrote: > Quite often I need raw string literals for concatenating console commands. > I want to input them exactly as they are in python sources. > > There is r"" string, but it is obviously not enough because e.g. this: > s = r"ffmpeg -i "\\server-01\D\SER_Bi

Re: Rawest raw string literals

2017-04-20 Thread Chris Angelico
On Fri, Apr 21, 2017 at 1:44 AM, Mikhail V wrote: > What I think: why there is no some built-in function, for example like: > s = raw("ffmpeg -i "\\server-01\D\SER_Bigl__"") > > which would just need *one* quote sign in the beginning and on the end. > Would it be useful, what do you think? I thin

Rawest raw string literals

2017-04-20 Thread Mikhail V
Quite often I need raw string literals for concatenating console commands. I want to input them exactly as they are in python sources. There is r"" string, but it is obviously not enough because e.g. this: s = r"ffmpeg -i "\\server-01\D\SER_Bigl.mpg" " is not valid. The closest I've found is tr

Re: Bigotry (you win, I give up)

2017-04-20 Thread Rustom Mody
On Thursday, April 20, 2017 at 5:11:58 AM UTC+5:30, Ethan Furman wrote: > On 04/19/2017 03:58 PM, Ben Finney wrote: > > Ethan Furman writes: > > > >> […] asking that you be courteous to those who come here to discuss > >> Python. > > > > On that we can agree. Let's be courteous to people here, and

RE: The belief that learning is more difficult for older people (was: Bigotry (you win, I give up))

2017-04-20 Thread Deborah Swanson
Poor souls. It isn't pretty when the mind lets go. Maybe it sounds cold, but these people did make the choice every day of most of their lives to not bother themselves about the why of things, to not pay attention to this, to let someone else worry about that, etc. The sad thing is that this ad is

Re: The belief that learning is more difficult for older people (was: Bigotry (you win, I give up))

2017-04-20 Thread Rustom Mody
On Thursday, April 20, 2017 at 7:51:55 AM UTC+5:30, Ben Finney wrote: > "Deborah Swanson" writes: > > > But this bit caught my eye because I hold the opposite opinion about > > old people's ability to learn. > > > > It is a choice. > > The topic is complex, and both “It is entirely determined by

Unusual reactions (Was: .Re: Using Loops to track user input)

2017-04-20 Thread Jan van den Broek
On 2017-04-20, Robert L. wrote: Two things: - There's a '.' in front of "Re". - There's no "References"-header in your messages, this may confuse some newsreaders. -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.org/mailman/listinfo/python-list

Re: Test if Script Already Running

2017-04-20 Thread Marko Rauhamaa
Jon Ribbens : > On 2017-04-20, Cameron Simpson wrote: >> For myself, I like mkdir. It is portable. It is atomic. It fails if >> the target exists. It works over NFS etc. It is easy. >> >> os.mkdir('lock') >> ... do stuff ... >> os.rmdir('lock') > > One downside to this is that if the proce

Re: Test if Script Already Running

2017-04-20 Thread Jon Ribbens
On 2017-04-20, Cameron Simpson wrote: > Others have pointed the way to an exact implementation. > > For myself, I like mkdir. It is portable. It is atomic. It fails if > the target exists. It works over NFS etc. It is easy. > > os.mkdir('lock') > ... do stuff ... > os.rmdir('lock') One dow

Re: match.groupdict() into a single dict

2017-04-20 Thread Ganesh Pal
apologies for spamming and Sorry my bad the solution suggested by MRAB works fine : ) with open("/tmp/2.repo","r") as f: for line in f: for line in f: result = re.search(r'MSG=attempt to record(.*)LINSNAP', line) if result: subpatterns = [r

Re: match.groupdict() into a single dict

2017-04-20 Thread Ganesh Pal
> Why would you expect a single dictionary? You're doing 3 separate matches! > > correct, I didn't knew how to combine it all the patterns You could just combine the patterns as alternatives: > > # The alternatives are matched repeatedly. The final '.' alternative > # will consume a character i

Re: How to obtain an up-to-date document of tkinter

2017-04-20 Thread Mok-Kong Shen
Am 20.04.2017 um 08:08 schrieb Terry Reedy: On 4/19/2017 8:09 PM, Mok-Kong Shen wrote: [snip] I ask this question because apparently there are stuffs of tkinter that worked in Python 3.5 but no longer in Python 3.6.1. I don't know of any such. Please see my reply to breamoreboy. M. K. Shen

Re: How to obtain an up-to-date document of tkinter

2017-04-20 Thread Mok-Kong Shen
Am 20.04.2017 um 02:16 schrieb breamore...@gmail.com: On Thursday, April 20, 2017 at 1:09:45 AM UTC+1, Mok-Kong Shen wrote: How could one obtain an up-to-date document of tkinter. I ask this question because apparently there are stuffs of tkinter that worked in Python 3.5 but no longer in Python