Quote:
Originally Posted by chaley
I am not in favor of making mi subscriptable. Reasons: - It could imply that the book object is really a dict, which it isn't.
- It requires every place that mi is built to implement subscripting. I know of at least 4 places: proxy_metadata, metadata.books, OPF processing, and save_to_disk. I am 90% sure there are more.
- Adding subscripting is a significant change that could break things. Is the risk worth it?
- The construction dict.get('key') is basic to python. It shouldn't be a surprise to the user.
- book.get('title') works, so the user doesn't need to worry about two access methods.
|
I concur.
Quote:
Originally Posted by chaley
Adding on to the above suggestion about **arguments, how about adding a line to the context menu of the template editor that inserts
Code:
python:
def evaluate(**arguments):
book = arguments['book']
db = arguments['db']
This is both a shortcut for typing and aids discoverability.
|
That is more elegant than what I was trying.