Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #55932
| References | <AANLkTi=BFiPKC+4JHiupHHr2kLwEBoSH9P0t60E_kCQV@mail.gmail.com> <4D41CE70.1090900@stoneleaf.us> |
|---|---|
| From | Alan Franzoni <mailing@franzoni.eu> |
| Date | 2011-01-27 22:12 +0100 |
| Subject | Re: Behaviour-based interface/protocol implementation? |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1395.1296162794.6505.python-list@python.org> (permalink) |
On Thu, Jan 27, 2011 at 8:58 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
> When you signature check, do you mean counting the number of arguments, or
> actually checking argument types?
In order to check for argument types I should either assume type
annotation (python 3 only, optional) or parse the docstring for the
method, which might not be available or be out of sync.
I just want to check for method name, number and/or names of the
arguments. It might not be trivial in python because the very same
argument can be passed either as a positional or a kw argument, so
def method1(self, a, b):
...
def method1(self, c, d):
...
could satisfy or not the very same interface, depending whether the
args are passed as postional or kw.
--
Alan Franzoni
--
contact me at public@[mysurname].eu
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Behaviour-based interface/protocol implementation? Alan Franzoni <mailing@franzoni.eu> - 2011-01-27 22:12 +0100
csiph-web