[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Benjamin Peterson
Benjamin Peterson added the comment: Applied in r84124. Thanks for the patch. -- resolution: -> accepted status: open -> closed ___ Python tracker ___ __

[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Éric Araujo
Éric Araujo added the comment: Looks good. -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Daniel Urban
Daniel Urban added the comment: I'm attaching a new patch containing also some documentation for the two new decorators. The doc is rather terse, and english is not my first language, so please let me know if some corrections are needed. -- Added file: http://bugs.python.org/file18542

[issue5867] No way to create an abstract classmethod

2010-08-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch looks fine code-wise, but it also needs a doc addition in Doc/library/abc.rst. -- ___ Python tracker ___

[issue5867] No way to create an abstract classmethod

2010-08-14 Thread Daniel Urban
Daniel Urban added the comment: I'm attaching a new patch adding the abc.abstractclassmethod and abc.abstractstaticmethod decorators. -- Added file: http://bugs.python.org/file18519/abstractclassstaticmethod.diff ___ Python tracker

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Guido van Rossum
Guido van Rossum added the comment: As you figured out it is not yet supported. I object to making changes to the classmethod implementation. I expect the best thing to do is to add a new @abc.abstractclassmethod decorator defined in pure Python (maybe the definition of abstractproperty pro

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you. I'm not an ABC expert but it looks ok. Guido, what do you think? -- nosy: +gvanrossum ___ Python tracker ___

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban added the comment: If I understand correctly, some tests are needed for the instantiation of classes with abstract static/classmethods. I added them in issue5867a.diff. -- Added file: http://bugs.python.org/file18512/issue5867a.diff ___

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch doesn't check that instantiating these methods work at all. -- nosy: +benjamin.peterson, pitrou stage: -> patch review versions: +Python 3.2 -Python 3.1 ___ Python tracker

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban added the comment: Here is a patch, which adds a descriptor to classmethod and staticmethod. Pseudocode: __get__(self, inst, owner): if getattr(inst.callable, '__isabstractmethod__', False): return True return False __set__(self, inst, value): inst.callable.__i

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban added the comment: @abstractmethod @classmethod def ... doesn't work because classmethod objects doesn't have a __dict__, so setting arbitrary attributes don't work, and abstractmethod tries to set the __isabstractmethod__ atribute to True. The other order: @classmethod @abstrac

[issue5867] No way to create an abstract classmethod

2010-08-12 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue5867] No way to create an abstract classmethod

2009-05-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Please ask questions like this first on python-list or the c.l.p or gmane mirrors. -- nosy: +tjreedy ___ Python tracker ___

[issue5867] No way to create an abstract classmethod

2009-04-28 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- priority: -> normal type: behavior -> feature request versions: +Python 3.1 -Python 3.0 ___ Python tracker ___ _

[issue5867] No way to create an abstract classmethod

2009-04-28 Thread Matteo Dell'Amico
New submission from Matteo Dell'Amico : Is there a way to define an abstract classmethod? The two obvious ways don't seem to work properly. Python 3.0.1+ (r301:69556, Apr 15 2009, 17:25:52) [GCC 4.3.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import a