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

Commit4dfd480

Browse files
committed
Fix how Remote annotates dynamic config-backed url attribute
This fixes a mypy error by replacing an annotation on `self.url`,which is a mypy error, by adding an annotation at the class levelfor a `url` instance attribute.This adds a corresponding brief docstring for it as well, which mayslightly improve usability, but the main impact is one less mypyerror.
1 parentc34a466 commit4dfd480

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎git/remote.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ class Remote(LazyMixin, IterableObj):
559559
"--exec",
560560
]
561561

562+
url:str# Obtained dynamically from _config_reader. See __getattr__ below.
563+
"""The URL configured for the remote."""
564+
562565
def__init__(self,repo:"Repo",name:str)->None:
563566
"""Initialize a remote instance.
564567
@@ -570,7 +573,6 @@ def __init__(self, repo: "Repo", name: str) -> None:
570573
"""
571574
self.repo=repo
572575
self.name=name
573-
self.url:str
574576

575577
def__getattr__(self,attr:str)->Any:
576578
"""Allows to call this instance like ``remote.special(*args, **kwargs)`` to

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp