[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com 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:

[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Looks good. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5867 ___ ___

[issue5867] No way to create an abstract classmethod

2010-08-16 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Applied in r84124. Thanks for the patch. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5867

[issue5867] No way to create an abstract classmethod

2010-08-15 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The patch looks fine code-wise, but it also needs a doc addition in Doc/library/abc.rst. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5867

[issue5867] No way to create an abstract classmethod

2010-08-14 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com 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

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com 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

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com 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,

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr 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 urban.dani...@gmail.com 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 pit...@free.fr added the comment: Thank you. I'm not an ABC expert but it looks ok. Guido, what do you think? -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5867

[issue5867] No way to create an abstract classmethod

2010-08-13 Thread Guido van Rossum
Guido van Rossum gu...@python.org 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

[issue5867] No way to create an abstract classmethod

2010-08-12 Thread Daniel Urban
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5867 ___ ___ Python-bugs-list

[issue5867] No way to create an abstract classmethod

2009-05-01 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Please ask questions like this first on python-list or the c.l.p or gmane mirrors. -- nosy: +tjreedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5867

[issue5867] No way to create an abstract classmethod

2009-04-28 Thread Matteo Dell'Amico
New submission from Matteo Dell'Amico de...@linux.it: 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.

[issue5867] No way to create an abstract classmethod

2009-04-28 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- priority: - normal type: behavior - feature request versions: +Python 3.1 -Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5867