Re: [Tutor] Modify inherited methods

2010-04-28 Thread Walter Wefft
Steven D'Aprano wrote: > And for guru-level mastery, replace to call to dict.__init__ with ... nothing at all, because dict.__init__ doesn't do anything. > > > (Sorry, should have sent to list). I don't understand this - it must do something: class MyDict1(dict): def __init__(self, *args,

Re: [Tutor] (no subject)

2010-04-28 Thread Alan Gauld
"Marco Rompré" wrote Oups my posting was too big!!! In general it is better to popst long listings (over 100 lines say) to a web site such as pastebin. That will ensure they are readable and will not fill up peoples mailboxes unnecessarily. However, even better is to reproduce your error in

Re: [Tutor] Modify inherited methods

2010-04-28 Thread spir ☣
On Wed, 28 Apr 2010 07:53:06 +0100 Walter Wefft wrote: > Steven D'Aprano wrote: > > And for guru-level mastery, replace to call to dict.__init__ with ... > nothing at all, because dict.__init__ doesn't do anything. > > > > > > > > (Sorry, should have sent to list). > > I don't understand t

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Walter Wefft
spir ☣ wrote: On Wed, 28 Apr 2010 07:53:06 +0100 Walter Wefft wrote: Steven D'Aprano wrote: > And for guru-level mastery, replace to call to dict.__init__ with ... nothing at all, because dict.__init__ doesn't do anything. > > > (Sorry, should have sent to list). I don't understand thi

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Steven D'Aprano
On Wed, 28 Apr 2010 04:53:06 pm Walter Wefft wrote: > Steven D'Aprano wrote: > > And for guru-level mastery, replace to call to dict.__init__ with > > ... > > nothing at all, because dict.__init__ doesn't do anything. [...] > Behaviour is different depending on whether you call the superclass > _

Re: [Tutor] Using Regex to produce text

