Re: Distinction between “class” and “type”

2016-05-14 Thread Andreas Röhler
I suspect that one could produce a class that is not a type, Say: has not a complete type definition. Think of type for example with the distinction of strings and numbers. Types start from low level units. A class definition must know about strings and numbers, it inherits this knowledge

Re: Distinction between “class” and “type”

2016-05-14 Thread Steven D'Aprano
On Fri, 13 May 2016 03:07 pm, Ben Finney wrote: > Howdy all, > > Ever since Python's much-celebrated Grand Unification of classes and > types, I have used those terms interchangeably: every class is a type, > and every type is a class. > > That may be an unwise conflation. With the recent rise

Re: Distinction between “class” and “type”

2016-05-13 Thread Paul Rubin
Terry Reedy writes: > I suspect that one could produce a class that is not a type, in > Guido's meaning, with a metaclass that is not a subclass of the type > class. I don't otherwise know what Guido might have meant. I think meant that if X is a class, then X is (usually)

Re: Distinction between “class” and “type”

2016-05-13 Thread Terry Reedy
On 5/13/2016 1:07 AM, Ben Finney wrote: Howdy all, Ever since Python's much-celebrated Grand Unification of classes and types, I have used those terms interchangeably: every class is a type, and every type is a class. That may be an unwise conflation. With the recent rise of optional type

Re: Distinction between “class” and “type”

2016-05-13 Thread Michael Selik
On Fri, May 13, 2016 at 1:10 AM Ben Finney wrote: > Howdy all, > > Ever since Python's much-celebrated Grand Unification of classes and > types, I have used those terms interchangeably: every class is a type, > and every type is a class. > > That may be an unwise

Re: Distinction between “class” and “type”

2016-05-13 Thread Gregory Ewing
Paul Rubin wrote: You can't instantiate T by saying x = T() and expecting to get back some value that is (indeterminately) an int or a string. Unless it's Python 6000 running on a quantum computer... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Distinction between “class” and “type”

2016-05-13 Thread Paul Rubin
Ben Finney writes: > There's a big overlap because most classes are also types -- but not > the other way around! E.g. Any is a type but not a class (you can > neither inherit from Any nor instantiate it), and the same is true > for unions and type

Re: Distinction between “class” and “type”

2016-05-12 Thread Rustom Mody
On Friday, May 13, 2016 at 10:37:34 AM UTC+5:30, Ben Finney wrote: > Howdy all, > > Ever since Python's much-celebrated Grand Unification of classes and > types, I have used those terms interchangeably: every class is a type, > and every type is a class. > > That may be an unwise conflation.

Re: Distinction between “class” and “type”

2016-05-12 Thread Chris Angelico
On Fri, May 13, 2016 at 3:07 PM, Ben Finney wrote: > This recent message from GvR, discussing a relevant PEP, advocates > keeping them separate: > > PEP 484 […] tries to make a clear terminological between classes > (the things you have at runtime) and types

Distinction between “class” and “type”

2016-05-12 Thread Ben Finney
Howdy all, Ever since Python's much-celebrated Grand Unification of classes and types, I have used those terms interchangeably: every class is a type, and every type is a class. That may be an unwise conflation. With the recent rise of optional type annotation in Python 3, more people are