Skip to content

Conversation

@GefMar
Copy link
Owner

@GefMar GefMar commented Jan 9, 2025

No description provided.

class ProcessAttr:
attr_name: str
from_context: bool = dataclasses.field(default=False)
cast: typing.Callable[[typing.Any], typing.Any] = dataclasses.field(default=lambda arg: arg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T = TypeVar("T")
...
cast: typing.Callable[[typing.Any], T]
...
def get_value(self, context: typing.Any) -> T

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Idea

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FIX

@GefMar GefMar requested a review from s-aleshin January 10, 2025 18:41
@GefMar GefMar merged commit 0fa92f4 into develop Jan 10, 2025
4 checks passed
@GefMar GefMar deleted the ProcessAttr-Cast branch January 10, 2025 19:02
GefMar added a commit that referenced this pull request Jan 10, 2025
* add: Cast Callable for ProcessAttr
* update: README.md

---------
GefMar added a commit that referenced this pull request Jan 11, 2025
* add: Cast Callable for ProcessAttr
* update: README.md

---------
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.

3 participants