Le Fri, 5 Apr 2013 01:47:45 +1100,
Chris Angelico <rosuav at gmail.com> a écrit :
>> class Foo:
> pass
>> class Bar(Foo):
> pass
>> Is there any argument that I can pass to Foo() to get back a Bar()?
> Would anyone expect there to be one? Sure, I could override __new__ to
> do stupid things, but in terms of logical expectations, I'd expect
> that Foo(x) will return a Foo object, not a Bar object.
>>> OSError(errno.ENOENT, "couldn't find that file")
FileNotFoundError(2, "couldn't find that file")
Regards
Antoine.