Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Start adding types to Submodule, add py.typed to manifest#1282

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 12 commits intogitpython-developers:mainfromYobmod:main
Jul 1, 2021
Merged

Conversation

Yobmod
Copy link
Contributor

@YobmodYobmod commentedJun 30, 2021
edited
Loading

Started to add types to Submodule

Removed include_package_data() from setup and added py.typed to MANIFEST.INI instead (this is what mypy package does, but not what the mypy instructions say!)

Improve types for .traverse() with TypeVar and overloads, create TraversableIterableObj class to reduce code duplication from overloads.

Add some more checks to test_commit.test_traverse()

Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

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

That's great work, thanks a lot!

It's good to see that people are already starting to use it, too.

Can't wait to merge.

@ByronByron merged commit18c777b intogitpython-developers:mainJul 1, 2021
@Byron
Copy link
Member

Thanks a million for all your work!
It's clear you are committed to getting this done and I would be glad if you would want to become a maintainer. Now that types have been added and it feels like the project would be in serious trouble without your continued support in keeping maintaining types as python evolves along with the type checkers.
Thanks a lot for your consideration.

@ByronByron added this to thev3.1.19 - Bugfixes milestoneJul 23, 2021
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull requestDec 22, 2023
Returning an explicit value from a generator function causes thatvalue to be bound to the `value` attribute of the StopIterationexception. This is available as the result of "yield from" when itis used as an expression; or by explicitly catching StopIteration,binding the StopIteration exception to a variable, and accessingthe attribute. This feature of generators is rarely used.The `return iter([])` statement in Submodule.iter_items uses thisfeature, causing the resulting StopIteration exception object tohave a `value` attribute that refers to a separate second iteratorthat also yields no values. From context, this behavior is clearlynot the goal; a bare return statement should be used here (whichhas the same effect except for the `value` attribute of theStopIteration exception). The code had used a bare return prior to82b131c (gitpython-developers#1282), when `return` was changed to `return iter([])`.That was part of a change that added numerous type annotations. Itlooks like it was either a mistake, or possibly an attempt to workaround an old bug in a static type checker.This commit extends the test_iter_items_from_invalid_hash test toassert that the `value` attribute of the StopIteration is its usualdefault value of None. This commit only extends the test; it doesnot fix the bug.
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull requestDec 22, 2023
Returning an explicit value from a generator function causes thatvalue to be bound to the `value` attribute of the StopIterationexception. This is available as the result of "yield from" when itis used as an expression; or by explicitly catching StopIteration,binding the StopIteration exception to a variable, and accessingthe attribute. This feature of generators is rarely used.The `return iter([])` statement in Submodule.iter_items uses thisfeature, causing the resulting StopIteration exception object tohave a `value` attribute that refers to a separate second iteratorthat also yields no values. From context, this behavior is clearlynot the goal; a bare return statement should be used here (whichhas the same effect except for the `value` attribute of theStopIteration exception). The code had used a bare return prior to82b131c (gitpython-developers#1282), when `return` was changed to `return iter([])`.That was part of a change that added numerous type annotations. Itlooks like it was either a mistake, or possibly an attempt to workaround an old bug in a static type checker.This commit extends the test_iter_items_from_invalid_hash test toassert that the `value` attribute of the StopIteration is its usualdefault value of None. This commit only extends the test; it doesnot fix the bug.
EliahKagan added a commit to EliahKagan/GitPython that referenced this pull requestDec 22, 2023
Returning an explicit value from a generator function causes thatvalue to be bound to the `value` attribute of the StopIterationexception. This is available as the result of "yield from" when itis used as an expression; or by explicitly catching StopIteration,binding the StopIteration exception to a variable, and accessingthe attribute. This feature of generators is rarely used.The `return iter([])` statement in Submodule.iter_items uses thisfeature, causing the resulting StopIteration exception object tohave a `value` attribute that refers to a separate second iteratorthat also yields no values (gitpython-developers#1779).From context, this behavior is clearly not the goal; a bare returnstatement should be used here (which has the same effect except forthe `value` attribute of the StopIteration exception). The code hadused a bare return prior to82b131c (gitpython-developers#1282), when `return` waschanged to `return iter([])`. That was part of a change that addednumerous type annotations. It looks like it was either a mistake,or possibly an attempt to work around an old bug in a static typechecker.This commit extends the test_iter_items_from_invalid_hash test toassert that the `value` attribute of the StopIteration is its usualdefault value of None. This commit only extends the test; it doesnot fix the bug.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ByronByronByron requested changes

Assignees
No one assigned
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
@Yobmod@Byron

[8]ページ先頭

©2009-2025 Movatter.jp