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

use _yield from []_ to create empty generator when needed #2572

Closed
mike-hunhoff opened this issue Jan 23, 2025 · 2 comments
Closed

use _yield from []_ to create empty generator when needed #2572

mike-hunhoff opened this issue Jan 23, 2025 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mike-hunhoff
Copy link
Collaborator

          nice. we should do this in other places too.

Originally posted by @williballenthin in #2571 (comment)

@mike-hunhoff mike-hunhoff added good first issue Good for newcomers help wanted Extra attention is needed labels Jan 23, 2025
@mike-hunhoff
Copy link
Collaborator Author

e.g. replace

def extract_thread_features(self, ph: ProcessHandle, th: ThreadHandle) -> Iterator[tuple[Feature, Address]]:
if False:
# force this routine to be a generator,
# but we don't actually have any elements to generate.
yield Characteristic("never"), NO_ADDRESS
return

williballenthin added a commit that referenced this issue Feb 3, 2025
* use _yield from []_ to create empty generator when needed #2572

* Update PR with fixes

* solved CI code style error

* Fixed formatting with black

* Fixed formatting with black

* code styles error

* code styles error

* code styles error

* code style error

* Update capa-rules submodule to master

* Similar changes to other files

---------

Co-authored-by: Willi Ballenthin <[email protected]>
@williballenthin
Copy link
Collaborator

closed in #2581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants