You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pass keyword arguments to Handlers' callbacks and other interfaces (breaks backward compatibility!) #291
Since upstream CEF constantly changes, to minimize code breaking when updating to newer CEF, it would be best to use keyword arguments in callbacks, so that when a new argument is added it will not break existing code. And when argument is removed in upstream CEF, we might still keep the old argument for BC.
Using keyword arguments would also be useful in PyCharm so that it doesn't generate warnings when there are unused parameters in callbacks.
For example a callback would be defined like this:
To make this possible, src/handlers/ need to be modified, so that keyword arguments are specified when calling user-provided callback.
This will break existing code! So changes will be required.
There is also a related feature to catch possible errors in parameters when declaring Handlers - Issue #215 "Expose handlers as classes/interfaces: ClientHandler, DisplayHandler, LifespanHandler, etc.". This feature does not conflict with using **kwargs, there would just be two ways for doing it.
changed the title [-]Pass keyword arguments to Handlers' callbacks[/-][+]Pass keyword arguments to Handlers' callbacks and other interfaces[/+]on Dec 20, 2016
changed the title [-]Pass keyword arguments to Handlers' callbacks and other interfaces[/-][+]Pass keyword arguments to Handlers' callbacks and other interfaces (breaks backward compatibility!)[/+]on Dec 20, 2016
Activity
[-]Pass keyword arguments to Handlers' callbacks[/-][+]Pass keyword arguments to Handlers' callbacks and other interfaces[/+][-]Pass keyword arguments to Handlers' callbacks and other interfaces[/-][+]Pass keyword arguments to Handlers' callbacks and other interfaces (breaks backward compatibility!)[/+]Fix focus in all examples. Pass kwargs to Handlers' callbacks (BC BRE…
cztomczak commentedon Dec 20, 2016
Done in commit 0a7d8d6. All examples and unit tests updated to use the new style.