[Types-sig] Static Methods instead of Interface construct?

Clark C. Evans cce@clarkevans.com
Sat, 24 Mar 2001 23:15:53 -0500 (EST)


On Sat, 24 Mar 2001, Robin Thomas wrote:
>      def static_method(None):
>          # None considered a special name,
>          # thus would be called as MyClass.static_method()
> 
>      def static_and_argumentless():
>          # No arguments means it's just a freaking function,
>          # and needs no special treatment

The second one is kinda confusing.  If I saw
  def static_and_argumentless()
I would immediatly assume:
  def static_and_has_an_argument(spam)
Which, of course, would be wrong.

I do however, like the first one,
  def static_method(None)
as this moves to having an argument cleanly:
  def static_and_has_an_argument(None,spam)

And None is very clear that an instance
variable, self, is not only unexpected,
but mabye even a syntax error!  Nice.

I think your implementation would take
me an hour to grok, I ain't too smart.
Perhaps later!

Best,

;) Clark