2024-10-16 06:42:42 +00:00
|
|
|
import lazy_import
|
|
|
|
from typing import List
|
|
|
|
import collections.abc
|
|
|
|
from collections.abc import Callable
|
2024-10-17 04:43:13 +00:00
|
|
|
from collections import ChainMap as cm
|
2024-10-16 06:42:42 +00:00
|
|
|
|
|
|
|
mod_variable = 10
|
|
|
|
|
|
|
|
def test_imports_are_lazy():
|
|
|
|
re.match('hell ya', 'hell ya')
|
|
|
|
typing.List
|
|
|
|
|
|
|
|
def test_regular_names_still_work():
|
|
|
|
assert mod_variable == 10
|
|
|
|
x = 20
|
|
|
|
assert x == 20
|
|
|
|
|
|
|
|
def afunc(y):
|
|
|
|
z = 10
|
|
|
|
assert z == 10
|
|
|
|
assert y == 30
|
|
|
|
|
|
|
|
afunc(30)
|
|
|
|
|
|
|
|
def test_names_are_lazy():
|
|
|
|
"""
|
|
|
|
you can just use the last unique segment
|
|
|
|
"""
|
2024-10-17 04:43:13 +00:00
|
|
|
_ = random.randint(1, 10)
|
|
|
|
_ = randint(1, 10)
|
2024-10-16 06:42:42 +00:00
|
|
|
|
2024-10-17 04:43:13 +00:00
|
|
|
assert randint is random.randint
|