Re: Import order question

2014-03-10 Thread Albert van der Horst
In article le108a$oip$1...@dont-email.me, Rotwang sg...@hotmail.co.uk wrote: On 18/02/2014 23:41, Rick Johnson wrote: On Tuesday, February 18, 2014 5:28:21 PM UTC-6, Rotwang wrote: [snipped material restored for context] On 18/02/2014 21:44, Rick Johnson wrote: [...] Are you telling me

Re: Import order question

2014-03-10 Thread Rotwang
On 18/02/2014 23:28, Rotwang wrote: [...] I have music software that's a single 9K-line Python module, which I edit using Notepad++ or gedit. Incidentally, in the time since I wrote the above I've started using Sublime Text 3, following somebody on c.l.p's recommendation (I apologise that I

Re: Import order question

2014-02-19 Thread Chris Angelico
On Wed, Feb 19, 2014 at 6:32 PM, Steven D'Aprano st...@pearwood.info wrote: On Tue, 18 Feb 2014 13:44:47 -0800, Rick Johnson wrote: Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) ... For a mere 4000 lines of code, yes, I'd

Re: Import order question

2014-02-19 Thread Roy Smith
In article 53045df2$0$2788$c3e8da3$76491...@news.astraweb.com, Steven D'Aprano st...@pearwood.info wrote: How do you know that the module tk_optionmenu.py contains the class OptionMenu? Perhaps it contains the function optionmenu. Or the class TK_OptionMenu. Stuff like this is a really

Re: Import order question

2014-02-18 Thread Rick Johnson
On Monday, February 17, 2014 1:40:41 PM UTC-6, Ben Finney wrote: Nagy László Zsolt ... writes: Use modules to group your class definitions conceptually. There is no need whatever to separate every class into a different module. If there is a consensus, and it is really desireable to put

Re: Import order question

2014-02-18 Thread Chris Angelico
On Wed, Feb 19, 2014 at 7:41 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: # ui_main.py from ui_mod1 import * from ui_mod2 import * from ui_mod3 import * from ui_mod4 import * At least by this method i can maintain the code base without wearing-out my scroll

Re: Import order question

2014-02-18 Thread Rick Johnson
On Tuesday, February 18, 2014 3:02:26 PM UTC-6, Chris Angelico wrote: On Wed, Feb 19, 2014 at 7:41 AM, Rick Johnson wrote: # ui_main.py from ui_mod1 import * from ui_mod2 import * from ui_mod3 import * from ui_mod4 import * At least by this method i can maintain

Re: Import order question

2014-02-18 Thread Chris Angelico
On Wed, Feb 19, 2014 at 8:44 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class named OptionMenu Yeah, actually I am. At my last job,

Re: Import order question

2014-02-18 Thread Michael Torrie
On 02/17/2014 06:01 AM, Nagy László Zsolt wrote: I have a class hierarchy like this: Widget - VisualWidget - BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a tree. In order to manage the order of widgets,

Re: Import order question

2014-02-18 Thread Tim Chase
On 2014-02-19 08:49, Chris Angelico wrote: Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class named OptionMenu At my last job, I had a single C++ file of roughly 5K lines, and it

Re: Import order question

2014-02-18 Thread Grant Edwards
On 2014-02-18, Chris Angelico ros...@gmail.com wrote: On Wed, Feb 19, 2014 at 8:44 AM, Rick Johnson rantingrickjohn...@gmail.com wrote: Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class

Re: Import order question

2014-02-18 Thread Grant Edwards
On 2014-02-18, Tim Chase python.l...@tim.thechases.com wrote: On 2014-02-19 08:49, Chris Angelico wrote: Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class named OptionMenu At my

Re: Import order question

2014-02-18 Thread Rick Johnson
On Tuesday, February 18, 2014 4:17:48 PM UTC-6, Tim Chase wrote: On 2014-02-19 08:49, Chris Angelico wrote: At my last job, I had a single C++ file of roughly 5K lines, and it wasn't at all unmanageable. Probably wouldn't have been a problem to have another order of magnitude on that. What

