Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-12 Thread Alan Gauld
It still seems to me that the actual updating of the article should be a Node method (it is the Node object's article that is being updated, after all). Yes, the owner of the data should update it. Call it node_linkify. The new thought is to create two new methods for the TP_file class: -

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-11 Thread Brian van den Broek
Alan Gauld said unto the world upon 2005-02-10 02:58: Pseudo code: class Body: def __init__(self,content): self.contents = contents self.nodes = [] def parse(self): for line in self.contents: if line == NodeStartTag:

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-11 Thread Kent Johnson
Brian van den Broek wrote: Alan Gauld said unto the world upon 2005-02-10 02:58: Pseudo code: class Body: def __init__(self,content): self.contents = contents self.nodes = [] def parse(self): for line in self.contents:

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-10 Thread Alan Gauld
The main change in refactoring is moving it to OOP. I have a method that serves as the entry point for parsing the files. Not an object? If you are thinking terms of what the methods do its probably not OOP... I would expect to see an object for the File, another for the Header, a third for

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-10 Thread Brian van den Broek
Alan Gauld said unto the world upon 2005-02-10 02:58: The main change in refactoring is moving it to OOP. I have a method that serves as the entry point for parsing the files. Not an object? If you are thinking terms of what the methods do its probably not OOP... Hi Alan, That may well be :-)

Re: [Tutor] help with refactoring needed -- which approach is morePythonic?

2005-02-10 Thread Kent Johnson
Alan Gauld wrote: The main change in refactoring is moving it to OOP. I have a method that serves as the entry point for parsing the files. Not an object? If you are thinking terms of what the methods do its probably not OOP... I would expect to see an object for the File, another for the Header,