Path: csiph.com!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'args': 0.04; 'cc:addr :python-list': 0.09; 'definition,': 0.09; 'ide': 0.09; 'rebuild': 0.09; 'tab': 0.09; 'python': 0.10; 'itself.': 0.11; 'argument': 0.15; 'everyone,': 0.15; 'chris,': 0.16; 'docstring': 0.16; 'eval': 0.16; 'received:172.18.0': 0.16; 'stuff,': 0.16; 'subject:class': 0.16; 'string': 0.17; 'attribute': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'fairly': 0.22; '(or': 0.23; 'header:In-Reply-To:1': 0.24; 'equivalent': 0.27; 'function': 0.28; 'idea': 0.28; 'looks': 0.29; 'helpful.': 0.29; 'too.': 0.30; 'point': 0.33; 'problem': 0.33; 'list': 0.34; 'could': 0.35; 'but': 0.36; 'instead': 0.36; 'subject:: ': 0.37; 'thanks': 0.37; 'easily': 0.39; 'where': 0.40; 'still': 0.40; 'your': 0.60; "you'll": 0.61; 'entire': 0.61; 'effective': 0.63; 'completing': 0.72 X-Authority-Analysis: v=2.1 cv=W4fyL0ik c=1 sm=1 tr=0 a=g3mLq75WYuDrh3Lt0JSDww==:117 a=g3mLq75WYuDrh3Lt0JSDww==:17 a=QC7fh9NfAAAA:8 a=5pFAO2ZBLFIA:10 a=8nJEP1OIZ-IA:10 a=ff-B7xzCdYMA:10 a=Wi8mAD0AR7pklaCSQ0gA:9 a=wPNLvfGTeEIA:10 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.activenetwerx.com X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=RDNS_NONE autolearn=no autolearn_force=no version=3.4.0 From: "Joseph L. Casale" To: Chris Angelico CC: "python-list@python.org" Subject: Re: Modifying signature of ctor in class Thread-Topic: Modifying signature of ctor in class Thread-Index: AQHQ9weIGzVVeo4s60Sc6dvZps29lZ5MmVwA//+chPI= Date: Thu, 24 Sep 2015 21:45:45 +0000 References: <5cb33b569cf14dfea9424c006c9abc95@exch.activenetwerx.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [72.29.233.193] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CMAE-Envelope: MS4wfFRIFIZmJkjd5ukCQ9eT+NivrAc2X9q5MUSzsYK0BGtIpBvGY6Nl0MDFz6AOeG926xHE/0oNv/DQ8rxhSpUB7at9JoFwqJ3OrNFh44M4BLhczCZPs1voMaN4nr2nteB+ssrKQalzByUWqhOuDJz4kFX97QmkaUR9f10b80kr+HbjizgzvvwHnLJW0AoQU39iVw== X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1443131216 news.xs4all.nl 23762 [2001:888:2000:d::a6]:35578 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97095 > I don't think you can easily change the function's own definition,=0A= > other than by using eval (or equivalent shenanigans, like crafting=0A= > your own bytecode); but as of Python 3.something, the help() function=0A= > looks for a __wrapped__ attribute and will take function args from=0A= > that instead of the function itself. That way, when you use=0A= > functools.wraps(), it copies in the docstring and stuff, and as far as=0A= > help() is concerned, copies in the argument list too.=0A= > =0A= > No idea whether you'll be able to do that too, but it's a fairly=0A= > effective way to get around the problem if you can.=0A= =0A= Hi Chris,=0A= That is helpful. It still leaves me with generating a string function=0A= and eval'ing or compiling it to swipe the sig. At the point I could=0A= rebuild the entire function and simply apply it.=0A= =0A= Where all but a valid sig helps is for introspection such as tab completing= =0A= with ipython or using an IDE etc.=0A= =0A= Thanks everyone,=0A= jlc=