Skip to content

Commit c6a72c7

Browse files
projectgusdpgeorge
authored andcommitted
cbor2: Improve decoder to pass Ruff F821 undefined-name.
These were probably intentional missing names, however raising NotImplementedError or KeyError is more explicit than trying to call an unknown function. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 parent 786c0ea commit c6a72c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python-ecosys/cbor2/cbor2/decoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def decode_simple_value(decoder):
160160

161161
def decode_float16(decoder):
162162
payload = decoder.read(2)
163-
return unpack_float16(payload)
163+
raise NotImplementedError # no float16 unpack function
164164

165165

166166
def decode_float32(decoder):
@@ -185,7 +185,7 @@ def decode_float64(decoder):
185185
20: lambda self: False,
186186
21: lambda self: True,
187187
22: lambda self: None,
188-
23: lambda self: undefined,
188+
# 23 is undefined
189189
24: decode_simple_value,
190190
25: decode_float16,
191191
26: decode_float32,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy