Re: Organisation of python classes and their methods

2012-11-02 Thread Steven D'Aprano
On Fri, 02 Nov 2012 09:08:07 +0100, Martin Hewitson wrote: > Even if one takes reasonable numbers: 20 methods, each method has 20 > lines of documentation, then we immediately have 400 lines in the file > before writing a line of code. It would seem much more natural to me to > have these methods

Re: Organisation of python classes and their methods

2012-11-02 Thread Steven D'Aprano
On Sat, 03 Nov 2012 01:06:45 +, Steven D'Aprano wrote: > 100 lines is approximately and a half pages using a 10pt font size > (depending on the font and the platform, of course). Crap. I meant approx *one* and a half pages. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Organisation of python classes and their methods

2012-11-02 Thread Steven D'Aprano
On Fri, 02 Nov 2012 07:16:09 +0100, Martin Hewitson wrote: > I'm beginning a large Python project which contains many packages, > modules and classes. The organisation of those is clear to me. [...] > I don't like having source files with > 100's of lines of code in, let alone 1000's. Why? Do you

Re: Organisation of python classes and their methods

2012-11-02 Thread Paul Rubin
Martin Hewitson writes: >> you want just ONE method, something like "map"... > Well, because one of the features that the framework will have is to > capture history steps (in a tree structure) so that each processing > step the user does is tracked. So while methods such as abs(), cos(), > etc wi

Re: Organisation of python classes and their methods

2012-11-02 Thread Martin Hewitson
On 2, Nov, 2012, at 06:24 PM, Paul Rubin wrote: > Martin Hewitson writes: >> Well, here we disagree. Suppose I have a class which encapsulates >> time-series data. Below is a list of the absolute minimum methods one >> would have to process that data. ... >> 'abs' >> 'acos' >> 'asin' >>

Re: Organisation of python classes and their methods

2012-11-02 Thread Paul Rubin
Martin Hewitson writes: > Well, here we disagree. Suppose I have a class which encapsulates > time-series data. Below is a list of the absolute minimum methods one > would have to process that data. ... > 'abs' > 'acos' > 'asin' > ... Ok, THERE is your problem. Why do you have separ

Re: Organisation of python classes and their methods

2012-11-02 Thread Mark Lawrence
On 02/11/2012 14:49, Martin Hewitson wrote: [Top posting fixed] BTW: If you told us which language(s) you have a background in, it could be easier to help you with identifying the idioms in that language that turn into misconceptions when applied to Python. Greetings! Uli [1] Actual

Re: Organisation of python classes and their methods

2012-11-02 Thread Martin Hewitson
> > > BTW: If you told us which language(s) you have a background in, it could be > easier to help you with identifying the idioms in that language that turn > into misconceptions when applied to Python. I'm considering porting some MATLAB code to python to move away from commercial software

Re: Organisation of python classes and their methods

2012-11-02 Thread Martin Hewitson
On 2, Nov, 2012, at 11:49 AM, Ulrich Eckhardt wrote: > Am 02.11.2012 09:20, schrieb Martin Hewitson: >> Well, here we disagree. Suppose I have a class which encapsulates >> time-series data. Below is a list of the absolute minimum methods one >> would have to process that data. > [...] > > 'abs

Re: Organisation of python classes and their methods

2012-11-02 Thread Ulrich Eckhardt
Am 02.11.2012 09:08, schrieb Martin Hewitson: On 2, Nov, 2012, at 08:38 AM, Paul Rubin wrote: Martin Hewitson writes: So, is there a way to put these methods in their own files and have them 'included' in the class somehow? ... Is there an official python way to do this? I don't like having s

Re: Organisation of python classes and their methods

2012-11-02 Thread Ulrich Eckhardt
Am 02.11.2012 09:20, schrieb Martin Hewitson: Well, here we disagree. Suppose I have a class which encapsulates time-series data. Below is a list of the absolute minimum methods one would have to process that data. [...] > 'abs' 'acos' 'asin' 'atan' 'atan2' 'average' 'cohere' 'conv' 'corr' > 'co

Re: Organisation of python classes and their methods

2012-11-02 Thread Robert Kern
On 11/2/12 10:48 AM, Mark Lawrence wrote: On 02/11/2012 08:45, Martin Hewitson wrote: On 2, Nov, 2012, at 09:40 AM, Mark Lawrence wrote: On 02/11/2012 08:08, Martin Hewitson wrote: Even if one takes reasonable numbers: 20 methods, each method has 20 lines of documentation, then we immediat

Re: Organisation of python classes and their methods

2012-11-02 Thread Robert Kern
On 11/2/12 10:21 AM, Peter Otten wrote: Martin Hewitson wrote: On 2, Nov, 2012, at 09:40 AM, Mark Lawrence wrote: 20 lines of documentation per method? As far as I'm concerned that's not a smell, that's a stink. Wow, I don't think I've ever been criticised before for writing too much doc

Re: Organisation of python classes and their methods

