[issue11610] Improving property to accept abstract methods

2011-06-10 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list

[issue11610] Improving property to accept abstract methods

2011-05-27 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: FWIW, if you still want to advance this, you could bring it up on Python-dev. I still feel uncomfortable with the API but could be convinced with others thought it was the best solution. --

[issue11610] Improving property to accept abstract methods

2011-05-27 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: Thank you for the suggestion. I will follow up at python-dev, but it will probably be a few weeks before I have time to do a proper job of it. -- ___ Python tracker rep...@bugs.python.org

[issue11610] Improving property to accept abstract methods

2011-05-17 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: -ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list mailing list

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: Is there anything preventing this patch from being merged? -- nosy: +Darren.Dale ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/5/14 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: Is there anything preventing this patch from being merged? I have to make time to think about the API a bit more. --

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sat, May 14, 2011 at 12:20 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the comment: 2011/5/14 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: Is

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I still dislike the reduntancy of having abstractmethod and abstractproperty on a method. I think a better idea is having abstractproperty.abstract(getter/setter/deleter). -- ___ Python

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sat, May 14, 2011 at 4:28 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the comment: I still dislike the reduntancy of having abstractmethod and abstractproperty on a method. I think a

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/5/14 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: On Sat, May 14, 2011 at 4:28 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sat, May 14, 2011 at 5:17 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the comment: 2011/5/14 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: On

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Okay: how about this. We retain the passing of @abstractmethod to abstractpropert(), but @abstractgetter decorates the method for you. 2011/5/14 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: On

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sat, May 14, 2011 at 5:55 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the comment: Okay: how about this. We retain the passing of @abstractmethod to abstractpropert(), but

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/5/14 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: On Sat, May 14, 2011 at 5:55 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sat, May 14, 2011 at 6:24 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the comment: 2011/5/14 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: It

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: It just occurred to me, there is a potential problem with abstractproperty and the decorator syntax in my patch: class Foo: @abstractproperty def p(self): pass # p is abstract, but has no abstract methods @p.setter def

[issue11610] Improving property to accept abstract methods

2011-05-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- nosy: +stutzbach ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___

[issue11610] Improving property to accept abstract methods

2011-04-10 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: So, are there objections to this patch, or can it be merged? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___

[issue11610] Improving property to accept abstract methods

2011-03-29 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I have an idea. How about instead of reusing abstractmethod for abstract getters and setters, you add abstractproperty.abstractgetter/setter/deleter? -- ___ Python tracker

[issue11610] Improving property to accept abstract methods

2011-03-29 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: Benjamin: have you thought this idea through? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___

[issue11610] Improving property to accept abstract methods

2011-03-29 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/3/29 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: Benjamin: have you thought this idea through? Perhaps inadequately? -- ___ Python tracker

[issue11610] Improving property to accept abstract methods

2011-03-29 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: I see some problems with this approach, but maybe I haven't fully appreciated it. Let me summarize the goals and constraints as I see them: 1) compatible with long-form and decorator syntax of {abstract}property declaration 2) backwards

[issue11610] Improving property to accept abstract methods

2011-03-29 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/3/29 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: I see some problems with this approach, but maybe I haven't fully appreciated it. Let me summarize the goals and constraints as I see

[issue11610] Improving property to accept abstract methods

2011-03-29 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Tue, Mar 29, 2011 at 9:31 PM, Benjamin Peterson rep...@bugs.python.org wrote: 2011/3/29 Darren Dale rep...@bugs.python.org: The benefit of abstractproperty.abstract{...} is that one decorator is required instead of two, right? Are there

[issue11610] Improving property to accept abstract methods

2011-03-29 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Tue, Mar 29, 2011 at 10:24 PM, Darren Dale rep...@bugs.python.org wrote: Darren Dale dsdal...@gmail.com added the comment: On Tue, Mar 29, 2011 at 9:31 PM, Benjamin Peterson rep...@bugs.python.org wrote: 2011/3/29 Darren Dale

[issue11610] Improving property to accept abstract methods

2011-03-28 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- nosy: +ncoghlan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list

[issue11610] Improving property to accept abstract methods

