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

check easy to make globbing mistake #172

Open
JoeZiminski opened this issue Dec 20, 2023 · 0 comments
Open

check easy to make globbing mistake #172

JoeZiminski opened this issue Dec 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@JoeZiminski
Copy link
Member

Today I made the error:

files = filepath.glob("*")
assert any(files)
for file in files:
    ...

Of course the any call eats the first element from the generator. Check this pattern in datashuttle, in general convert to list of the bat we are rarely going to deal with so many files a generator is useful and it is very easy to make mistakes when refactoring such code.

@JoeZiminski JoeZiminski added the enhancement New feature or request label Dec 20, 2023
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

1 participant