[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Index with multiple parameters?
- From: Matthew Paul Del Buono <delbu9c1@...>
- Date: Tue, 19 Feb 2008 20:04:18 -0500 (EST)
---- Original message ----
>Date: Tue, 19 Feb 2008 20:01:32 -0500 (EST)
>From: Matthew Paul Del Buono <firstname.lastname@example.org>
>Subject: Re: Index with multiple parameters?
>>vertex_vector[20, 'x'] = 2.5
>Would vertex_vector(20, 'x') be a suitable solution? If so, you just have to implement the __call metamethod. I disagree with your "multi-indexing" as, personally, it seems less readable; then again, I'm probably not one of your target users.
>-- Matthew P. Del Buono
A few seconds after posting this I realized this wouldn't really be an acceptable solution given that you need an l-value to assign to ><
I guess it would still be possible that way, just difficult. Probably not worth it.
I'm going to have to side with the people saying use get/set methods. It's a pretty standard form anyway.
Sorry about the noise :)
-- Matthew P. Del Buono