> Chris Rebert (CR) wrote:
>CR> On Wed, May 6, 2009 at 5:24 AM, Piet van Oostrum wrote:
Lacrima (L) wrote:
>L> But what if I have to instantiate any class with 3 or 4 required
>L> arguments? How can I do it?
>>>
>>> cls.__init__.im_func.__code__.co_argcount
>>>
>>> This will inc
On May 6, 3:36 pm, Chris Rebert wrote:
> On Wed, May 6, 2009 at 5:24 AM, Piet van Oostrum wrote:
>
>
>
> >> Lacrima (L) wrote:
>
> >>L> Hello!
> >>L> For example I have two classes:
>
> >> class First:
> >>L> def __init__(self, *args, **kwargs):
> >>L> pass
>
> >> cla
On Wed, May 6, 2009 at 5:24 AM, Piet van Oostrum wrote:
>> Lacrima (L) wrote:
>
>>L> Hello!
>>L> For example I have two classes:
>
>> class First:
>>L> def __init__(self, *args, **kwargs):
>>L> pass
>
>> class Second:
>>L> def __init__(self, somearg, *args, **kwarg
> Lacrima (L) wrote:
>L> Hello!
>L> For example I have two classes:
> class First:
>L> def __init__(self, *args, **kwargs):
>L> pass
> class Second:
>L> def __init__(self, somearg, *args, **kwargs):
>L> self.somearg = somearg
>L> How can I test that
Lacrima wrote:
class First:
def __init__(self, *args, **kwargs):
pass
class Second:
def __init__(self, somearg, *args, **kwargs):
self.somearg = somearg
How can I test that First class takes 1 required argument and Second
class takes no require
On Wed, May 6, 2009 at 3:08 AM, Lacrima wrote:
> Hello!
>
> For example I have two classes:
>
class First:
> def __init__(self, *args, **kwargs):
> pass
>
class Second:
> def __init__(self, somearg, *args, **kwargs):
> self.somearg = somearg
>
> >>> class First:
>
> def __init__(self, *args, **kwargs):
> pass
>
> >>> class Second:
>
> def __init__(self, somearg, *args, **kwargs):
> self.somearg = somearg
>
> How can I test that First class takes 1 required argument and Second
> class takes
Hello!
For example I have two classes:
>>> class First:
def __init__(self, *args, **kwargs):
pass
>>> class Second:
def __init__(self, somearg, *args, **kwargs):
self.somearg = somearg
How can I test that First class takes 1 required argument and