Skip to content

Conversation

@dalberto
Copy link
Contributor

@dalberto dalberto commented Jan 5, 2024

No description provided.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Please update the documentation.

Summary:

This PR refactors the Maybe typing in maybe.py to use generic typing, enhancing its flexibility and removing redundant code.

Key points:

  • Updated MaybeBase class to use generic typing.
  • Updated Maybe function to return a MaybeBase of the given type.
  • Removed inner MaybeBase class definition within the Maybe function.
  • create_model function now directly returns the new model.

Generated with ❤️ by ellipsis.dev



def Maybe(model: Type[BaseModel]) -> MaybeBase:
def Maybe(model: Type[T]) -> Type[MaybeBase[T]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

The function signature and implementation have been updated to accept any model that extends BaseModel, but the documentation still refers to BaseModel specifically. Please update the documentation to reflect the changes in the function signature and implementation.

@jxnl jxnl merged commit 3b5da18 into 567-labs:main Jan 5, 2024
@dalberto dalberto deleted the improve-maybe-typing branch January 5, 2024 20:41
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.

2 participants