On 04/30/2013 11:29 PM, Ethan Furman wrote: > On 04/30/2013 11:18 PM, Barry Warsaw wrote: >> On Apr 28, 2013, at 11:50 PM, Ethan Furman wrote: >> >>> But as soon as: >>> >>> type(Color.red) is Color # True >>> type(MoreColor.red) is MoreColor # True >>> >>> then: >>> >>> Color.red is MoreColor.red # must be False, no? >>> >>> >>> If that last statement can still be True, I'd love it if someone >>> showed me >>> how. >> >> class Foo: >> a = object() >> b = object() >> >> class Bar(Foo): >> c = object() >> >>>>> Foo.a is Bar.a >> True > > Wow. I think I'm blushing from embarrassment. > > Thank you for answering my question, Barry. Wait, what? I don't see how Barry's code answers your question. In his example, type(a) == type(b) == type(c) == object. You were asking "how can Color.red and MoreColor.red be the same object if they are of different types?" p.s. They can't. //arry/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130501/9e5ae850/attachment.html>
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