Skip to content

Commit b663dc1

Browse files
committed
Formatting and small fixes
1 parent 00e15bb commit b663dc1

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

babel/dates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ def format_skeleton(skeleton: str, datetime: _Instant = None, tzinfo: tzinfo | N
899899

900900

901901
def format_timedelta(delta: timedelta | int,
902-
granularity: Literal["year", "month", "week", "day", "hour", "minute", "second"] ='second',
903-
threshold: float =.85, add_direction: bool = False, format: Literal["narrow", "short", "medium", "long"] = 'long',
902+
granularity: Literal["year", "month", "week", "day", "hour", "minute", "second"] = 'second',
903+
threshold: float = .85, add_direction: bool = False, format: Literal["narrow", "short", "medium", "long"] = 'long',
904904
locale: Locale | str | None = LC_TIME) -> str:
905905
"""Return a time delta according to the rules of the given locale.
906906

babel/localedata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import sys
2020
import threading
2121
from collections import abc
22-
from collections.abc import Iterable, Iterator, Mapping, MutableMapping
22+
from collections.abc import Iterator, Mapping, MutableMapping
2323
from itertools import chain
2424
from typing import Any
2525

babel/numbers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
import decimal
2323
import re
2424
import warnings
25-
from datetime import date as date_
26-
from datetime import datetime as datetime_
25+
from datetime import date as date_, datetime as datetime_
2726

2827
from typing_extensions import Literal
2928

@@ -641,7 +640,7 @@ def _format_currency_long_name(
641640

642641

643642
def format_compact_currency(number: float | decimal.Decimal | str,
644-
currency: str, *, format_type: Literal["short", "long"] = "short",
643+
currency: str, *, format_type: Literal["short"] = "short",
645644
locale: Locale | str | None = LC_NUMERIC, fraction_digits: int = 0) -> str:
646645
u"""Format a number as a currency value in compact form.
647646

babel/support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def currency(self, number: float | decimal.Decimal | str, currency: str) -> str:
136136
return format_currency(number, currency, locale=self.locale)
137137

138138
def compact_currency(self, number: float | decimal.Decimal | str, currency: str,
139-
format_type: Literal['short', 'long'] = 'short', fraction_digits: int = 0) -> str:
139+
format_type: Literal["short"] = 'short', fraction_digits: int = 0) -> str:
140140
"""Return a number in the given currency formatted for the locale
141141
using the compact number format.
142142
"""

0 commit comments

Comments
 (0)