Skip to content

Commit

Permalink
type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Jun 9, 2022
1 parent c106df8 commit 3656974
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions nbformat/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pprint
import warnings
from copy import deepcopy
from typing import Any, Optional

from ._imports import import_item
from .corpus.words import generate_corpus_id
Expand Down Expand Up @@ -247,7 +248,13 @@ def better_validation_error(error, version, version_minor):
return NotebookValidationError(error, ref)


def normalize(nbdict, version=None, version_minor=None, *, relax_add_props: bool = False):
def normalize(
nbdict: Any,
version: Optional[int] = None,
version_minor: Optional[int] = None,
*,
relax_add_props: bool = False,
) -> Any:
"""
Normalise a notebook prior to validation.
Expand Down Expand Up @@ -414,7 +421,7 @@ def validate(
raise error


def _try_fix_error(nbdict, version: int, version_minor: int, relax_add_props: bool) -> int:
def _try_fix_error(nbdict: Any, version: int, version_minor: int, relax_add_props: bool) -> int:
"""
This function try to extract errors from the validator
and fix them if necessary.
Expand Down

0 comments on commit 3656974

Please sign in to comment.