Skip to content

Commit 93314e2

Browse files
committed
build: Use typing.NamedTuple
1 parent 35f7569 commit 93314e2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

libvcs/git.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,27 @@
1515
""" # NOQA: E501
1616
from __future__ import absolute_import, print_function, unicode_literals
1717

18-
import collections
1918
import logging
2019
import os
2120
import re
21+
from typing import NamedTuple
2222

2323
from . import exc
2424
from ._compat import urlparse
2525
from .base import BaseRepo
2626

2727
logger = logging.getLogger(__name__)
2828

29-
GitRemote = collections.namedtuple('GitRemote', ['name', 'fetch_url', 'push_url'])
30-
"""Structure containing git repo information.
3129

32-
Supports `collections.namedtuple._asdict()`
33-
"""
30+
class GitRemote(NamedTuple):
31+
"""Structure containing git repo information.
32+
33+
Supports `collections.namedtuple._asdict()`
34+
"""
35+
36+
name: str
37+
fetch_url: str
38+
push_url: str
3439

3540

3641
def extract_status(value):

0 commit comments

Comments
 (0)