On 10 May 2015 at 17:34, Mark Rosenblitt-Janssen <dreamingforward at gmail.com> wrote: > Here's something that might be wrong in Python (tried on v2.7): > >>>> class int(str): pass > >>>> int(3) > '3' It's not wrong as such. It is allowed to define your own class that subclasses a builtin class, and it's allowed to shadow builtin names. So while this is (obviously) bad practice, it's not wrong. For a simpler example: Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> str <class 'str'> >>> str = "Hello" >>> str 'Hello' Paul
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