File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # flags: --minimum-version=3.12 --target-version=py312
2+ # this is invalid in versions below py312
3+ class ClassA [T : str ]:
4+ def method1 (self ) -> T :
5+ ...
6+
7+ # output
8+ # this is invalid in versions below py312
9+ class ClassA [T : str ]:
10+ def method1 (self ) -> T : ...
Original file line number Diff line number Diff line change @@ -236,8 +236,8 @@ def get_flags_parser() -> argparse.ArgumentParser:
236236 parser = argparse .ArgumentParser ()
237237 parser .add_argument (
238238 "--target-version" ,
239- action = "append " ,
240- type = lambda val : TargetVersion [val .upper ()],
239+ action = "store " ,
240+ type = lambda val : ( TargetVersion [val .upper ()],) ,
241241 default = (),
242242 )
243243 parser .add_argument ("--line-length" , default = DEFAULT_LINE_LENGTH , type = int )
@@ -258,7 +258,7 @@ def get_flags_parser() -> argparse.ArgumentParser:
258258 default = None ,
259259 help = (
260260 "Minimum version of Python where this test case is parseable. If this is"
261- " set, the test case will be run twice: once with the specified"
261+ " set, the test case will be run twice: once without the specified"
262262 " --target-version, and once with --target-version set to exactly the"
263263 " specified version. This ensures that Black's autodetection of the target"
264264 " version works correctly."
You can’t perform that action at this time.
0 commit comments