-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove bare
invocations
of @contextmember
and @contextproperty
,…
… and add typing to them Previously `contextmember` and `contextproperty` were 2-in-1 decorators. This meant they could be invoked either as `@contextmember` or `@contextmember('some_string')`. This was fine until we wanted to return typing to the functions. In the instance where the bare decorator was used (i.e. no `(...)` were present) an object was expected to be returned. However in the instance where parameters were passed on the invocation, a callable was expected to be returned. Putting a union of both in the return type made the invocations complain about each others' return type. To get around this we've dropped the bare invocation as acceptable. The parenthesis are now always required, but passing a string in them is optional.
- Loading branch information
Showing
7 changed files
with
72 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.