Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #83679
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <fomcl@yahoo.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.011 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'url:pypi': 0.03; 'parameters': 0.04; 'class,': 0.07; 'defaults': 0.07; 'needed,': 0.07; 'builtin': 0.09; 'decorator': 0.09; 'git': 0.09; 'sphinx': 0.09; 'wrapped': 0.09; 'python': 0.11; 'bug': 0.12; 'jan': 0.12; '2.7': 0.14; '>on': 0.16; 'cet': 0.16; 'intended.': 0.16; 'luckily,': 0.16; 'subject:based': 0.16; 'subject:class': 0.16; ':-)': 0.16; 'wrote:': 0.18; '(not': 0.18; 'file,': 0.19; 'version.': 0.19; '(the': 0.22; '(in': 0.22; 'specify': 0.24; 'header:Received:8': 0.24; 'gets': 0.27; 'to:2**1': 0.27; 'function': 0.29; 'am,': 0.29; 'to:no real name:2**1': 0.29; 'code': 0.31; '13,': 0.31; 'class': 0.32; 'regular': 0.32; 'up.': 0.33; 'url:python': 0.33; 'becomes': 0.33; 'link.': 0.33; 'older': 0.33; 'could': 0.34; 'problem': 0.35; 'but': 0.35; 'there': 0.35; 'version': 0.36; 'skip:> 10': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'skip:- 20': 0.37; 'easily': 0.37; 'thank': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; '12,': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'how': 0.40; 'even': 0.60; 'ian': 0.60; 'is.': 0.60; 'received:67.195': 0.60; 'received:98.137': 0.60; 'most': 0.60; 'lost': 0.61; 'offer': 0.62; 'show': 0.63; 'information': 0.63; 'kind': 0.63; 'to:addr:gmail.com': 0.65; 'received:gq1.yahoo.com': 0.68; 'received:mail.gq1.yahoo.com': 0.68; 'hoping': 0.75; '2015': 0.84; '3.4': 0.84; 'affected.': 0.84; 'code):': 0.84; 'hardly': 0.84; 'received:bullet.mail.gq1.yahoo.com': 0.84; 'replies.': 0.84; 'package:': 0.93 |
| X-Yahoo-Newman-Property | ymail-4 |
| X-Yahoo-Newman-Id | 114475.48490.bm@omp1028.mail.gq1.yahoo.com |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1421142196; bh=MWEWVoQZYW/7b/hQ6hwgvo2F3/YJIXDsypzEjaIU5SE=; h=Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=XL1Yet+RTTK/DcMEf6Z+ZmOCAsD4QfeDq7GR3dJXGmA7VUz0YLkSF3QdC7qadPvFQSaXAWfgfznAjA8hHYs01usAXxLjv05D8K6jCqapMZZKOBICoqpJQy21NtCmNO+nydFG3qeV4+PTMz+/yAW7KSOh4EHI9XBBpi/npkRK6zc= |
| X-YMail-OSG | pQjwzOQVM1mujV0SRUHBGRW4gWT3opkJV_o2414XYM03pp6 oYVeFB61TejLgMg0LyVo6CbIdycKKaqGqbXViZhPC3qIQLlXJv4DdEe4leEJ sAWsy9JxXvoq6K34L5Iy4MqPXfR7dv7sg7LVyzLaleXsnS6t6P8oLowkSzU_ BK1JY9K3jx3F2JSkSBGXu7PLOT_kPcoqDGLMjugHNq4dxKl9Cubr7Txt0UgC ejWZ5pz3c2xxo4wsMdaHMnsh6kIkxWXc9OmPmz1zDQKzSL_fX_pLiPXi6WbR H4pGa0es0XkjjzIvnPwcnBQUcIuxfWnN_SAtCwbIwBIWHwlav_uByIK7XBPA 46y0BdpytUKCh5_daL6jjS9F3Rt6IkDTfWJhswFyXplG.bKvVSkdcGf26DzQ fFcBYikuXEaGgfigSGUTKhXTzxGO.aTU88p0C7JXiY9_PBQJyrW_b.oAZKUK ngv9CI0SuBo975Mc0UaUAv_EWGEMzslW6dUW1WP4maFqMxL_oHfP9GPh7C06 F2O_dpz2XHeoWMXF_UMMHWZDkPQI6OQktvyTe7SS5VsahaJ8a.NOTYYeIk5E oPD4gZ4vsCaks4yDNaT8t1rFUnbnbiYH7Gm6jUPkz3MbvAJwo99MgOtqzgby sgCegpYHweVHpscHjH1cYjtlteMpVFS1OTdEiJlfhvHU1wQ1U_nQn7WKLTfE Eeora3uvHSOkZQ9f.0.r6xdn3ElBXkoIT.E_rzdr7bXwY131_Tg56w7FdDLZ AjPbNKPRgrJ0gChzcPmSjEIAyGhT8wrnMEMKg2BpTU1Npy26KoVO9zKm_ODw O9e0e26xbe.tFsmx2KeXqGlhxHmRHu4W9XFY- |
| X-Rocket-MIMEInfo | 002.001, Ci0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCk9uIFR1ZSwgSmFuIDEzLCAyMDE1IDY6MzEgQU0gQ0VUIElhbiBLZWxseSB3cm90ZToNCg0KPk9uIEphbiAxMiwgMjAxNSA2OjQ3IEFNLCAiQWxiZXJ0LUphbiBSb3NrYW0iIDxmb21jbEB5YWhvby5jb20.IHdyb3RlOg0KPj4gVGhhbmtzIGZvciB5b3VyIHJlcGxpZXMuIEkgY2hhbmdlZCBpdCBpbnRvIGEgcmVndWxhciBkZWNvcmF0b3IgKG5vdCBhIGNsYXNzIGRlY29yYXRvcikuIEl0IHdvdWxkIGhhdmUgYmVlbiBldmVuIG5pY2VyIGlmIEkgb25seSBuZWUBMAEBAQE- |
| X-Mailer | YahooMailWebService/0.8.203.740 |
| Date | Tue, 13 Jan 2015 01:43:15 -0800 |
| From | Albert-Jan Roskam <fomcl@yahoo.com> |
| Subject | Re: class-based class decorator |
| To | ian.g.kelly@gmail.com, python-list@python.org |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.17667.1421142513.18130.python-list@python.org> (permalink) |
| Lines | 16 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1421142513 news.xs4all.nl 2958 [2001:888:2000:d::a6]:51514 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:83679 |
Show key headers only | View raw
---------------------------- On Tue, Jan 13, 2015 6:31 AM CET Ian Kelly wrote: >On Jan 12, 2015 6:47 AM, "Albert-Jan Roskam" <fomcl@yahoo.com> wrote: >> Thanks for your replies. I changed it into a regular decorator (not a class decorator). It would have been even nicer if I only needed to specify it once per class, but, well, in my case this hardly matters. The code below works as intended. One problem (not specific to the code): the decorator destroys the signature: it always becomes "*args, **kwargs"). This is annoying with help(), but what worries me most is that my Sphinx documentation is also affected. The information about the defaults gets lost (the parameters are decribed in the docstring, but not the defaults). That kind of sucks. Is there a builtin way around this (in other words: I am aware of this package: https://pypi.python.org/pypi/decorator). I am hoping to get the code working on Python 2.7 and 3.3 and up. > >As of (I think) 3.4 pydoc and the help() function will show you the >signature of the wrapped function as long as you use functools.wraps. >I don't know what the status is for Sphinx; all I can offer is this >stackoverflow link. > >http://stackoverflow.com/questions/3687046/python-sphinx-autodoc-and-decorated-members Thank you! Luckily, decorator.py is just one file, so I could easily include it. Version 3.4 is needed, because of a bug in an older version. Now I still need to find out how to create a git submodule to a hg repo, where the decorator package is. :-)
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: class-based class decorator Albert-Jan Roskam <fomcl@yahoo.com> - 2015-01-13 01:43 -0800
csiph-web