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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing functions should be static #931

Open
justusschock opened this issue Jul 14, 2022 · 1 comment
Open

Parsing functions should be static #931

justusschock opened this issue Jul 14, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@justusschock
Copy link
Contributor

馃殌 Feature
Parsing methods like Image._parse_affine, Image._parse_tensor and Image._read_and_check currently don't touch the class state (via self). As they only do input validation, they also shouldn't.

To prevent this entirely and especially making it easier to test these when they are overwritten, to me it makes sense to make those functions completely static.

What do you think @fepegar ?

Note: This probably doesn't matter when using the built-in image classes, but heavily impacts testability for custom classes.

@justusschock justusschock added the enhancement New feature or request label Jul 14, 2022
@fepegar
Copy link
Owner

fepegar commented Aug 10, 2022

Hi, @justusschock. I agree it makes sense to make any methods not using self static.

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

No branches or pull requests

2 participants