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

Commitadd46d9

Browse files
committed
Use "is" to compare __class__
Since the value of __class__ is a type, comparing it to anothertype object should use "is" rather than "==".Some of these, involving type(), were fixed inbf7af69, but flake8did not catch the .__class__ variation addressed here.
1 parent59d208c commitadd46d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎git/refs/symbolic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def iter_items(
769769
770770
List is lexicographically sorted
771771
The returned objects represent actual subclasses, such as Head or TagReference"""
772-
return (rforrincls._iter_items(repo,common_path)ifr.__class__==SymbolicReferenceornotr.is_detached)
772+
return (rforrincls._iter_items(repo,common_path)ifr.__class__isSymbolicReferenceornotr.is_detached)
773773

774774
@classmethod
775775
deffrom_path(cls:Type[T_References],repo:"Repo",path:PathLike)->T_References:
@@ -797,7 +797,7 @@ def from_path(cls: Type[T_References], repo: "Repo", path: PathLike) -> T_Refere
797797
try:
798798
instance:T_References
799799
instance=ref_type(repo,path)
800-
ifinstance.__class__==SymbolicReferenceandinstance.is_detached:
800+
ifinstance.__class__isSymbolicReferenceandinstance.is_detached:
801801
raiseValueError("SymbolicRef was detached, we drop it")
802802
else:
803803
returninstance

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp