PyWarts: time, datetime, and calendar modules

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat Jan 14 23:26:13 EST 2012


On Sat, 14 Jan 2012 14:58:26 -0600, Evan Driscoll wrote:

> On 01/14/2012 02:11 PM, Devin Jeanpierre wrote:
>> On Sat, Jan 14, 2012 at 2:23 PM, Rick Johnson
>> <rantingrickjohnson at gmail.com>  wrote:
>>> THAT PISSES ME OFF!!!>:( We should never be forced to guess if a name
>>> is a callable or a variable!
>>>
>>> So how do we solve this dilemma you ask??? Well, we need to "mark"
>>> method OR variable names (OR both!) with syntactic markers so there
>>> will be NO confusion.
>>
>> I might be being bit OT, but, you should give Common Lisp a try. It
>> does something similar for functions versus variables.
>>
>> As for the issue, I suppose I can see how this would be confusing. I
>> don't agree with your solution, though.
> 
> It also has some problems. For instance, if an object has a member which
> is a type that implements __call__ but is also useful to access "on its
> own", is that a field or a function?

This is the problem with Ruby's syntax for calling functions with no 
argument with brackets. Since f on its own is interpreted as "call f with 
no arguments", there is no easy way to get a reference to the object f. 
This makes functions second-class objects in Ruby, since you can't refer 
to them easily by name like you can other objects.


-- 
Steven



More information about the Python-list mailing list