Skip to content

Commit 901a1ff

Browse files
Add Catalan (preview quality) (#88)
1 parent 650ffe6 commit 901a1ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+11085
-1
lines changed

crowdin/translated/api.ca.json

Lines changed: 5258 additions & 0 deletions
Large diffs are not rendered by default.

lang/ca/typeshed/stdlib/VERSIONS

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# The structure of this file is as follows:
2+
# - Blank lines and comments starting with `#` are ignored.
3+
# - Lines contain the name of a module, followed by a colon,
4+
# a space, and a version range (for example: `symbol: 2.7-3.9`).
5+
#
6+
# Version ranges may be of the form "X.Y-A.B" or "X.Y-". The
7+
# first form means that a module was introduced in version X.Y and last
8+
# available in version A.B. The second form means that the module was
9+
# introduced in version X.Y and is still available in the latest
10+
# version of Python.
11+
#
12+
# If a submodule is not listed separately, it has the same lifetime as
13+
# its parent module.
14+
#
15+
# Python versions before 2.7 are ignored, so any module that was already
16+
# present in 2.7 will have "2.7" as its minimum version. Version ranges
17+
# for unsupported versions of Python 3 (currently 3.5 and lower) are
18+
# generally accurate but we do not guarantee their correctness.
19+
20+
antigravity: 3.0-
21+
array: 3.0-
22+
audio: 3.0-
23+
builtins: 3.0-
24+
errno: 3.0-
25+
gc: 3.0-
26+
love: 3.0-
27+
machine: 3.0-
28+
math: 3.0-
29+
microbit: 3.0-
30+
micropython: 3.0-
31+
music: 3.0-
32+
neopixel: 3.0-
33+
os: 3.0-
34+
radio: 3.0-
35+
random: 3.0-
36+
speech: 3.0-
37+
struct: 3.0-
38+
sys: 3.0-
39+
this: 3.0-
40+
time: 3.0-
41+
typing_extensions: 3.0-
42+
typing: 3.0-
43+
uarray: 3.0-
44+
ucollections: 3.0-
45+
uerrno: 3.0-
46+
uos: 3.0-
47+
urandom: 3.0-
48+
ustruct: 3.0-
49+
usys: 3.0-
50+
utime: 3.0-
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Utility types for typeshed
2+
#
3+
# See the README.md file in this directory for more information.
4+
5+
import array
6+
import sys
7+
from os import PathLike
8+
from typing import AbstractSet, Any, Container, Iterable, Protocol, Tuple, TypeVar, Union
9+
from typing_extensions import Literal, final
10+
11+
_KT = TypeVar("_KT")
12+
_KT_co = TypeVar("_KT_co", covariant=True)
13+
_KT_contra = TypeVar("_KT_contra", contravariant=True)
14+
_VT = TypeVar("_VT")
15+
_VT_co = TypeVar("_VT_co", covariant=True)
16+
_T = TypeVar("_T")
17+
_T_co = TypeVar("_T_co", covariant=True)
18+
_T_contra = TypeVar("_T_contra", contravariant=True)
19+
20+
# Use for "self" annotations:
21+
# def __enter__(self: Self) -> Self: ...
22+
Self = TypeVar("Self") # noqa Y001
23+
24+
# stable
25+
class IdentityFunction(Protocol):
26+
def __call__(self, __x: _T) -> _T: ...
27+
28+
class SupportsLessThan(Protocol):
29+
def __lt__(self, __other: Any) -> bool: ...
30+
31+
SupportsLessThanT = TypeVar("SupportsLessThanT", bound=SupportsLessThan) # noqa: Y001
32+
33+
class SupportsDivMod(Protocol[_T_contra, _T_co]):
34+
def __divmod__(self, __other: _T_contra) -> _T_co: ...
35+
36+
class SupportsRDivMod(Protocol[_T_contra, _T_co]):
37+
def __rdivmod__(self, __other: _T_contra) -> _T_co: ...
38+
39+
class SupportsLenAndGetItem(Protocol[_T_co]):
40+
def __len__(self) -> int: ...
41+
def __getitem__(self, __k: int) -> _T_co: ...
42+
43+
# Mapping-like protocols
44+
45+
# stable
46+
class SupportsItems(Protocol[_KT_co, _VT_co]):
47+
def items(self) -> AbstractSet[Tuple[_KT_co, _VT_co]]: ...
48+
49+
# stable
50+
class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]):
51+
def keys(self) -> Iterable[_KT]: ...
52+
def __getitem__(self, __k: _KT) -> _VT_co: ...
53+
54+
# stable
55+
class SupportsGetItem(Container[_KT_contra], Protocol[_KT_contra, _VT_co]):
56+
def __getitem__(self, __k: _KT_contra) -> _VT_co: ...
57+
58+
# stable
59+
class SupportsItemAccess(SupportsGetItem[_KT_contra, _VT], Protocol[_KT_contra, _VT]):
60+
def __setitem__(self, __k: _KT_contra, __v: _VT) -> None: ...
61+
def __delitem__(self, __v: _KT_contra) -> None: ...
62+
63+
# These aliases are simple strings in Python 2.
64+
StrPath = Union[str, PathLike[str]] # stable
65+
BytesPath = Union[bytes, PathLike[bytes]] # stable
66+
StrOrBytesPath = Union[str, bytes, PathLike[str], PathLike[bytes]] # stable
67+
68+
OpenTextModeUpdating = Literal[
69+
"r+",
70+
"+r",
71+
"rt+",
72+
"r+t",
73+
"+rt",
74+
"tr+",
75+
"t+r",
76+
"+tr",
77+
"w+",
78+
"+w",
79+
"wt+",
80+
"w+t",
81+
"+wt",
82+
"tw+",
83+
"t+w",
84+
"+tw",
85+
"a+",
86+
"+a",
87+
"at+",
88+
"a+t",
89+
"+at",
90+
"ta+",
91+
"t+a",
92+
"+ta",
93+
"x+",
94+
"+x",
95+
"xt+",
96+
"x+t",
97+
"+xt",
98+
"tx+",
99+
"t+x",
100+
"+tx",
101+
]
102+
OpenTextModeWriting = Literal["w", "wt", "tw", "a", "at", "ta", "x", "xt", "tx"]
103+
OpenTextModeReading = Literal["r", "rt", "tr", "U", "rU", "Ur", "rtU", "rUt", "Urt", "trU", "tUr", "Utr"]
104+
OpenTextMode = Union[OpenTextModeUpdating, OpenTextModeWriting, OpenTextModeReading]
105+
OpenBinaryModeUpdating = Literal[
106+
"rb+",
107+
"r+b",
108+
"+rb",
109+
"br+",
110+
"b+r",
111+
"+br",
112+
"wb+",
113+
"w+b",
114+
"+wb",
115+
"bw+",
116+
"b+w",
117+
"+bw",
118+
"ab+",
119+
"a+b",
120+
"+ab",
121+
"ba+",
122+
"b+a",
123+
"+ba",
124+
"xb+",
125+
"x+b",
126+
"+xb",
127+
"bx+",
128+
"b+x",
129+
"+bx",
130+
]
131+
OpenBinaryModeWriting = Literal["wb", "bw", "ab", "ba", "xb", "bx"]
132+
OpenBinaryModeReading = Literal["rb", "br", "rbU", "rUb", "Urb", "brU", "bUr", "Ubr"]
133+
OpenBinaryMode = Union[OpenBinaryModeUpdating, OpenBinaryModeReading, OpenBinaryModeWriting]
134+
135+
# stable
136+
class HasFileno(Protocol):
137+
def fileno(self) -> int: ...
138+
139+
FileDescriptor = int # stable
140+
FileDescriptorLike = Union[int, HasFileno] # stable
141+
142+
# stable
143+
class SupportsRead(Protocol[_T_co]):
144+
def read(self, __length: int = ...) -> _T_co: ...
145+
146+
# stable
147+
class SupportsReadline(Protocol[_T_co]):
148+
def readline(self, __length: int = ...) -> _T_co: ...
149+
150+
# stable
151+
class SupportsNoArgReadline(Protocol[_T_co]):
152+
def readline(self) -> _T_co: ...
153+
154+
# stable
155+
class SupportsWrite(Protocol[_T_contra]):
156+
def write(self, __s: _T_contra) -> Any: ...
157+
158+
ReadableBuffer = Union[bytes, bytearray, memoryview, array.array[Any]] # stable
159+
WriteableBuffer = Union[bytearray, memoryview, array.array[Any]] # stable
160+
161+
# stable
162+
if sys.version_info >= (3, 10):
163+
from types import NoneType as NoneType
164+
else:
165+
# Used by type checkers for checks involving None (does not exist at runtime)
166+
@final
167+
class NoneType:
168+
def __bool__(self) -> Literal[False]: ...

