Skip to content
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

Allow optional item_class in ListComponent #74

Conversation

M1troll
Copy link
Contributor

@M1troll M1troll commented Jul 5, 2024

Add ability to not specify item_class in ListComponent. Instead, it will be automatically filled with value passed in Generic[ListItemType].

Warning: The item_class specification is still available, but it is deprecated and will be removed soon.

Add ability to not specify `item_class` in
`ListComponent`. Instead, it will be
automatically filled with value passed in
`Generic[ListItemType]`.

`Warning`: The `item_class` specification is
still available, but it is deprecated and will be
removed soon.
Comment on lines +195 to +209
if item_class := getattr(self, "item_class", None):
import warnings

warnings.warn(
DeprecationWarning(
"\nSpecifying `item_class` attribute in `ListComponent` "
f"({self.__class__}) is DEPRECATED. It is now "
"automatically substituted from Generic[ListItemType]. "
"Ability to specify this attribute will be removed soon.",
),
stacklevel=2,
)
self._item_class = item_class
else:
self._item_class = self._get_list_item_class()

Choose a reason for hiding this comment

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

I think since pomcorn is pre-release, maybe it's okay to just drop it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then we would have to update all of our current projects... It's not difficult, but it will takes time

@M1troll M1troll merged commit 5d68fd1 into main Jul 8, 2024
1 check passed
@M1troll M1troll deleted the feature/add-ability-to-not-specify-item-class-in-list-component branch July 8, 2024 09:21
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