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

Commit2448ac4

Browse files
committed
Merge branch 'addtypes'
2 parents96f8f17 +37cef23 commit2448ac4

File tree

8 files changed

+83
-74
lines changed

8 files changed

+83
-74
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
Dict,
2525
IO,
2626
Optional,
27+
Tuple,
2728
Type,
2829
Union,
2930
overload,
@@ -92,16 +93,16 @@ def win_encode(s: Optional[AnyStr]) -> Optional[bytes]:
9293
returnNone
9394

9495

95-
defwith_metaclass(meta:Type[Any],*bases:Any)->'metaclass':# type: ignore ## mypy cannot understand dynamic class creation
96+
defwith_metaclass(meta:Type[Any],*bases:Any)->TBD:# type: ignore ## mypy cannot understand dynamic class creation
9697
"""copied from https://github.com/Byron/bcore/blob/master/src/python/butility/future.py#L15"""
9798

9899
classmetaclass(meta):# type: ignore
99100
__call__=type.__call__
100101
__init__=type.__init__# type: ignore
101102

102-
def__new__(cls,name:str,nbases:Optional[int],d:Dict[str,Any])->TBD:
103+
def__new__(cls,name:str,nbases:Optional[Tuple[int, ...]],d:Dict[str,Any])->TBD:
103104
ifnbasesisNone:
104105
returntype.__new__(cls,name, (),d)
105106
returnmeta(name,bases,d)
106107

107-
returnmetaclass(meta.__name__+'Helper',None, {})
108+
returnmetaclass(meta.__name__+'Helper',None, {})# type: ignore

‎git/compat/typing.py‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎git/config.py‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,23 @@
2222
with_metaclass,
2323
is_win,
2424
)
25-
fromgit.compat.typingimportLiteral
25+
2626
fromgit.utilimportLockFile
2727

2828
importos.pathasosp
2929

3030
importconfigparserascp
3131

32+
# typing-------------------------------------------------------
33+
34+
fromtypingimportTYPE_CHECKING,Tuple
35+
36+
fromgit.typesimportLiteral
37+
38+
ifTYPE_CHECKING:
39+
pass
40+
41+
# -------------------------------------------------------------
3242

3343
__all__= ('GitConfigParser','SectionConstraint')
3444

@@ -38,7 +48,8 @@
3848

3949
# invariants
4050
# represents the configuration level of a configuration file
41-
CONFIG_LEVELS= ("system","user","global","repository")
51+
CONFIG_LEVELS= ("system","user","global","repository"
52+
)# type: Tuple[Literal['system'], Literal['user'], Literal['global'], Literal['repository']]
4253

4354
# Section pattern to detect conditional includes.
4455
# https://git-scm.com/docs/git-config#_conditional_includes

‎git/diff.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
# typing ------------------------------------------------------------------
1717

1818
fromtypingimportAny,Iterator,List,Match,Optional,Tuple,Type,Union,TYPE_CHECKING
19-
fromgit.compat.typingimportFinal,Literal
20-
fromgit.typesimportTBD
19+
fromgit.typesimportTBD,Final,Literal
2120

2221
ifTYPE_CHECKING:
2322
from .objects.treeimportTree

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp