Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #97100
| Path | csiph.com!goblin1!goblin.stu.neva.ru!uio.no!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 | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.008 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'used.': 0.05; 'cc:addr :python-list': 0.09; 'example:': 0.10; 'def': 0.13; 'cc:name:python': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:class': 0.16; 'wrote:': 0.16; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'parameter': 0.22; 'sep': 0.22; 'pass': 0.22; 'am,': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'module': 0.25; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; '**kwargs):': 0.29; 'inspect': 0.29; 'foo': 0.33; 'received:google.com': 0.35; 'skip:p 30': 0.35; 'subject:: ': 0.37; 'stuff': 0.38; 'skip:p 20': 0.38; 'still': 0.40; 'chrisa': 0.84; 'to:none': 0.91; 'dirty': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=8lHO4qoE/+VZ80YRr2r12i4b83R4uheOv0KX1uQkU7I=; b=giXITFHxijkc6xSQBEUPI1BmMy+kf/x9cWQq1GY1WW7DFk4FzjfUKtzlmy6LQOWZMg ej3yE6qIsV9mrDtZNOMt3kJ9Eev0Ecwh/nCwz8zX/8C/5RnqqDYIM8pr4irJVxn5GV3+ 4/QO6Z/WUVlSCsDaj4UNuLPBP2yKItgr5YSW3pdxs+06T5A/BPViXduvI1f05vaX+wuc Z02TuPb3rQOb+fDnKB1ezRkLxj4PoPGqrtL94siOw9roR5TufesAXWDQ+lSdlxpgj3z0 TLPUZRNqnJ6p3QYPTBxPkyyCZd3yN9CiFSmrqnRmDq3mT7pDRvIuWJzm66zgxSe3E089 H14g== |
| MIME-Version | 1.0 |
| X-Received | by 10.107.132.144 with SMTP id o16mr3230712ioi.31.1443133392177; Thu, 24 Sep 2015 15:23:12 -0700 (PDT) |
| In-Reply-To | <CALwzidk5H_hevjuiJjYyJTM9wj5hZbmZa=G9L8ctTZ+geJu+=A@mail.gmail.com> |
| References | <5cb33b569cf14dfea9424c006c9abc95@exch.activenetwerx.com> <CALwzidm0s48iKMdyzOYwS+nZtBjh_y-Z2yaNi1=Unvsa_Ok1FQ@mail.gmail.com> <CALwzidk5H_hevjuiJjYyJTM9wj5hZbmZa=G9L8ctTZ+geJu+=A@mail.gmail.com> |
| Date | Fri, 25 Sep 2015 08:23:12 +1000 |
| Subject | Re: Modifying signature of ctor in class |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | Python <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| 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.152.1443133395.28679.python-list@python.org> (permalink) |
| Lines | 19 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1443133395 news.xs4all.nl 23868 [2001:888:2000:d::a6]:50253 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:97100 |
Show key headers only | View raw
On Fri, Sep 25, 2015 at 8:19 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> Quick and dirty example:
>
> py> from inspect import Signature, Parameter
> py> def foo(*args, **kwargs): pass
> ...
> py> foo.__signature__ = Signature([Parameter('x',
> Parameter.POSITIONAL_OR_KEYWORD), Parameter('y',
> Parameter.KEYWORD_ONLY)])
> py> help(foo)
> Help on function foo in module __main__:
>
> foo(x, *, y)
Okay, that's a LOT easier than the stuff I was playing around with :)
Of course, it still requires that inspect.signature be used.
ChrisA
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Modifying signature of ctor in class Chris Angelico <rosuav@gmail.com> - 2015-09-25 08:23 +1000
csiph-web