Skip to content

Conversation

@dantetemplar
Copy link

@dantetemplar dantetemplar commented Feb 19, 2025

@ghost
Copy link

ghost commented Feb 19, 2025

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news awaiting review labels Feb 19, 2025
@dantetemplar
Copy link
Author

skip issue

@dantetemplar
Copy link
Author

dantetemplar commented Feb 19, 2025

The original documentation did not include a declaration for BasicUser, so I added one along with some additional examples

@JelleZijlstra
Copy link
Member

I don't think we need this many additional examples. Let's try to keep the examples short and focused. It may be enough to just add a class BasicUser(User): ....

@dantetemplar
Copy link
Author

I don't think we need this many additional examples. Let's try to keep the examples short and focused. It may be enough to just add a class BasicUser(User): ....

image

Let me argue, then this section does not give the reader information about how typing with inheritance will work in this case. If it’s ok, then fine, I’ll remove the unnecessary stuff.

make_new_user(User) # OK
make_new_user(ProUser) # Also OK: ``type[ProUser]`` is a subtype of ``type[User]``
make_new_user(TeamUser) # Still fine
make_new_user(BasicUser) # Also OK: ``type[BasicUser]`` is a subtype of ``type[User]``
Copy link
Member

Choose a reason for hiding this comment

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

This now demonstrates the exact same thing three times. I think we only need one. We can keep one of the three subclasses in this test, and move the remaining two class definitions to the next test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants