[Pythonmac-SIG] PyObjC calling syntax again, an idea.

Just van Rossum just@letterror.com
Thu, 24 Oct 2002 12:47:54 +0200


I wrote:

> It just occured to me that this is solvable with an appropriate
> metaclass. This method:
> 
>   class Foo(SomeCocoaClassWithAppropriateMetaClass):
>   
>       def foo(self, arg1, arg2, arg3):
>           ...
> 
> would be converted to this at class definition time:
> 
>       def foo_arg1_arg2_arg3_(self, arg1, arg2, arg3):
>           ...

One obvious flaw is that the following can't work with this scheme:

      def foo(self, arg1, arg2, arg3):
          ...
      def foo(self, arg1, arg2, arg3, arg4):
          ...

as the methods are gathered in a dict at class definition time.

Just