2010-04-28 Thread mhw
While some patterns are infinite, other's aren't (e.g. The example I gave). Using a subset of Regex syntax to produce a set of strings has the advantage of using a well understood and documented form, and if you could hook into the existing API, at minimal coding effort. In addition, it allows

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Emile van Sebille
On 4/28/2010 3:20 AM Walter Wefft said... spir ☣ wrote: On Wed, 28 Apr 2010 07:53:06 +0100 Walter Wefft wrote: === class MyDict0(dict): pass class MyDict1(dict): def __init__(self, *args, **kw): pass class MyDict2(dict): def __init__(self, *args, **kw): dict.__ini

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Walter Wefft
Emile van Sebille wrote: On 4/28/2010 3:20 AM Walter Wefft said... spir ☣ wrote: On Wed, 28 Apr 2010 07:53:06 +0100 Walter Wefft wrote: === class MyDict0(dict): pass class MyDict1(dict): def __init__(self, *args, **kw): pass class MyDict2(dict): def __init__(self

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Emile van Sebille
On 4/28/2010 9:32 AM Walter Wefft said... Emile van Sebille wrote: On 4/28/2010 3:20 AM Walter Wefft said... You reiterate my point. To say that dict.__init__ can be omitted in a subclass's __init__ with no effect, is not a correct statement. It wasn't the omitted case that exhibits the diff

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Eike Welk
On Wednesday April 28 2010 13:04:30 Steven D'Aprano wrote: > On Wed, 28 Apr 2010 04:53:06 pm Walter Wefft wrote: > > Steven D'Aprano wrote: > > > And for guru-level mastery, replace to call to dict.__init__ with > > > ... > > > > nothing at all, because dict.__init__ doesn't do anything. > > [..

Re: [Tutor] Modify inherited methods

2010-04-28 Thread C M Caine
Thank you all. One tangentially related question: what does (self, *args, **kwargs) actually mean? How does one reference variables given to a function that accepts these inputs? Colin ___ Tutor maillist - Tutor@python.org To unsubscribe or change subs

[Tutor] Python beginner having troubles understanding word lists and character lists

2010-04-28 Thread Daniel
Hello, I'm a beginner programmer, trying to learn python. I'm currently reading The programming Historian, http://wiki.python.org/moin/BeginnersGuide/NonProgrammers I stumbled into lists of words and lists of characters. I have no explications in that book for those two and I didn't found some expl

Re: [Tutor] Python beginner having troubles understanding word lists and character lists

2010-04-28 Thread Luke Paireepinart
On Wed, Apr 28, 2010 at 2:06 PM, Daniel wrote: > Hello, I'm a beginner programmer, trying to learn python. I'm currently > reading The programming > Historian,http://wiki.python.org/moin/BeginnersGuide/NonProgrammers > I stumbled into lists of words and lists of characters. I have no > explication

Re: [Tutor] Using Regex to produce text

2010-04-28 Thread Lie Ryan
On 04/29/10 01:32, m...@doctors.net.uk wrote: > While some patterns are infinite, other's aren't (e.g. The example I gave). How should the regex engine know about that? > Using a subset of Regex syntax to produce a set of strings has the > advantage of using a well understood and documented for

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Eike Welk
On Wednesday April 28 2010 20:57:27 C M Caine wrote: > Thank you all. One tangentially related question: what does (self, > *args, **kwargs) actually mean? How does one reference variables given > to a function that accepts these inputs? *args is a tuple containing the positional arguments; **kwa

Re: [Tutor] Using Regex to produce text

2010-04-28 Thread Jerry Hill
On Wed, Apr 28, 2010 at 2:27 AM, wrote: > Is there an way of using the regex patterns to produce text, instead of > matching it? There have been some previous discussions about generating all of the possible matches for a given regular expressions. I believe these are the first messages in a c

Re: [Tutor] Using Regex to produce text

2010-04-28 Thread Steven D'Aprano
On Thu, 29 Apr 2010 06:36:18 am Lie Ryan wrote: > On 04/29/10 01:32, m...@doctors.net.uk wrote: > > While some patterns are infinite, other's aren't (e.g. The example > > I gave). > > How should the regex engine know about that? The regex engine itself doesn't run in reverse, so it can't know this

[Tutor] date problems

2010-04-28 Thread Eric Meigs
I want to create a program to tell me when I am supposed to do things. I have a text file with dates like 4-4-2010' as well as other data. I want to read in this date into my code and then compare it with 'date.today()' example 'if /variable/ >= today:' I don't see how to read in a string and

Re: [Tutor] date problems

2010-04-28 Thread Alan Gauld
"Eric Meigs" wrote I don't see how to read in a string and get it into a format for comparison. Have you loked at the time and datetime modules? They should do all you need. -- Alan Gauld Author of the Learn to Program web site http://www.alan-g.me.uk/ ___

Re: [Tutor] Python beginner having troubles understanding word listsand character lists

2010-04-28 Thread Alan Gauld
"Daniel" wrote I stumbled into lists of words and lists of characters. I have no explications in that book for those two and I didn't found some explications on the web. aListOfWords = ['one','word','or','many'] aListOfCharacters = ['a','s','d','f'] aStringOfCharacters = 'asdf' aWord = aS

Re: [Tutor] Python beginner having troubles understanding word lists and character lists

2010-04-28 Thread Steven D'Aprano
On Thu, 29 Apr 2010 05:06:22 am Daniel wrote: > Hello, I'm a beginner programmer, trying to learn python. I'm > currently reading The programming Historian, > http://wiki.python.org/moin/BeginnersGuide/NonProgrammers > I stumbled into lists of words and lists of characters. I have no > explications

Re: [Tutor] date problems

2010-04-28 Thread Alex Clark
On 2010-04-28, Eric Meigs wrote: > This is a multi-part message in MIME format. > --===0277013919== > Content-Type: multipart/alternative; > boundary="060806000801070600050409" > > This is a multi-part message in MIME format. > --060806000801070600050409 >