Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #100175
| From | Erik <python@lucidity.plus.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Accessing container's methods |
| Date | 2015-12-08 22:37 +0000 |
| Message-ID | <mailman.78.1449614324.12405.python-list@python.org> (permalink) |
| References | <dcm0c2Fi2ktU1@mid.individual.net> <mailman.41.1449532084.12405.python-list@python.org> <5516674.oipO6xLiNU@PointedEars.de> |
Annoyingly, there seemed to be no responses to the original question
when I wrote that and then shortly after, I saw all the others (and we
all pretty much said the same thing - so I'm not sure why I was singled
out for special attention ;)).
On 08/12/15 19:02, Thomas 'PointedEars' Lahn wrote:
> Erik wrote:
> ^^^^
> Please fix, Erik #75656.
Fixed(*)
Thomas 'PointerEars', you have chosen to selectively quote snippets of
code and comments out of context, so I think it's futile to respond to
those arguments individually. The original request (if you read it) was
to return a string that said, essentially, "I am element 2 of 3 in my
container".
You posted a "Quickhack" (which, to be fair, is an accurate description)
which is incomplete, has errors and makes no sense in the context of the
original question. We all know we can create a list in Python (of parent
objects or whatever), but I think that if you expanded on that class a
bit more (methods for the containers to update the contained objects on
just what their index/key is etc) that you'll soon realise it's not a
scalable option.
Also, WRT the original question, what is the method supposed to return
now? "I am element 0 of 3 in container <FOO>, key 'bar' of ('bar',
'foo', 'spam') in container <BAR>"? Just curious.
I'm interested in this response though:
>> Generally, an object should not need to know which container it's in
>
> NAK. All kinds of objects already "know" which container they are in.
Please elucidate. Examples from the standard library would be interesting.
E.
(*) In the sense that it's not going to change ;)
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Accessing container's methods Tony van der Hoff <tony@vanderhoff.org> - 2015-12-07 18:10 +0000
Re: Accessing container's methods Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2015-12-07 18:21 +0000
Re: Accessing container's methods Michael Torrie <torriem@gmail.com> - 2015-12-07 11:36 -0700
Re: Accessing container's methods Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-07 20:03 +0100
Re: Accessing container's methods Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-07 19:46 +0100
Re: Accessing container's methods Peter Otten <__peter__@web.de> - 2015-12-07 19:59 +0100
Re: Accessing container's methods Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-07 12:33 -0700
Re: Accessing container's methods Terry Reedy <tjreedy@udel.edu> - 2015-12-07 16:38 -0500
Re: Accessing container's methods Chris Angelico <rosuav@gmail.com> - 2015-12-08 09:02 +1100
Re: Accessing container's methods Erik <python@lucidity.plus.com> - 2015-12-07 23:47 +0000
Re: Accessing container's methods Tony van der Hoff <tony@vanderhoff.org> - 2015-12-08 12:35 +0000
Re: Accessing container's methods [solved] Tony van der Hoff <tony@vanderhoff.org> - 2015-12-08 13:46 +0000
Re: Accessing container's methods Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-08 20:02 +0100
Re: Accessing container's methods Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2015-12-08 20:54 +0100
Re: Accessing container's methods Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-08 23:51 +0100
Re: Accessing container's methods Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-08 20:30 +0000
Re: Accessing container's methods Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-12-08 23:52 +0100
Re: Accessing container's methods Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-12-08 22:59 +0000
Re: Accessing container's methods Erik <python@lucidity.plus.com> - 2015-12-08 22:37 +0000
Re: Accessing container's methods Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-08 16:41 -0700
Re: Accessing container's methods Chris Angelico <rosuav@gmail.com> - 2015-12-09 12:04 +1100
csiph-web