Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34
resolve typing errors in project after merge#331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
2227122ede3732b02c7796465520a6f130d6e0e396File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -8,7 +8,7 @@ | ||
| from .parsable import Parsable | ||
| T = TypeVar("T") | ||
| T = TypeVar("T", bool, str, int, float, UUID, datetime, timedelta, date, time, bytes) | ||
| U = TypeVar("U", bound=Parsable) | ||
| @@ -25,7 +25,7 @@ class ParseNode(ABC): | ||
| """ | ||
| @abstractmethod | ||
| def get_str_value(self) -> str: | ||
| def get_str_value(self) -> Optional[str]: | ||
| """Gets the string value of the node | ||
| Returns: | ||
| @@ -34,7 +34,7 @@ def get_str_value(self) -> str: | ||
| pass | ||
| @abstractmethod | ||
| def get_child_node(self, identifier: str) -> ParseNode: | ||
| def get_child_node(self, identifier: str) -> Optional[ParseNode]: | ||
| """Gets a new parse node for the given identifier | ||
| Args: | ||
| @@ -118,16 +118,17 @@ def get_time_value(self) -> Optional[time]: | ||
| pass | ||
| @abstractmethod | ||
| def get_collection_of_primitive_values(self) -> List[T]: | ||
| def get_collection_of_primitive_values(self, primitive_type) -> Optional[List[T]]: | ||
| """Gets the collection of primitive values of the node | ||
andrueastman marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Args: | ||
| primitive_type: The type of primitive to return. | ||
| Returns: | ||
| List[T]: The collection of primitive values | ||
| """ | ||
| pass | ||
| @abstractmethod | ||
| def get_collection_of_object_values(self, factory: ParsableFactory) -> List[U]: | ||
| def get_collection_of_object_values(self, factory: ParsableFactory) -> Optional[List[U]]: | ||
| """Gets the collection of model object values of the node | ||
| Args: | ||
| factory (ParsableFactory): The factory to use to create the model object. | ||
| @@ -137,7 +138,7 @@ def get_collection_of_object_values(self, factory: ParsableFactory) -> List[U]: | ||
| pass | ||
| @abstractmethod | ||
| def get_collection_of_enum_values(self) -> List[K]: | ||
| def get_collection_of_enum_values(self, enum_class: K) -> Optional[List[K]]: | ||
| """Gets the collection of enum values of the node | ||
| Returns: | ||
| @@ -146,7 +147,7 @@ def get_collection_of_enum_values(self) -> List[K]: | ||
| pass | ||
| @abstractmethod | ||
| def get_enum_value(self) -> Enum: | ||
| def get_enum_value(self, enum_class: K) -> Optional[K]: | ||
andrueastman marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| """Gets the enum value of the node | ||
| Returns: | ||
| @@ -155,17 +156,17 @@ def get_enum_value(self) -> Enum: | ||
| pass | ||
| @abstractmethod | ||
| def get_object_value(self, factory: ParsableFactory) -> Parsable: | ||
| def get_object_value(self, factory: ParsableFactory[U]) -> U: | ||
baywet marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| """Gets the model object value of the node | ||
| Args: | ||
| factory (ParsableFactory): The factory to use to create the model object. | ||
| Returns: | ||
| Parsable: The model object value of the node | ||
| U: The model object value of the node | ||
| """ | ||
| pass | ||
| @abstractmethod | ||
| def get_bytes_value(self) -> bytes: | ||
| def get_bytes_value(self) -> Optional[bytes]: | ||
| """Get a bytes value from the nodes | ||
| Returns: | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.