Skip to content

Commit 0207a34

Browse files
committed
typing: Type hints for pyright
Without this, pyright assumes the return type of Bottle.app('/') can be ModuleType.
1 parent b1bd8bb commit 0207a34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bottle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,8 @@ def hello(name):
878878
skiplist = makelist(skip)
879879

880880
def decorator(callback):
881-
if isinstance(callback, str): callback = load(callback)
881+
if isinstance(callback, str):
882+
callback = load(callback) # type: Callable
882883
for rule in makelist(path) or yieldroutes(callback):
883884
for verb in makelist(method):
884885
verb = verb.upper()

0 commit comments

Comments
 (0)