From 5c48d14d95b46caa10bcdbd80aec1ae04ec7f225 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 19 May 2021 22:00:02 +0300 Subject: db: phenotypes: Add type for Dataclass See: https://www.py4u.net/discuss/188952 --- gn3/db/phenotypes.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gn3') diff --git a/gn3/db/phenotypes.py b/gn3/db/phenotypes.py index be5fb7b..e97322a 100644 --- a/gn3/db/phenotypes.py +++ b/gn3/db/phenotypes.py @@ -3,9 +3,16 @@ the db""" from dataclasses import dataclass, asdict, astuple -from typing import Any, Optional +from typing import Any, Dict, Optional from MySQLdb import escape_string +from typing_extensions import Protocol + + +class Dataclass(Protocol): + """Type Definition for a Dataclass""" + __dataclass_fields__: Dict + @dataclass(frozen=True) class Phenotype: -- cgit v1.2.3