From d16fab88623298f4fddf702fdd6c332219900d83 Mon Sep 17 00:00:00 2001 From: Craig Roy Date: Fri, 17 May 2024 12:04:05 +0100 Subject: [PATCH] fix: pyright fixes --- docs/build.sh | 2 ++ guppylang/definition/common.py | 12 ++++-------- guppylang/definition/declaration.py | 2 +- guppylang/tys/var.py | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/build.sh b/docs/build.sh index 66bde126..ff202cc9 100755 --- a/docs/build.sh +++ b/docs/build.sh @@ -1,3 +1,5 @@ +#!/bin/sh + mkdir build touch build/.nojekyll # Disable jekyll to keep files starting with underscores diff --git a/guppylang/definition/common.py b/guppylang/definition/common.py index 9a5cf561..71fd3ddd 100644 --- a/guppylang/definition/common.py +++ b/guppylang/definition/common.py @@ -49,14 +49,10 @@ class Definition(ABC): name: str defined_at: ast.AST | None - @property - @abstractmethod - def description(self) -> str: - """Description of this definition to be used in messages to the user. - - The returned text should fit into messages of the following form: "expected - a function, but got {description of this definition} instead". - """ + # Description of this definition to be used in messages to the user. + # The returned text should fit into messages of the following form: "expected + # a function, but got {description of this definition} instead". + description: str class ParsableDef(Definition): diff --git a/guppylang/definition/declaration.py b/guppylang/definition/declaration.py index 13ccc06a..588599ef 100644 --- a/guppylang/definition/declaration.py +++ b/guppylang/definition/declaration.py @@ -66,7 +66,7 @@ def synthesize_call( return node, ty def compile_outer(self, graph: Hugr, parent: Node) -> "CompiledFunctionDecl": - """Adds a Hugr `FuncDecl` node for this funciton to the Hugr.""" + """Adds a Hugr `FuncDecl` node for this function to the Hugr.""" node = graph.add_declare(self.ty, parent, self.name) return CompiledFunctionDecl( self.id, self.name, self.defined_at, self.ty, self.python_func, node diff --git a/guppylang/tys/var.py b/guppylang/tys/var.py index 43555d6f..fc332304 100644 --- a/guppylang/tys/var.py +++ b/guppylang/tys/var.py @@ -4,7 +4,7 @@ from dataclasses import dataclass from typing import ClassVar -# Type of de Bruijn indicies +# Type of de Bruijn indices DeBruijn = int # Type of unique variable identifiers