U
Uwe Mayer
Hi,
sometimes I'd like to be able to specify that a parameter to a method call
should be of a specific instance. I can do that using the isinstance()
buildin in the body of the method.
Is there also a way of specifying this in the method definition, i.e.
class A(object):
def foo( name : B ):
...
which then would be equivalent to i.e.
class A(object):
def foo( name ):
assert isinstance( name, B )
....
Is anything like that already available? Or might that be possible in future
versions of Python?
Ciao
Uwe
sometimes I'd like to be able to specify that a parameter to a method call
should be of a specific instance. I can do that using the isinstance()
buildin in the body of the method.
Is there also a way of specifying this in the method definition, i.e.
class A(object):
def foo( name : B ):
...
which then would be equivalent to i.e.
class A(object):
def foo( name ):
assert isinstance( name, B )
....
Is anything like that already available? Or might that be possible in future
versions of Python?
Ciao
Uwe