UserLinux chooses Python as "interpretive language" of choice

John Roth newsgroups at jhrothjr.com
Sun Dec 21 07:41:40 EST 2003


"Bengt Richter" <bokr at oz.net> wrote in message
news:bs2j3b$fc5$0 at 216.39.172.122...
> On Sat, 20 Dec 2003 06:38:20 -0500, "John Roth" <newsgroups at jhrothjr.com>
wrote:
>
>
> >Sure, you can use a property to not have to put
> >in the explicit function call, but then you can't put
> >in the explicit function call *anywhere* you use that
> >property.
> >
> Nor can you supply explicit arguments if you want to, though you could
> provide an alternate name, so you could access either way.

That's really an inherent feature of the 'property' notion:
since it's accessed like a variable, the getter can't have any
parameters. Since the property access return an object,
I suppose you could have something that looks like an
indexable or slicable property.

> Nor can we do properties without accessing them via the attribute magic
(i.e.,
> not via bare global names for example).
>
> >Ruby syntax makes it *optional*. That's what is
> >missing here.

> I've floated various ideas/brain_farts more/less seriously for triggering
magic
> via name access alterantive to getattr magic, but there seems to be no
enthusiasm
> or else horrification at the thought, so I haven't stirred that pot for
some time ;-)
>
> What would be the syntax you would like to use, with what effect?

Well, the basic idea was simply to make the () optional for functions
with no parameters. No particular syntax there but it would require some
major jump through hoops gyrations from the virtual machine, and there
would have to be some way of getting the function object when you
wanted it, and I suspect the difference between a function object and
a more general 'callable' would totally confuse most people. And of
course, does a function/method with only keywords count as a function
with no parameters?

Ruby can get away with it because, as far as I know, functions are not
first class objects. They certainly aren't in Perl which was Ruby's
inspiration.

It's a non-starter for Python, though.

John Roth
>
> Regards,
> Bengt Richter






More information about the Python-list mailing list