From: Dave Benjamin Date: 2003-08-15T07:31:06+09:00 Subject: Re: Overloading () "Phil Tomson" wrote in message news:bhgrv7013t@enews3.newsguy.com... > I know you can overload () in C++, but can you overload () in Python? Yes, it's quite simple, actually: class CallableClass: def __call__(self): print 'Hey there!' cc = CallableClass() cc() Output: "Hey, there!" > Seems like allowing overloading of () is a potential tarpit... and there > are potential parser issues as well, but I defer to matz to answer your > question. I won't comment on whether the ability to overload () is good or bad, necessarily (although it would be nice if Ruby's lambdas had normal functional semantics), but I would be very interested in understanding the issue from a language design standpoint, if you'd be so kind, Matz. Thanks! Dave