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

Commit35231db

Browse files
committed
Add type to objects.base.new()
1 parente364c5e commit35231db

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎git/objects/base.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .treeimportTree
2626
from .blobimportBlob
2727
from .submodule.baseimportSubmodule
28+
fromgit.refs.referenceimportReference
2829

2930
IndexObjUnion=Union['Tree','Blob','Submodule']
3031

@@ -59,7 +60,7 @@ def __init__(self, repo: 'Repo', binsha: bytes):
5960
assertlen(binsha)==20,"Require 20 byte binary sha, got %r, len = %i"% (binsha,len(binsha))
6061

6162
@classmethod
62-
defnew(cls,repo:'Repo',id):# @ReservedAssignment
63+
defnew(cls,repo:'Repo',id:Union[str,'Reference'])->Commit_ish:
6364
"""
6465
:return: New Object instance of a type appropriate to the object type behind
6566
id. The id of the newly created object will be a binsha even though

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ filterwarnings = 'ignore::DeprecationWarning'
1919
# filterwarnings ignore::WarningType # ignores those warnings
2020

2121
[tool.mypy]
22-
disallow_untyped_defs =true
22+
#disallow_untyped_defs = true
2323
no_implicit_optional =true
2424
warn_redundant_casts =true
2525
# warn_unused_ignores = True

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp