Re: What is the difference between class Foo(): and class Date(object):

2016-11-21 Thread Veek M
Steve D'Aprano wrote: > On Mon, 21 Nov 2016 11:15 pm, Veek M wrote: > > class Foo(): >> ... pass >> ... > class Bar(Foo): >> ... pass >> ... > b = Bar() > type(b) >> > [...] > >> What is going on here? Shouldn't x = EuroDate(); type(x) give >> 'instance'?? Why is 'b' an

Re: What is the difference between class Foo(): and class Date(object):

2016-11-21 Thread Steve D'Aprano
On Mon, 21 Nov 2016 11:15 pm, Veek M wrote: class Foo(): > ... pass > ... class Bar(Foo): > ... pass > ... b = Bar() type(b) > [...] > What is going on here? Shouldn't x = EuroDate(); type(x) give > 'instance'?? Why is 'b' an 'instance' and 'x' EuroDate? > Why isn't 'b'

What is the difference between class Foo(): and class Date(object):

2016-11-21 Thread Veek M
>>> class Foo(): ... pass ... >>> class Bar(Foo): ... pass ... >>> b = Bar() >>> type(b) >>> class Date(object): ... pass ... >>> class EuroDate(Date): ... pass ... >>> x = EuroDate() >>> type(x) What is going on here? Shouldn't x = EuroDate(); type(x) give 'instance'?? Why is 'b'