1

I would like to know if Tkinter.Canvas is a classic or modern Python class, because super does not work as expected (for me).

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
LittleByBlue
  • 436
  • 9
  • 18
  • 2
    Why do you say it doesn't work as expected? – Christian Tapia Jan 27 '15 at 16:02
  • Say you have `x = tkinter.Canvas` then is `type(x)` giving you `instance`? What do you get if you do `print x`? – shuttle87 Jan 27 '15 at 16:03
  • Yes, `Tkinter.Canvas` is an *"old-style"* class, it doesn't inherit from `object` and therefore won't play well with `super` etc. – jonrsharpe Jan 27 '15 at 16:05
  • possible duplicate of [Inherit from Tkinter.Canvas - calling super leads to error](http://stackoverflow.com/questions/14389918/inherit-from-tkinter-canvas-calling-super-leads-to-error) – jonrsharpe Jan 27 '15 at 16:06
  • Ok I think it is a duplicate of http://stackoverflow.com/questions/14389918/inherit-from-tkinter-canvas-calling-super-leads-to-error I did not find it because of the bad search system of SE. @jonrsharpe this is what I searched for. – LittleByBlue Jan 27 '15 at 16:12
  • 1
    @LittleByBlue it's literally the first hit for http://stackoverflow.com/search?q=tkinter+canvas+super – jonrsharpe Jan 27 '15 at 16:13

1 Answers1

3

All Tkinter classes in python 2.x are old style classes.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685