Re: Making Classes Subclassable

2016-07-05 Thread Lawrence D’Oliveiro
On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: > > Lawrence D’Oliveiro writes: > > > Some of the classes in Qahirah, my Cairo binding > I found handy to reuse elsewhere, for > example in my binding for Pixman . > S

Re: Making Classes Subclassable

2016-07-05 Thread Lawrence D’Oliveiro
On Wednesday, July 6, 2016 at 3:03:26 AM UTC+12, Ian wrote: > > On Mon, Jul 4, 2016 at 2:34 AM, Lawrence D’Oliveiro wrote: >> >> On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: >>> --> "type(obj)" or "obj.__class__" (there are small differences) >>> give you the type/class of "obj". >>

Re: Making Classes Subclassable

2016-07-05 Thread Steven D'Aprano
On Wed, 6 Jul 2016 01:02 am, Ian Kelly wrote: > On Mon, Jul 4, 2016 at 2:34 AM, Lawrence D’Oliveiro > wrote: >> On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: >>> --> "type(obj)" or "obj.__class__" (there are small differences) >>> give you the type/class of "obj". >> >> When would i

Re: Making Classes Subclassable

2016-07-05 Thread Steven D'Aprano
On Wed, 6 Jul 2016 12:41 am, Ian Kelly wrote: > On Tue, Jul 5, 2016 at 2:31 AM, Steven D'Aprano > wrote: >> On Monday 04 July 2016 18:34, Lawrence D’Oliveiro wrote: >> >>> On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: --> "type(obj)" or "obj.__class__" (there are small differen

Re: Making Classes Subclassable

2016-07-05 Thread Ian Kelly
On Mon, Jul 4, 2016 at 2:34 AM, Lawrence D’Oliveiro wrote: > On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: >> --> "type(obj)" or "obj.__class__" (there are small differences) >> give you the type/class of "obj". > > When would it not be the same? I think the only remaining differenc

Re: Making Classes Subclassable

2016-07-05 Thread Ian Kelly
On Mon, Jul 4, 2016 at 1:57 AM, dieter wrote: > Lawrence D’Oliveiro writes: > >> Some of the classes in Qahirah, my Cairo binding >> I found handy to reuse elsewhere, for >> example in my binding for Pixman . >> Subclassing

Re: Making Classes Subclassable

2016-07-05 Thread Ian Kelly
On Tue, Jul 5, 2016 at 2:31 AM, Steven D'Aprano wrote: > On Monday 04 July 2016 18:34, Lawrence D’Oliveiro wrote: > >> On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: >>> --> "type(obj)" or "obj.__class__" (there are small differences) >>> give you the type/class of "obj". >> >> When w

Re: Making Classes Subclassable

2016-07-05 Thread Steven D'Aprano
On Monday 04 July 2016 18:34, Lawrence D’Oliveiro wrote: > On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: >> --> "type(obj)" or "obj.__class__" (there are small differences) >> give you the type/class of "obj". > > When would it not be the same? class X(object): def __getattrib

Re: Making Classes Subclassable

2016-07-05 Thread dieter
Lawrence D’Oliveiro writes: > On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: >> --> "type(obj)" or "obj.__class__" (there are small differences) >> give you the type/class of "obj". > > When would it not be the same? Special proxy objects, i.e. objects that try to behave as much as

Re: Making Classes Subclassable

2016-07-05 Thread Lawrence D’Oliveiro
On Tuesday, July 5, 2016 at 5:27:01 PM UTC+12, Michael Selik wrote: > On Mon, Jul 4, 2016, 4:36 AM Lawrence D’Oliveiro wrote: > >> On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: >>> >>> --> "type(obj)" or "obj.__class__" (there are small differences) >>> give you the type/class of "ob

Re: Making Classes Subclassable

2016-07-04 Thread Michael Selik
On Mon, Jul 4, 2016, 4:36 AM Lawrence D’Oliveiro wrote: > On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: > > --> "type(obj)" or "obj.__class__" (there are small differences) > > give you the type/class of "obj". > > When would it not be the same? > Old-style classes. > -- https://

Re: Making Classes Subclassable

2016-07-04 Thread Lawrence D’Oliveiro
On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: > --> "type(obj)" or "obj.__class__" (there are small differences) > give you the type/class of "obj". When would it not be the same? -- https://mail.python.org/mailman/listinfo/python-list

Re: Making Classes Subclassable

2016-07-04 Thread dieter
Lawrence D’Oliveiro writes: > Some of the classes in Qahirah, my Cairo binding > I found handy to reuse elsewhere, for > example in my binding for Pixman . > Subclassing is easy, but then you need to ensure that operations