Skip to content

Conversation

@dkrako
Copy link
Member

@dkrako dkrako commented Mar 12, 2025

Description

followup to #1022

inspired by https://stackoverflow.com/questions/76249636/class-properties-in-python-3-11

there's really some next level magic involved. need to level up my skill tree.

@github-actions github-actions bot added the enhancement New feature or request label Mar 12, 2025
@dkrako dkrako mentioned this pull request Mar 12, 2025
12 tasks
@dkrako dkrako marked this pull request as draft March 12, 2025 18:31
@codecov
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dkrako
Copy link
Member Author

dkrako commented Mar 12, 2025

pylint is complaining:

src/pymovements/dataset/dataset_library.py:81: [E0213(no-self-argument), DatasetLibrary.names] Method 'names' should have "self" as first argument

This one would be easy to fix: either rename cls to self or ignore no-self-argument.

What's worse is this:

tests/unit/dataset/dataset_library_test.py:60: [E1133(not-an-iterable), test_list_names_is_list_of_str] Non-iterable value names is used in an iterating context

This means pylint doesn't get that this is a property, not simply a method.

I'll try this approach soon:

class classproperty(property):
    def __get__(self, owner_self, owner_cls):
        return self.fget(owner_cls)

@dkrako
Copy link
Member Author

dkrako commented Nov 18, 2025

closed as not worth the hastle

@dkrako dkrako closed this Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants