[New-bugs-announce] [issue15303] Minor revision to the <BaseWidget._setup> method in Tkinter

Drew French report at bugs.python.org
Mon Jul 9 10:25:50 CEST 2012


New submission from Drew French <rectangletangle at gmail.com>:

In the <BaseWidget._setup> method, <master> is evaluated as a Boolean (when Tkinter attempts to find a parent for the widget). I think it should really be evaluated against <None>, seeing as that is the default <master> keyword argument value for most widgets. I ran into problems with this when making a container widget class that inherited from the <Canvas>, then implementing the <__len__> magic method. When the length was zero the widget would evaluate as false, which would prevented me from packing widgets inside my container widget.

I attached a revised version of the method.

----------
components: Tkinter
files: tkbugfix.py
messages: 165070
nosy: Drew.French
priority: normal
severity: normal
status: open
title: Minor revision to the <BaseWidget._setup> method in Tkinter
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file26326/tkbugfix.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15303>
_______________________________________


More information about the New-bugs-announce mailing list