if anvil.server.context.type != 'browser':
# running on server
from typing import List, Optional, Union, Tuple, Dict
And this for the server modules:
if anvil.server.context.type == 'uplink':
# running tests on pc
from client_code.Status import Status
else:
# running on Anvil server
from .Status import Status
EDIT
I just realized that you use the comments for type hinting with PyCharm.
You don’t need to use comments, you can use the standard Python syntax.
Skulpt doesn’t import typing, but doesn’t do anything with the type hints, perhaps the parser just ignores them. I just checked one of my apps and these are two lines from a module imported both on the client and on the server side:
The typing module would be a nice addition client side.
As a workaround you can create a temporary solution for when your anvil code is running in the browser.
Pycharm has its own in-built type checker that can use Python 2 mypy conventions. This is perfect for type checking the client side code. See PyCharm type checking. I have been using this feature and it has helped a lot.