2012-11-02 Thread Mark Lawrence
On 02/11/2012 08:45, Martin Hewitson wrote: On 2, Nov, 2012, at 09:40 AM, Mark Lawrence wrote: On 02/11/2012 08:08, Martin Hewitson wrote: Even if one takes reasonable numbers: 20 methods, each method has 20 lines of documentation, then we immediately have 400 lines in the file before writ

Re: Organisation of python classes and their methods

2012-11-02 Thread Steven D'Aprano
On Fri, 02 Nov 2012 08:40:06 +, Mark Lawrence wrote: > On 02/11/2012 08:08, Martin Hewitson wrote: >> >> Even if one takes reasonable numbers: 20 methods, each method has 20 >> lines of documentation, then we immediately have 400 lines in the file >> before writing a line of code. It would see

Re: Organisation of python classes and their methods

2012-11-02 Thread Peter Otten
Martin Hewitson wrote: > On 2, Nov, 2012, at 09:40 AM, Mark Lawrence > wrote: >> 20 lines of documentation per method? As far as I'm concerned that's not >> a smell, that's a stink. > > Wow, I don't think I've ever been criticised before for writing too much > documentation :) > > I guess we

Re: Organisation of python classes and their methods

2012-11-02 Thread Frank Millman
On 02/11/2012 08:16, Martin Hewitson wrote: Dear list, I'm relatively new to Python and have googled and googled but haven't found a reasonable answer to this question, so I thought I'd ask it here. I'm beginning a large Python project which contains many packages, modules and classes. The or

Re: Organisation of python classes and their methods

2012-11-02 Thread Martin Hewitson
On 2, Nov, 2012, at 09:40 AM, Mark Lawrence wrote: > On 02/11/2012 08:08, Martin Hewitson wrote: >> >> Even if one takes reasonable numbers: 20 methods, each method has 20 lines >> of documentation, then we immediately have 400 lines in the file before >> writing a line of code. It would seem

Re: Organisation of python classes and their methods

2012-11-02 Thread Chris Angelico
On Fri, Nov 2, 2012 at 7:08 PM, Martin Hewitson wrote: > > On 2, Nov, 2012, at 08:38 AM, Paul Rubin wrote: > >> Martin Hewitson writes: >>> So, is there a way to put these methods in their own files and have >>> them 'included' in the class somehow? ... Is there an official python >>> way to do

Re: Organisation of python classes and their methods

2012-11-02 Thread Peter Otten
Martin Hewitson wrote: > > On 2, Nov, 2012, at 09:00 AM, Peter Otten <__pete...@web.de> wrote: > >> Martin Hewitson wrote: >> >>> Dear list, >>> >>> I'm relatively new to Python and have googled and googled but haven't >>> found a reasonable answer to this question, so I thought I'd ask it >>>

Re: Organisation of python classes and their methods

2012-11-02 Thread Robert Kern
On 11/2/12 8:20 AM, Martin Hewitson wrote: On 2, Nov, 2012, at 09:00 AM, Peter Otten <__pete...@web.de> wrote: Martin Hewitson wrote: Dear list, I'm relatively new to Python and have googled and googled but haven't found a reasonable answer to this question, so I thought I'd ask it here. I

Re: Organisation of python classes and their methods

2012-11-02 Thread Mark Lawrence
On 02/11/2012 08:08, Martin Hewitson wrote: Even if one takes reasonable numbers: 20 methods, each method has 20 lines of documentation, then we immediately have 400 lines in the file before writing a line of code. It would seem much more natural to me to have these methods in their own file,

Re: Organisation of python classes and their methods

2012-11-02 Thread Martin Hewitson
On 2, Nov, 2012, at 09:00 AM, Peter Otten <__pete...@web.de> wrote: > Martin Hewitson wrote: > >> Dear list, >> >> I'm relatively new to Python and have googled and googled but haven't >> found a reasonable answer to this question, so I thought I'd ask it here. >> >> I'm beginning a large Pyth

Re: Organisation of python classes and their methods

2012-11-02 Thread Martin Hewitson
On 2, Nov, 2012, at 08:38 AM, Paul Rubin wrote: > Martin Hewitson writes: >> So, is there a way to put these methods in their own files and have >> them 'included' in the class somehow? ... Is there an official python >> way to do this? I don't like having source files with 100's of lines >> of

Re: Organisation of python classes and their methods

2012-11-02 Thread Peter Otten
Martin Hewitson wrote: > Dear list, > > I'm relatively new to Python and have googled and googled but haven't > found a reasonable answer to this question, so I thought I'd ask it here. > > I'm beginning a large Python project which contains many packages, modules > and classes. The organisation

Re: Organisation of python classes and their methods

2012-11-02 Thread Paul Rubin
Martin Hewitson writes: > So, is there a way to put these methods in their own files and have > them 'included' in the class somehow? ... Is there an official python > way to do this? I don't like having source files with 100's of lines > of code in, let alone 1000's. That code sounds kind of sme