for anyone else who's looking for something like that:
at first: Python has datatypes but overwriting them is possible, the encapsulation of attributes in classes is not given like in other languages.
you can give a var a 'preset' type to get a warning during programming.
For example:
on module level/below your includes you define a global variable, let say some connection handler
from <CustomClassLib> import <CustomClass>
clientHandler: <CustomClass> = None # set type and assign as None
now you have a variable with a preset type that starts with None. on function level - let's say in your main function - you define it like:
def main():
global clientHandler # introduce as global
clientHandler = <CustomClass>() # instantiate object and assign
if __name__ == "__main__":
main()
Hope that makes sense for you ? Kind regards :)