Skip to content

Add Union type hints to full_grid_input_partial#3

Open
richardmcmillen wants to merge 1 commit into
tararoys:dense_mouse_grid_2from
richardmcmillen:dense_mouse_grid_2
Open

Add Union type hints to full_grid_input_partial#3
richardmcmillen wants to merge 1 commit into
tararoys:dense_mouse_grid_2from
richardmcmillen:dense_mouse_grid_2

Conversation

@richardmcmillen

Copy link
Copy Markdown

This method is called either with a number or a string, and without the int type hint there is an error in the logs.

2022-04-14 16:26:24 ERROR TalonScript TypeError in: /Users/rickymcmillen/.talon/user/dense-mouse-grid/dense_mouse_grid/full_mouse_grid_open.talon:19
2022-04-14 16:26:24 ERROR Line 20: user.full_grid_input_partial(letter: str)
2022-04-14 16:26:24 ERROR Line 20:   parameter 1 (letter) expects type <class 'str'>, got <class 'int'>

This did not appear to effect the functionality at all.

(I have no idea how to python, I learnt this from a quick google)

This method is called either with a number or a string, and without the `int` type hint there is an error in the logs.

```
2022-04-14 16:26:24 ERROR TalonScript TypeError in: /Users/rickymcmillen/.talon/user/dense-mouse-grid/dense_mouse_grid/full_mouse_grid_open.talon:19
2022-04-14 16:26:24 ERROR Line 20: user.full_grid_input_partial(letter: str)
2022-04-14 16:26:24 ERROR Line 20:   parameter 1 (letter) expects type <class 'str'>, got <class 'int'>
```

This did not appear to effect the functionality at all.
@richardmcmillen

Copy link
Copy Markdown
Author

I tried declaring this as str | int but got a type error on file save. I think that is only possible in newer versions of python.

TypeError: unsupported operand type(s) for |: 'type' and 'type'

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.

1 participant