[Python-ideas] A user story concerning things knowing their own names
Westley Martínez
anikom15 at gmail.com
Wed Mar 16 14:52:17 CET 2011
On Wed, 2011-03-16 at 22:28 +1300, Greg Ewing wrote:
> I just experienced an obscure bug resulting from copying
> and pasting an overridable_property and forgetting to
> change the passed-in name:
>
> content_size = overridable_property('size',
> "Size of the content area.")
>
> which should have been
>
> content_size = overridable_property('content_size',
> "Size of the content area.")
>
> This was quite difficult to track down, because the result
> was to effectively make it an alias of *another* property
> I have called 'size'. They happen to be near enough to the same
> thing that the error went unnoticed for quite some time.
>
> If I could write my overridable_property declarations
> without having to repeat the name, this kind of thing would
> not be able to happen.
>
If it went unnoticed, what's the matter?
More information about the Python-ideas
mailing list