A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-April/125114.html below:

[Python-Dev] Semantics of __int__(), __index__()

[Python-Dev] Semantics of __int__(), __index__()Antoine Pitrou solipsis at pitrou.net
Thu Apr 4 17:19:10 CEST 2013
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.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4