why brackets & commas in func calls can't be ommited? (maybe it couldbe PEP?)
Bruno Desthuilliers
bdesth.quelquechose at free.quelquepart.fr
Wed Mar 21 17:27:12 EDT 2007
bearophileHUGS at lycos.com a écrit :
> I have nothing against brackets, and I think Python has used them for
> too much time to allow a so big change in its syntax.
> But I think in some situations Ruby allows to omit them,
<iirc notice="please someone correct me if I say something wrong">
Yes. But in Ruby, there's a clear distinction between attributes and
methods, and attributes are always private, so you can only access them
thru method calls. Also, Ruby's methods are not really first class
objects - at least not the way they are in Python -, so when returning a
'callable' object from a method, you have to call a method of the object
(something like callable.call IIRC).
</iirc>
> solving some
> of the "impossibile" problems shown in this thread. This makes Ruby a
> bit better than Python to create application-specific mini languages,
> that are quite useful in some situations.
I'd say 'a bit more elegant', not necessarily 'better'. But that's of
course very subjective, and I have far less experience with Ruby.
More information about the Python-list
mailing list