Fixed type hints

This commit is contained in:
Edward Betts 2023-11-04 21:35:33 +00:00
parent cde9d09eb0
commit ea2f172388

View file

@ -3,8 +3,8 @@
import random import random
import typing import typing
import sqlalchemy
from flask import Flask, jsonify, redirect, render_template, request, url_for from flask import Flask, jsonify, redirect, render_template, request, url_for
from sqlalchemy.orm.query import Query
from werkzeug.wrappers import Response from werkzeug.wrappers import Response
import geocode import geocode
@ -16,7 +16,6 @@ app.config.from_object("config.default")
database.init_app(app) database.init_app(app)
Tags = typing.Mapping[str, str] Tags = typing.Mapping[str, str]
Elements = sqlalchemy.orm.query.Query[model.Polygon]
def get_random_lat_lon() -> tuple[float, float]: def get_random_lat_lon() -> tuple[float, float]:
@ -32,7 +31,7 @@ def get_random_lat_lon() -> tuple[float, float]:
def do_lookup( def do_lookup(
elements: Elements, lat: str | float, lon: str | float elements: "Query[model.Polygon]", lat: str | float, lon: str | float
) -> wikidata.WikidataDict: ) -> wikidata.WikidataDict:
"""Do lookup.""" """Do lookup."""
try: try:
@ -125,7 +124,7 @@ def hit_from_name(
def osm_lookup( def osm_lookup(
elements: Elements, lat: str | float, lon: str | float elements: "Query[model.Polygon]", lat: str | float, lon: str | float
) -> wikidata.Hit | None: ) -> wikidata.Hit | None:
"""OSM lookup.""" """OSM lookup."""
ret: wikidata.Hit | None ret: wikidata.Hit | None