On 06/01/2021 22:03, Rich Shepard wrote:
On Thu, 7 Jan 2021, Chris Angelico wrote:

Are you sure that this works? It's syntactically valid, but I don't
think it means what you think it does.

ChrisA,

I'm always open to learning. There's no error generated ... yet the
application doesn' open so it's time to run it through pdb.

Spoiler: unless the name 'underline' is defined you get a NameError:

NameError: name 'underline' is not defined

If it is defined and self.callbacks is a dict you get a TypeError:

TypeError: unhashable type: 'slice'

because that's what a colon means in a context like

x[a:b]

From what you posted I would guess that underline is most likely a keyword argument to the add_command() method:

file_menu.add_command(
    label='New',
    command=self.callbacks['file->new'],
    underline=0,
    accelerator='Ctrl+N'
)

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to