2011-03-28 Thread Ned Deily
Ned Deily n...@acm.org added the comment: (Darren, I'm not sure why you are running into problems with that setup. I test with what sounds to be a very similar one including a MacPorts gettext port providing libintl although I do install ports as +universal (i386, x86_64) by default. And I

[issue11610] Improving property to accept abstract methods

2011-03-24 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: Here is a new version of the patch. I think it addresses all of the issues that have been raised to date. I had to comment out the -lintl line in Modules/Setup to build on OS X, this seems to be a similar issue to

[issue11610] Improving property to accept abstract methods

2011-03-24 Thread Ned Deily
Ned Deily n...@acm.org added the comment: (Darren, what version of OS X and what arguments did you use for ./configure ? In general, for testing purposes, a vanilla ./configure with no args should work fine for building a Python that works right from your source build directory. If you want

[issue11610] Improving property to accept abstract methods

2011-03-24 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: (Ned, I'm running 10.6.6 with a 64-bit kernel. I've tried running ./configure without any arguments, and also with --prefix=/opt/local, since I install essentially everything with MacPorts.) -- ___

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com added the comment: I tried to test your patch, but the build dies with this error: Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File .../cpython/Lib/io.py, line 60, in module Aborted I don't

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sun, Mar 20, 2011 at 5:18 AM, Daniel Urban rep...@bugs.python.org wrote: Daniel Urban urban.dani...@gmail.com added the comment: I tried to test your patch, but the build dies with this error: Fatal Python error: Py_Initialize: can't

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: I think a better idea would be to override getter and friends on the abstractproperty class. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sun, Mar 20, 2011 at 12:19 PM, Benjamin Peterson rep...@bugs.python.org wrote: Benjamin Peterson benja...@python.org added the comment: I think a better idea would be to override getter and friends on the abstractproperty class. I just

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: On Sun, Mar 20, 2011 at 5:18 AM, Daniel Urban rep...@bugs.python.org wrote: Daniel Urban urban.dani...@gmail.com added the comment: I tried to test your patch, but the build dies with this error: Fatal Python error: Py_Initialize: can't

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 2011/3/20 Darren Dale rep...@bugs.python.org: Darren Dale dsdal...@gmail.com added the comment: On Sun, Mar 20, 2011 at 5:18 AM, Daniel Urban rep...@bugs.python.org wrote: Daniel Urban urban.dani...@gmail.com added the comment: I

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: Thank you Daniel and Benjamin for the helpful feedback. I think the attached patch is a much better approach. It only touches abc.abstractproperty (instead of the builtin property), and uses a class method as a factory to return instances of

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Darren Dale
Changes by Darren Dale dsdal...@gmail.com: Removed file: http://bugs.python.org/file21293/property_with_abstractmethod.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___

[issue11610] Improving property to accept abstract methods

2011-03-20 Thread Darren Dale
Changes by Darren Dale dsdal...@gmail.com: Removed file: http://bugs.python.org/file21295/property_with_abstractmethod_v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___

[issue11610] Improving property to accept abstract methods

2011-03-19 Thread Darren Dale
New submission from Darren Dale dsdal...@gmail.com: I posted a suggestion at python-ideas that the declaration of abstract properties could be improved in such a way that they could be declared with either the long-form or decorator syntax using the built-in property and abc.abstractmethod:

[issue11610] Improving property to accept abstract methods

2011-03-19 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: The discussion on python-ideas: http://mail.python.org/pipermail/python-ideas/2011-March/009411.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610

[issue11610] Improving property to accept abstract methods

2011-03-19 Thread Daniel Urban
Changes by Daniel Urban urban.dani...@gmail.com: -- nosy: +durban ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___ ___ Python-bugs-list

[issue11610] Improving property to accept abstract methods

2011-03-19 Thread Daniel Urban
Daniel Urban urban.dani...@gmail.com added the comment: I looked at the patch (I didn't test it yet), my comments are on Rietveld. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11610 ___

[issue11610] Improving property to accept abstract methods

2011-03-19 Thread Darren Dale
Darren Dale dsdal...@gmail.com added the comment: Here is a new patch that addresses a couple problems found in review: * Unit tests contained a typo (Property instead of property) * DeprecationWarning would be issued when importing abc rather than when creating abstractproperty. (whether