Re: Import order question

2014-02-18 Thread Rotwang
On 18/02/2014 21:44, Rick Johnson wrote: [...] Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class named OptionMenu (of which three other classes contain a method of the same exact name!),

Re: Import order question

2014-02-18 Thread Rick Johnson
On Tuesday, February 18, 2014 5:28:21 PM UTC-6, Rotwang wrote: I have music software that's a single 9K-line Python module, which I edit using Notepad++ or gedit. If I wish to find e.g. the method edit of class sequence I can type Ctrl-fclass seqReturndef edit(Return This is not about

Re: Import order question

2014-02-18 Thread MRAB
On 2014-02-18 23:28, Rotwang wrote: On 18/02/2014 21:44, Rick Johnson wrote: [...] Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class named OptionMenu (of which three other classes

Re: Import order question

2014-02-18 Thread Rotwang
On 18/02/2014 23:41, Rick Johnson wrote: On Tuesday, February 18, 2014 5:28:21 PM UTC-6, Rotwang wrote: [snipped material restored for context] On 18/02/2014 21:44, Rick Johnson wrote: [...] Are you telling me you're willing to search through a single file containing 3,734 lines of code

Re: Import order question

2014-02-18 Thread Chris Angelico
On Wed, Feb 19, 2014 at 9:17 AM, Tim Chase python.l...@tim.thechases.com wrote: On 2014-02-19 08:49, Chris Angelico wrote: Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class named

Re: Import order question

2014-02-18 Thread Steven D'Aprano
On Tue, 18 Feb 2014 15:41:32 -0800, Rick Johnson wrote: Heck, when a class gets too big i even export some of the methods to outside modules and load the methods dynamically at run-time just to cut down on the length. I suppose my detractors would find that surprising also! Not in the least

Re: Import order question

2014-02-18 Thread Steven D'Aprano
On Tue, 18 Feb 2014 13:44:47 -0800, Rick Johnson wrote: Are you telling me you're willing to search through a single file containing 3,734 lines of code (yes, Tkinter) looking for a method named destroy of a class named OptionMenu (of which three other classes contain a method of the same

Import order question

2014-02-17 Thread Nagy László Zsolt
I have a class hierarchy like this: Widget - VisualWidget - BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a tree. In order to manage the order of widgets, I need methods to append children. (And later: insert

Re: Import order question

2014-02-17 Thread Ben Finney
Nagy László Zsolt gand...@shopzeus.com writes: I have a class hierarchy like this: Widget - VisualWidget - BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. None of this implies anything about which modules you place these in; Python is not Java, and you

Re: Import order question

2014-02-17 Thread Peter Otten
Nagy László Zsolt wrote: I have a class hierarchy like this: Widget - VisualWidget - BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a tree. In order to manage the order of widgets, I need methods to

Re: Import order question

2014-02-17 Thread Terry Reedy
On 2/17/2014 8:01 AM, Nagy László Zsolt wrote: I have a class hierarchy like this: Widget - VisualWidget - BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a tree. In order to manage the order of widgets, I need

Re: Import order question

2014-02-17 Thread Nagy László Zsolt
Here is the problem: these methods should create instances of Row, Column and Navbar. But this leads to circular imports. It should not; Python is not Java. Use modules to group your class definitions conceptually. There is no need whatever to separate every class into a different module. If

Re: Import order question

2014-02-17 Thread Dave Angel
Terry Reedy tjre...@udel.edu Wrote in message: On 2/17/2014 8:01 AM, Nagy László Zsolt wrote: I have a class hierarchy like this: Widget - VisualWidget - BsWidget and then BsWidget has many descendants: Desktop, Row, Column, Navbar etc. Widgets can have children. They are stored in a

Re: Import order question

2014-02-17 Thread Ben Finney
Nagy László Zsolt gand...@shopzeus.com writes: Use modules to group your class definitions conceptually. There is no need whatever to separate every class into a different module. If there is a consensus, and it is really desireable to put all these related classes into the same module,