Re: Quiz: Difference between implicit and explicit inheritence

2017-08-28 Thread Steve D'Aprano
On Mon, 28 Aug 2017 11:27 pm, Pavol Lisy wrote: > object = int # this could be trick > ... > class Spam(object): > ... > > dis.dis show difference too, next line is just for "class > Spam(object):" version: > LOAD_GLOBAL 0 (object) > > So nor rebinding object nor

Re: Quiz: Difference between implicit and explicit inheritence

2017-08-28 Thread Pavol Lisy
On 8/28/17, Steven D'Aprano wrote: > In Python 3, what's the difference between these two classes? > # implicitly inherit from object > class Spam: > ... > > # explicitly inherit from object > class Spam(object): > ... > > If you sense a trick

re quiz

2008-06-12 Thread David C. Ullrich
True or False? (no fair looking it up) (*) If repl is a string then re.sub(pattern, repl, s) returns s with non-overlapping occurences of pattern replaced by repl. I assumed it was true - spent a few hours trying to figure out what was going on with a certain re.sub, then noticed that (*) is

Re: re quiz

2008-06-12 Thread John Machin
On Jun 12, 8:57 pm, David C. Ullrich [EMAIL PROTECTED] wrote: True or False? (no fair looking it up) (*) If repl is a string then re.sub(pattern, repl, s) returns s with non-overlapping occurences of pattern replaced by repl. I assumed it was true - spent a few hours trying to figure out

Re: re quiz

2008-06-12 Thread Peter Otten
David C. Ullrich wrote: (Or is there a function somewhere that will convert r\remark{Hint} to r\\remark{Hint} for me, and do the same for precisely the escpapes referred to in the and so forth?) I think you just have to escape the backslash: re.sub(pattern, replacement_string.replace(\\,

Re: re quiz

2008-06-12 Thread Duncan Booth
David C. Ullrich [EMAIL PROTECTED] wrote: Practical question: What's a _complete_ list of the escapes included in the and so forth in (**)? (Or is there a function somewhere that will convert r\remark{Hint} to r\\remark{Hint} for me, and do the same for precisely the escpapes referred to

Re: re quiz

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 05:12:55 -0700 (PDT), John Machin [EMAIL PROTECTED] wrote: On Jun 12, 8:57 pm, David C. Ullrich [EMAIL PROTECTED] wrote: True or False? (no fair looking it up) (*) If repl is a string then re.sub(pattern, repl, s) returns s with non-overlapping occurences of pattern

Re: re quiz

2008-06-12 Thread David C. Ullrich
On Thu, 12 Jun 2008 14:12:31 +0200, Peter Otten [EMAIL PROTECTED] wrote: David C. Ullrich wrote: (Or is there a function somewhere that will convert r\remark{Hint} to r\\remark{Hint} for me, and do the same for precisely the escpapes referred to in the and so forth?) I think you just have

Re: re quiz

2008-06-12 Thread David C. Ullrich
On 12 Jun 2008 12:32:13 GMT, Duncan Booth [EMAIL PROTECTED] wrote: David C. Ullrich [EMAIL PROTECTED] wrote: Practical question: What's a _complete_ list of the escapes included in the and so forth in (**)? (Or is there a function somewhere that will convert r\remark{Hint} to

Re: re quiz

2008-06-12 Thread Johannes Bauer
David C. Ullrich schrieb: -- care to tell us what a certain re.sub is, and false in what way? Read the OP. Well, aren't you funny. Maybe you should have referenced the other thread so one can find the OP? Regards, Johannes -- Wer etwas kritisiert muss es noch lange nicht selber besser

Re: re quiz

2008-06-12 Thread David C. Ullrich
In article [EMAIL PROTECTED], Johannes Bauer [EMAIL PROTECTED] wrote: David C. Ullrich schrieb: -- care to tell us what a certain re.sub is, and false in what way? Read the OP. Well, aren't you funny. Maybe you should have referenced the other thread so one can find the OP?