<div class="gmail_quote">On Mon, Nov 26, 2012 at 3:01 PM, Chris Jerdonek <span dir="ltr"><<a href="mailto:chris.jerdonek@gmail.com" target="_blank">chris.jerdonek@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I would like to know when we should use "class" in the Python 3<br>
documentation, and when we should use "type." Are these terms<br>
synonymous in Python 3, and do we have a preference for which to use<br>
and when?<br>
<br>
I'm sure this has been discussed before. But if this terminology<br>
issue has already been resolved, the resolution doesn't seem to be<br>
reflected in the docs. For example, the glossary entries for type and<br>
class don't reference each other.<br></blockquote><div><br>The historical distinction between "builtin types" and "user-defined classes" predates new-style classes (which unified the type system) and Python 3 (which eliminated the "instance" type that was provided to preserve the legacy user-defined class semantics in Python 2). The glossary unfortunately still reflects this distinction, which no longer exists in Python 3.<br>
<br>A slightly more useful distinction would be if type was used consistently to refer to type(x), while class was used to refer to x.__class__, since they can and do differ in the case of proxy types (like weakref.proxy). However, it's probably too late for that kind of fine distinction - in reality, the two terms are now used pretty much interchangeably.<br>
<br>Cheers,<br>Nick.<br><br></div></div>-- <br>Nick Coghlan | <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a> | Brisbane, Australia<br>