Re: [Tutor] Spell checking source code?

2009-06-01 Thread Stefan Behnel
Alan Gauld wrote: > > "Allen Fowler" wrote > >> Are there any utilities to help "spell check" source code? >> (Docstrings, etc) > > I used to have an emacvs script that could do it for C/C++ using > the vanilla Unix spell program. Unfiortunately I can't remember its name > but a hunt around the

Re: [Tutor] Spell checking source code?

2009-06-01 Thread xbmuncher
if you're on windows, notepad++ has a spell check feature in it using aspell On Mon, Jun 1, 2009 at 7:50 PM, Alan Gauld wrote: > > "Allen Fowler" wrote > > Are there any utilities to help "spell check" source code? (Docstrings, >> etc) >> > > I used to have an emacvs script that could do it fo

Re: [Tutor] Spell checking source code?

2009-06-01 Thread Alan Gauld
"Allen Fowler" wrote Are there any utilities to help "spell check" source code? (Docstrings, etc) I used to have an emacvs script that could do it for C/C++ using the vanilla Unix spell program. Unfiortunately I can't remember its name but a hunt around the e,macs web sites might throw up a

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Alan Gauld
"Kent Johnson" wrote > We can fake the Delphi style by using a default constructor and then > just > calling the "constructors" after initialisation: > But its two lines not one... :-( Why not this? class C: def __init__(self): pass @staticmethod def LoadFromFile(fname, count): c

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Alan Gauld
"Kent Johnson" wrote But its two lines not one... :-( Why not this? class C: def __init__(self): pass @staticmethod def LoadFromFile(fname, count): c = C() # init c from the file return c and similar for Create(). Client code is one line: c = C.LoadFromFile(fn, cnt) Kent

[Tutor] Spell checking source code?

2009-06-01 Thread Allen Fowler
Hello, Are there any utilities to help "spell check" source code? (Docstrings, etc) Thank you, :) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread W W
On Mon, Jun 1, 2009 at 3:55 PM, Alan Gauld wrote: > > "W W" wrote > >> class C: >>> @constructor >>> def LoadFromFile(fname, count): ... >>> @constructor >>> def Create(valueTuple):... >>> >>> Personally I prefer the Delphi style sincve it makes the constructor >>> call explicit and adds

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Kent Johnson
On Mon, Jun 1, 2009 at 4:55 PM, Alan Gauld wrote: > We can fake the Delphi style by using a default constructor and then just > calling the "constructors" after initialisation: > > class C: >        def __init__(): pass >       @constructor >       def LoadFromFile(fname, count): ... >     �...@c

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Alan Gauld
"W W" wrote class C: @constructor def LoadFromFile(fname, count): ... @constructor def Create(valueTuple):... Personally I prefer the Delphi style sincve it makes the constructor call explicit and adds to the documentation. Alan G That does make it problematic... although I sup

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread W W
On Mon, Jun 1, 2009 at 8:59 AM, Alan Gauld wrote: > > "W W" wrote > > ( Multiple constructors (or factory methods) is one feature I would like >>> to see added to Python! ) >>> >> >> Wouldn't it be possible to create sort of a... bastardization? i.e. >> >> def __init__(self, *args): >> if len

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Michael H . Goldwasser
Chris, Thanks for your well-written reply. Your analogy to the complexities of other special methods is well noted. I'll accept the "small price for flexibility" that you note, if necessary. However, I still desire a cleaner solution. I can examine the inherited slots to see which sp

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Alan Gauld
"W W" wrote ( Multiple constructors (or factory methods) is one feature I would like to see added to Python! ) Wouldn't it be possible to create sort of a... bastardization? i.e. def __init__(self, *args): if len(args) == 0: #do something if len(args) == 1: #do somethin

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread W W
On Mon, Jun 1, 2009 at 2:27 AM, Alan Gauld wrote: > > "Kent Johnson" wrote > >> > Yesterday, I posted a question to python-list involving custom >> > deepcopies in an inheritance hierarchy. I haven't received any >> >> ISTM that in general B.__deepcopy__() should call A.__deepcopy__() to do >> th

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread Alan Gauld
"Kent Johnson" wrote > Yesterday, I posted a question to python-list involving custom > deepcopies in an inheritance hierarchy. I haven't received any ISTM that in general B.__deepcopy__() should call A.__deepcopy__() to do the "A" part of the work. In your example, this won't work because

Re: [Tutor] Sample python file/module templates?

2009-06-01 Thread Alan Gauld
"Allen Fowler" wrote In terms of in-code documentation of function / section headers, change logs, etc. Are there well-done sample files I can use as inspiration? The standard library. Much of it is written in Python and the documentation is designed to play well with Pythons help() func