Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56023 > unrolled thread
| Started by | Jean-Michel Pichavant <jeanmichel@sequans.com> |
|---|---|
| First post | 2011-01-31 12:15 +0100 |
| Last post | 2011-01-31 12:15 +0100 |
| 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.
Re: Style question: Nicknames for deeply nested objects Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-01-31 12:15 +0100
| From | Jean-Michel Pichavant <jeanmichel@sequans.com> |
|---|---|
| Date | 2011-01-31 12:15 +0100 |
| Subject | Re: Style question: Nicknames for deeply nested objects |
| Message-ID | <mailman.1494.1296472522.6505.python-list@python.org> |
Gerald Britton wrote: > Hi all, > > Today I was thinking about a problem I often encounter. > [snip] > > 1. You need to call this thing many times with different arguments, so > you wind up with: > > x = some.deeply.nested.object.method(some.other.deeply.nested.object.value1) > y = some.deeply.nested.object.method(some.other.deeply.nested.object.value2) > z = some.deeply.nested.object.method(some.other.deeply.nested.object.value3) > [snip] > -- > Gerald Britton > This is not solved by style but by design. You simply don't use too much nested objects. That's a sign of something wrong in your overall object model. Since I do not encounter this problem as often as you are, I guess it is a matter of habbits. however, considering what "import a.module.that.is.quite.nested as myModule" is doing, I guess using a local variable to store your nested method is just fine. JM
Back to top | Article view | comp.lang.python
csiph-web