Tkinter: title oddity

Fredrik Lundh fredrik at effbot.org
Sun Dec 31 07:37:47 EST 2000


Dan Underwood wrote:
> root.title('my nice title')
> and
> root.title(string='my nice title')
>
> produce the same result... but
>
> someOtherToplevel.title('my nice title')
> works ok
> but
>
> someOtherToplevel.title(string='my nice title')
> gets the message: unexpected keyword 'string'
>
> Did I do it wrong, or is this a known inconsistency?

To give library implementers a chance to change things, please
don't use keyword arguments unless the documentation explicitly
tells you to.

(title takes a positional argument, not a keyword argument).

But it shouldn't really matter in this case -- there's only one "title"
implementation in Tkinter (in the Wm mixin), and it takes a single
argument called "string".  Maybe "someOtherToplevel" is a Toplevel
subclass where title has been overridden?

</F>





More information about the Python-list mailing list