<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 05/02/2013 07:57 AM, Barry Warsaw
      wrote:<br>
    </div>
    <blockquote cite="mid:20130502075730.0768263c@anarchist" type="cite">
      <pre wrap="">On May 01, 2013, at 11:54 AM, Larry Hastings wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">On 04/30/2013 11:29 PM, Ethan Furman wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">On 04/30/2013 11:18 PM, Barry Warsaw wrote:
</pre>
          <blockquote type="cite">
            <pre wrap="">On Apr 28, 2013, at 11:50 PM, Ethan Furman wrote:

</pre>
            <blockquote type="cite">
              <pre wrap="">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.
</pre>
            </blockquote>
            <pre wrap="">
class Foo:
     a = object()
     b = object()

class Bar(Foo):
     c = object()

</pre>
            <blockquote type="cite">
              <blockquote type="cite">
                <blockquote type="cite">
                  <pre wrap="">Foo.a is Bar.a
</pre>
                </blockquote>
              </blockquote>
            </blockquote>
            <pre wrap="">True
</pre>
          </blockquote>
          <pre wrap="">
Wow.  I think I'm blushing from embarrassment.

Thank you for answering my question, Barry.
</pre>
        </blockquote>
        <pre wrap="">
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.
</pre>
      </blockquote>
      <pre wrap="">
Sure, why not?  In "normal" Python, Bar inherits a from Foo, it doesn't define
it so it's exactly the same object.  Thus if you access that object through
the superclass, you get the same object as when you access it through the
subclass.

So Foo.a plays the role of Color.red and Bar.a plays the role of
MoreColor.red.  Same object, thus `Foo.a is Bar.a` is equivalent to `Color.red
is MoreColor.red`.
</pre>
    </blockquote>
    <br>
    So you're saying Color.red and MoreColor.red are the same object. 
    Which means they have the same type.  But in Ethan's original
    example above, type(Color.red) == Color, and type(MoreColor.red) ==
    MoreColor.  Those are different types.<br>
    <br>
    So, for the second time: How can Color.red and MoreColor.red be the
    same object when they are of different types?<br>
    <br>
    p.s. They can't.<br>
    <br>
    <br>
    <i>/arry</i><br>
  </body>
</html>