Skip to content

Commit 53be87b

Browse files
authored
Resolve some stubtest allowlist entries by marking params as keyword-only (#12581)
1 parent 073b270 commit 53be87b

File tree

6 files changed

+7
-14
lines changed

6 files changed

+7
-14
lines changed

stubs/caldav/@tests/stubtest_allowlist.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
# **kwargs replaced with actual arguments in stubs
2-
caldav.DAVClient.calendar
1+
# Passes its *args after a kwarg, which is a SyntaxError, so we allow kwargs only
32
caldav.DAVClient.principal
4-
caldav.davclient.DAVClient.calendar
53
caldav.davclient.DAVClient.principal
64

75
# Initialized in class, but immediately overwritten in __init__

stubs/caldav/caldav/davclient.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ class DAVClient:
5858
def __exit__(
5959
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
6060
) -> None: ...
61-
def principal(self, *, url: str | ParseResult | SplitResult | URL | None = ...) -> Principal: ...
61+
def principal(self, *, url: str | ParseResult | SplitResult | URL | None = None) -> Principal: ...
6262
def calendar(
6363
self,
64+
*,
6465
url: str | ParseResult | SplitResult | URL | None = ...,
6566
parent: DAVObject | None = ...,
6667
name: str | None = ...,

stubs/pyasn1/@tests/stubtest_allowlist.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,3 @@ pyasn1.codec.native.encoder.SetEncoder.protoDict
55
# Attempted "__ne__" operation on ASN.1 schema object
66
pyasn1.type.base
77
pyasn1.type.univ
8-
9-
# Specifying kwargs
10-
pyasn1.codec.ber.decoder.Decoder.__call__
11-
pyasn1.codec.ber.decoder.StreamingDecoder.__init__
12-
pyasn1.codec.native.decoder.Decoder.__init__
13-
pyasn1.codec.native.encoder.Encoder.__init__

stubs/pyasn1/pyasn1/codec/ber/decoder.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,11 @@ decode: Decoder
346346
class StreamingDecoder:
347347
SINGLE_ITEM_DECODER: type[SingleItemDecoder]
348348

349-
def __init__(self, substrate, asn1Spec=None, tagMap=..., typeMap=..., **ignored: Unused) -> None: ...
349+
def __init__(self, substrate, asn1Spec=None, *, tagMap=..., typeMap=..., **ignored: Unused) -> None: ...
350350
def __iter__(self): ...
351351

352352
class Decoder:
353353
STREAMING_DECODER: type[StreamingDecoder]
354354

355355
@classmethod
356-
def __call__(cls, substrate, asn1Spec=None, tagMap=..., typeMap=..., **ignored: Unused): ...
356+
def __call__(cls, substrate, asn1Spec=None, *, tagMap=..., typeMap=..., **ignored: Unused): ...

stubs/pyasn1/pyasn1/codec/native/decoder.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SingleItemDecoder:
3636
class Decoder:
3737
SINGLE_ITEM_DECODER: type[SingleItemDecoder]
3838

39-
def __init__(self, tagMap=..., typeMap=..., **options: Unused) -> None: ...
39+
def __init__(self, *, tagMap=..., typeMap=..., **options: Unused) -> None: ...
4040
def __call__(self, pyObject, asn1Spec=None, **kwargs): ...
4141

4242
decode: Decoder

stubs/pyasn1/pyasn1/codec/native/encoder.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SingleItemEncoder:
6565
class Encoder:
6666
SINGLE_ITEM_ENCODER: type[SingleItemEncoder]
6767

68-
def __init__(self, tagMap=..., typeMap=..., **options: Unused): ...
68+
def __init__(self, *, tagMap=..., typeMap=..., **options: Unused): ...
6969
def __call__(self, pyObject, asn1Spec=None, **options): ...
7070

7171
encode: SingleItemEncoder

0 commit comments

Comments
 (0)