enthought / enthought/qt_binder

Add a Call Binding

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
20
Forks
4
PR merge metrics
No merged PRs in 30d

Description

A number of Qt APIs are method-based and can't be turned into traits. It would be nice to have a function call syntax in the bindings. It would act like `PulledFrom` (i.e. listen to any extended traits in the arguments, and fire once on initialization) only it would call the given binder method instead of assigning a trait.

`restoreGeometry(object.geometry_memento)`

`child_binder.restoreGeometry(object.geometry_memento)`

The rules for parsing might look like this: Try to parse it using `ast.parse()`. If it fails, try the operator syntax. If it succeeds, see if the root AST node is `Call`. If so, use the `Call` `Binding`. Otherwise, assume that it's one of the operator `Bindings` that just happen to be valid Python syntax.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing PulledFrom and operator Bindings, then inspect how binding expressions are parsed with ast.parse(). Implement the proposed Call Binding behavior for the shown call syntax, including extended-trait listening and initialization, and verify that non-Call expressions retain their existing operator-Binding behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.