Cleanup: fix mypy errors

This mostly handles a mypy change where implicit optionals (i.e. things
like `size: int = None`) are no longer allowed.

No functional changes.
This commit is contained in:
Sybren A. Stüvel
2023-11-02 14:46:38 +01:00
parent b3fb7845c3
commit f9bc6f2d08
7 changed files with 26 additions and 10 deletions
+2 -1
View File
@@ -22,6 +22,7 @@
import logging
import os
import typing
from typing import Optional
from . import header, exceptions
@@ -104,7 +105,7 @@ class Struct:
log = log.getChild("Struct")
def __init__(self, dna_type_id: bytes, size: int = None) -> None:
def __init__(self, dna_type_id: bytes, size: Optional[int] = None) -> None:
"""
:param dna_type_id: name of the struct in C, like b'AlembicObjectPath'.
:param size: only for unit tests; typically set after construction by