Release/v0.4.1 - #1
Conversation
| from .property import Property | ||
|
|
||
|
|
||
| class Readonly[T](Property[T]): |
There was a problem hiding this comment.
🚫 Codacy found a high ErrorProne issue: invalid syntax (F999)
The issue arises from the use of generics in the class definition. The syntax Readonly[T](Property[T]) is incorrect in Python, as the use of generics requires the Generic base class from the typing module. To fix this, you need to inherit from Generic[T] in addition to Property[T].
Here's the code suggestion to fix the issue:
| class Readonly[T](Property[T]): | |
| class Readonly(Property[T], Generic[T]): |
This comment was generated by an experimental AI tool.
| from typing import Callable | ||
|
|
||
|
|
||
| def cond[**P, T, F]( |
There was a problem hiding this comment.
🚫 Codacy found a high ErrorProne issue: expected '(' (F999)
The issue reported by the Prospector linter is due to the incorrect syntax used for the type parameters in the function definition. In Python's type hinting, you cannot use square brackets [] for defining type variables; instead, you should use parentheses () with the TypeVar function from the typing module.
To fix the issue, you need to change the definition of the cond function to use TypeVar for the type parameters. Here's the single line change needed:
| def cond[**P, T, F]( | |
| def cond(P, T, F)(condition: Callable[P, bool], if_true: Callable[P, T], if_false: Callable[P, F]) -> Callable[P, T | F]: |
This comment was generated by an experimental AI tool.
Changelog:
condtorxget_fieldstoFieldAsyncBindable&BindableClassProperty__slots__toProperty