lang/ca/typeshed/stdlib/abc.pyi

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from _typeshed import SupportsWrite
2+
from typing import Any, Callable, Tuple, Type, TypeVar
3+
4+
_T = TypeVar("_T")
5+
_FuncT = TypeVar("_FuncT", bound=Callable[..., Any])
6+
7+
# These definitions have special processing in mypy
8+
class ABCMeta(type):
9+
__abstractmethods__: frozenset[str]
10+
def __init__(
11+
self, name: str, bases: Tuple[type, ...], namespace: dict[str, Any]
12+
) -> None: ...
13+
def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ...
14+
def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ...
15+
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = ...) -> None: ...
16+
def register(cls: ABCMeta, subclass: Type[_T]) -> Type[_T]: ...
17+
18+
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...
19+
20+
class abstractproperty(property): ...
21+
22+
# These two are deprecated and not supported by mypy
23+
def abstractstaticmethod(callable: _FuncT) -> _FuncT: ...
24+
def abstractclassmethod(callable: _FuncT) -> _FuncT: ...
25+
26+
class ABC(metaclass=ABCMeta): ...
27+
28+
def get_cache_token() -> object: ...

lang/ca/typeshed/stdlib/antigravity.pyi

Whitespace-only changes.

lang/ca/typeshed/stdlib/array.pyi

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from typing import Generic, Iterable, MutableSequence, TypeVar, Union, overload
2+
from typing_extensions import Literal
3+
4+
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
5+
_FloatTypeCode = Literal["f", "d"]
6+
_TypeCode = Union[_IntTypeCode, _FloatTypeCode]
7+
8+
_T = TypeVar("_T", int, float)
9+
10+
class array(MutableSequence[_T], Generic[_T]):
11+
@overload
12+
def __init__(
13+
self: array[int],
14+
typecode: _IntTypeCode,
15+
__initializer: Union[bytes, Iterable[_T]] = ...,
16+
) -> None: ...
17+
@overload
18+
def __init__(
19+
self: array[float],
20+
typecode: _FloatTypeCode,
21+
__initializer: Union[bytes, Iterable[_T]] = ...,
22+
) -> None: ...
23+
@overload
24+
def __init__(
25+
self, typecode: str, __initializer: Union[bytes, Iterable[_T]] = ...
26+
) -> None: ...
27+
def append(self, __v: _T) -> None: ...
28+
def decode(self) -> str: ...
29+
def extend(self, __bb: Iterable[_T]) -> None: ...
30+
def __len__(self) -> int: ...
31+
@overload
32+
def __getitem__(self, i: int) -> _T: ...
33+
@overload
34+
def __getitem__(self, s: slice) -> array[_T]: ...
35+
@overload # type: ignore # Overrides MutableSequence
36+
def __setitem__(self, i: int, o: _T) -> None: ...
37+
@overload
38+
def __setitem__(self, s: slice, o: array[_T]) -> None: ...
39+
def __add__(self, x: array[_T]) -> array[_T]: ...
40+
def __iadd__(self, x: array[_T]) -> array[_T]: ... # type: ignore # Overrides MutableSequence
41+
42+
ArrayType = array

lang/ca/typeshed/stdlib/audio.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""Play sounds using the micro:bit (import ``audio`` for V1 compatibility).
2+
"""
3+
4+
# Re-export for V1 compatibility.
5+
from .microbit.audio import (
6+
is_playing as is_playing,
7+
play as play,
8+
stop as stop,
9+
AudioFrame as AudioFrame,
10+
SoundEffect as SoundEffect,
11+
)

0 commit comments

Comments
 (0)