Skip to content

Conversation

@penguinolog
Copy link
Collaborator

@penguinolog penguinolog commented Apr 12, 2023

  • If body is not Sized - __len__ call should raise AttributeError
  • Downside: since body can be replaced, __len__ is always set ant ListBox by itself will pass Sized instance check
  • Relax SimpleListWalker constructor rules: any Iterable is allowed as source due to list is used internally
Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

Fix #445

* If body is not `Sized` - `__len__` call should raise `AttributeError`
* Downside: since body can be replaced, `__len__` is always set ant `ListBox` by itself will pass `Sized` instance check
* Relax `SimpleListWalker` constructor rules: any Iterable is allowed as source due to `list` is used internally
@penguinolog penguinolog changed the title Fix #445 - add __len__ to listbox with validation if body Sized Fix: #445 - add __len__ to listbox with validation if body Sized Apr 12, 2023
@penguinolog penguinolog merged commit 2f80bad into urwid:master Apr 12, 2023
@penguinolog penguinolog deleted the make_listbox_semi-sized branch April 12, 2023 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

urwid.ListBox

1 participant