Feature request: String-inferred names

Carl Banks pavlovevidence at gmail.com
Sun Nov 29 22:59:52 EST 2009


On Nov 28, 3:38 am, The Music Guy <fearsomedragon... at gmail.com> wrote:
> On Nov 28, 3:07 am, Lie Ryan <lie.1... at gmail.com> wrote:
> > If you use it a lot, it is likely 1) you have abused class syntax for
> > what should have been a dict or 2) what you need is to override
> > __getattr__/__getattribute__ and __setattr__
>
> Oh boy...here we go. :|
>
> Please listen. In all the time I've spent in the coding community
> (that's at least 7 years) and especially since I started paying
> attention to the Python community (2 years), I have noticed a trend:
> When one coder does something that another cannot understand,
> frequently the other will assume the former is not only doing things
> wrong, but is doing them _blatantly_ wrong. I have caught myself
> making that very assumption many times in the past, and I've tried
> hard to build up an immunity against the impulse to make that
> assumption. At this point, I don't even believe in such a thing as a
> universal "wrong way" and a "right way" to code that applies to every
> circumstance. The way to solve a problem depends on the problem. When
> it comes to coding, there is not an absolute "right" way or "wrong"
> way--unless we're talking about, say, stealing closed source code
> without permission, or deliberately coding in a way that will cause
> problems for the end user (like causing memory clogs or buffer
> overflows and whatnot).
>
> All of this can be determined through common sense.

Another thing that can be determined through common sense is that if
you have object that you are calling getattr and setattr on so much
that you think you need special syntax, you should have been using a
dict.


Carl Banks



More information about the Python-list mailing list