Skip to content

Commit

Permalink
Modernize stubgen
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn authored and JelleZijlstra committed Mar 30, 2023
1 parent da7268c commit 25c0631
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mypy/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import sys
import traceback
from collections import defaultdict
from typing import Iterable, List, Mapping
from typing import Iterable, Mapping
from typing_extensions import Final

import mypy.build
Expand Down Expand Up @@ -888,8 +888,8 @@ def process_member_expr_decorator(
):
if expr.name == "abstractproperty":
self.import_tracker.require_name(expr.expr.name)
self.add_decorator("%s" % ("property"))
self.add_decorator("{}.{}".format(expr.expr.name, "abstractmethod"))
self.add_decorator("property")
self.add_decorator(f"{expr.expr.name}.abstractmethod"))
else:
self.import_tracker.require_name(expr.expr.name)
self.add_decorator(f"{expr.expr.name}.{expr.name}")
Expand Down Expand Up @@ -1656,8 +1656,8 @@ def generate_stub_from_ast(
file.write("".join(gen.output()))


def get_sig_generators(options: Options) -> List[SignatureGenerator]:
sig_generators: List[SignatureGenerator] = [
def get_sig_generators(options: Options) -> list[SignatureGenerator]:
sig_generators: list[SignatureGenerator] = [
DocstringSignatureGenerator(),
FallbackSignatureGenerator(),
]
Expand Down

0 comments on commit 25c0631

Please sign in to comment.