Is it possible to modify how run() is typed so the result isn't potentially None?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start by tracing the Runner.run API and the disown option described in the issue, then inspect how its return annotation is used by callers. Determine whether the typing can distinguish disowned and owned execution without breaking the existing API, and add coverage showing the annotation and behavior for both cases.
Written by the indexing model from the issue text.
Description
This is a semi ignore question, but I want to know if this is possible and if I could open a PR to fix.
This is kind of an annoy behavior:
def run(self, command: str, **kwargs: Any) -> Optional["Result"]:
It means I always have to check if its not None, but from what I understand the only case where it will return None is if disown is set to True right?
Is there a way to refactor so the response is always expected to return unless disown is set to true?
Maybe just a super simple class hierarchy where the base Runner class has everything but there are two children:
DisownedRunner and OwnedRunner?
And then DisownedRunner runner is the only one that is potentially None?
Thanks! I'm asking more what it would take to fix so I can open a PR more than just asking for this to be fixed, I'd like to contribute!
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 412
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pyinvoke/invoke
-
[Security] Shell injection via Context.cd() path argument — metacharacters not escaped (CWE-78) Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anthropics/skills#1811 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
speaches-ai/speaches#678 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
datalayer/mcp-compose#42 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
UKGovernmentBEIS/inspect_evals#2523 ·