0

Just like the title says, how can i specify the class instead of a class object?

imagine this:

 class TestClass:
     def __init__(self):
         pass
 tclass_blueprint:<what?> = TestClass # Not the this is not an object, no parenthesis.

I am trying to type hint a dictionary like so

from FileHandler import FileHandler
import dot_csv, dot_json

FILE_TYPES:dict[str, <what?>] = {
    ".csv": dot_csv.FHandler,
    ".json": dot_csv.FHandler
}

Where FileHandler is just a container. (think of it as an interface in java?)

dot_csv.FHandler and dot_json.FHandler are classes that have different implementations of some methods, but follow the schemantic of FileHandler.FileHandler.

I want the type-hinting to point to FileHandler.FileHandler as both of those classes descend from that. (FileHandler.FileHandler is the parent).

Instead, the type is automatically assigned to Unknown

0 Answers0