From ea2f17238891026944c67289f9dd9731e6c4d74a Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 4 Nov 2023 21:35:33 +0000 Subject: [PATCH] Fixed type hints --- lookup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lookup.py b/lookup.py index c63fe5a..487735b 100755 --- a/lookup.py +++ b/lookup.py @@ -3,8 +3,8 @@ import random import typing -import sqlalchemy from flask import Flask, jsonify, redirect, render_template, request, url_for +from sqlalchemy.orm.query import Query from werkzeug.wrappers import Response import geocode @@ -16,7 +16,6 @@ app.config.from_object("config.default") database.init_app(app) Tags = typing.Mapping[str, str] -Elements = sqlalchemy.orm.query.Query[model.Polygon] def get_random_lat_lon() -> tuple[float, float]: @@ -32,7 +31,7 @@ def get_random_lat_lon() -> tuple[float, float]: def do_lookup( - elements: Elements, lat: str | float, lon: str | float + elements: "Query[model.Polygon]", lat: str | float, lon: str | float ) -> wikidata.WikidataDict: """Do lookup.""" try: @@ -125,7 +124,7 @@ def hit_from_name( def osm_lookup( - elements: Elements, lat: str | float, lon: str | float + elements: "Query[model.Polygon]", lat: str | float, lon: str | float ) -> wikidata.Hit | None: """OSM lookup.""" ret: wikidata.Hit | None