Problem of Readability of Python

kiilerix at gmail.com kiilerix at gmail.com
Wed Oct 17 18:01:09 EDT 2007


On Oct 17, 9:11 pm, "Chris Mellon" <arkanes at gmail.com> wrote:
> On 10/17/07, kiilerix at gmail.com <kiilerix at gmail.com> wrote:
> > >>> o = object()
> > >>> o.foo = 7
>
> What makes you think it can't be instantiated directly? You just did
> it. It's not, however, suitable for use as an arbitrary thing to stick
> attributes on.
>
> Which is a little sad, but a necessary requirement for things like
> int() and str() to be small and fast.

So it's an optimization with side effects, giving a special case where
the simple and otherwise "right" way to do it doesn't work? Too bad :-
(

Ok; I'll continue to create dummy classes inheriting from object. And
hope that one day it will be simpler.

Thanks,
Mads




More information about the Python-list mailing list