-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[internal] Micropython Kompatibilität: Fallback für typing Modul hinz…
…ugefügt Micropython bietet kein typing Modul (ist in Arbeit, siehe micropython/micropython-lib#584). Stattdessen wird ein Mock benutzt. CUST-234
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import sys | ||
|
||
|
||
class _Mock: | ||
def __getattr__(self, item): | ||
return self | ||
|
||
def __getitem__(self, item): | ||
return self | ||
|
||
def __or__(self, other): | ||
return other | ||
|
||
def __ror__(self, other): | ||
return other | ||
|
||
|
||
def mock_module(module_name: str) -> None: | ||
sys.modules[module_name] = _Mock() # type: ignore |