From 233b4ee331cec4cfcb4ffd34621ddffdb79ff746 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Wed, 11 Aug 2021 17:07:32 +0000 Subject: [PATCH] Fixed static typing omissions in Python code. --- python/qrcodegen-demo.py | 1 + python/qrcodegen.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/qrcodegen-demo.py b/python/qrcodegen-demo.py index ef6c098..6b69f35 100644 --- a/python/qrcodegen-demo.py +++ b/python/qrcodegen-demo.py @@ -24,6 +24,7 @@ # Software. # +from typing import List from qrcodegen import QrCode, QrSegment diff --git a/python/qrcodegen.py b/python/qrcodegen.py index dba11ca..3304cd3 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -817,7 +817,7 @@ class QrSegment: # Package-private function @staticmethod - def get_total_bits(segs, version: int) -> Optional[int]: + def get_total_bits(segs: Sequence[QrSegment], version: int) -> Optional[int]: """Calculates the number of bits needed to encode the given segments at the given version. Returns a non-negative number if successful. Otherwise returns None if a segment has too many characters to fit its length field."""