Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #55932 > unrolled thread

Re: Behaviour-based interface/protocol implementation?

Started byAlan Franzoni <mailing@franzoni.eu>
First post2011-01-27 22:12 +0100
Last post2011-01-27 22:12 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Behaviour-based interface/protocol implementation? Alan Franzoni <mailing@franzoni.eu> - 2011-01-27 22:12 +0100

#55932 — Re: Behaviour-based interface/protocol implementation?

FromAlan Franzoni <mailing@franzoni.eu>
Date2011-01-27 22:12 +0100
SubjectRe: Behaviour-based interface/protocol implementation?
Message-ID<mailman.1395.1296162794.6505.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web