Skip to content

black and flake8 on some tests#82

Open
boyanpenkov wants to merge 4 commits intoperrette:masterfrom
boyanpenkov:flake_clean
Open

black and flake8 on some tests#82
boyanpenkov wants to merge 4 commits intoperrette:masterfrom
boyanpenkov:flake_clean

Conversation

@boyanpenkov
Copy link
Contributor

This PR has no functional changes, except to clean up some imports that are unused and reformat some shorter test files with black -- a few cleanup items that came up as I was getting better to grips with the test suite.

Confirming I saw tox pass all on my 3.14 install.

…ile is a reserved word in python and Ive been screwed by using it as a variable name
@boyanpenkov
Copy link
Contributor Author

@perrette -- hey Mahe, just touching base here; these are super-tiny, but I think they move the needle on readability and maintainability.


files = parse_file(":/path/to/file1.pdf:pdf;:/path/to/file2.pdf:pdf")
self.assertEqual(files, ["/path/to/file1.pdf", "/path/to/file2.pdf"])
del files
Copy link
Owner

Choose a reason for hiding this comment

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

Why would you do del files here? Any reason you'd think the garbage collector is not up to the task? If the garbage collector does the job, I'd rather write less lines of code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're 100% right -- I use this idiom a lot to hint to GC that my ~5 Gb numpy array can go away, but here I'm just being way too pendantic.

@perrette
Copy link
Owner

perrette commented Feb 12, 2026

Ok, I guess I wrote most of it with a rather simple editor, without any linting. Makes sense to cleanup unused import and adopt some standardize format. I'm wondering about the del statements though, as I write in the comment.

I have to say though, it's a little tedious for me to go through a PR to check these things line by line. I'd say, in the future you should not worry about it, and let me do that job. Thanks anyway.

@boyanpenkov
Copy link
Contributor Author

Your call -- the flake8 stuff is easy for me to just drop in by the by, if you don't find it confusing. I don't think there's actually that much of it, tbh.

I promise I'll back off the del stuff.. ;) 99.5% of the time on small vars, gc is transparent totally.

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