Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66607 > unrolled thread

Re: Import order question

Started byTerry Reedy <tjreedy@udel.edu>
First post2014-02-17 10:35 -0500
Last post2014-02-17 10:35 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Import order question Terry Reedy <tjreedy@udel.edu> - 2014-02-17 10:35 -0500

#66607 — Re: Import order question

FromTerry Reedy <tjreedy@udel.edu>
Date2014-02-17 10:35 -0500
SubjectRe: Import order question
Message-ID<mailman.7099.1392651362.18130.python-list@python.org>
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 methods to append children. (And later:
> insert or prepend because they also have an order). So I would like to
> have methods like this:
>
> BsWidget.AppendNavbar(....)
> BsWidget.AppendRow(...)

I would write one prepend/insert/append method that 
prepends/inserts/appends the widget passed.

> Here is the problem: these methods should create instances of Row,
> Column and Navbar.

I disagree, without strong justification. Create the instances by 
directly calling the classes and do with them as you want.

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web