Skip to content

Commit f8aeaaf

Browse files
sumansebastinas
suman
authored andcommitted
Add type annotations
1 parent 2329450 commit f8aeaaf

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

bpdb/debugger.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@
2727
class BPdb(pdb.Pdb):
2828
"""PDB with BPython support."""
2929

30-
def __init__(self, *args, **kwargs):
30+
def __init__(self, *args, **kwargs) -> None:
3131
super().__init__(*args, **kwargs)
3232
self.prompt = "(BPdb) "
3333
self.intro = 'Use "B" to enter bpython, Ctrl-d to exit it.'
3434

35-
def postloop(self):
35+
def postloop(self) -> None:
3636
# We only want to show the intro message once.
3737
self.intro = None
3838
super().postloop()
3939

4040
# cmd.Cmd commands
4141

42-
def do_Bpython(self, arg):
42+
def do_Bpython(self, arg: str) -> None:
4343
locals_ = self.curframe.f_globals.copy()
4444
locals_.update(self.curframe.f_locals)
4545
bpython.embed(locals_, ["-i"])
4646

47-
def help_Bpython(self):
47+
def help_Bpython(self) -> None:
4848
print("B(python)")
4949
print("")
5050
print(

bpython/args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import os
3737
import sys
3838
from pathlib import Path
39-
from typing import Tuple, List, Optional, Never, Callable
39+
from typing import Tuple, List, Optional, NoReturn, Callable
4040
from types import ModuleType
4141

4242
from . import __version__, __copyright__
@@ -51,7 +51,7 @@ class ArgumentParserFailed(ValueError):
5151

5252

5353
class RaisingArgumentParser(argparse.ArgumentParser):
54-
def error(self, msg: str) -> Never:
54+
def error(self, msg: str) -> NoReturn:
5555
raise ArgumentParserFailed()
5656

5757

bpython/urwid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@
7676
class EvalProtocol(basic.LineOnlyReceiver):
7777
delimiter = "\n"
7878

79-
def __init__(self, myrepl):
79+
def __init__(self, myrepl) -> None:
8080
self.repl = myrepl
8181

82-
def lineReceived(self, line):
82+
def lineReceived(self, line) -> None:
8383
# HACK!
8484
# TODO: deal with encoding issues here...
8585
self.repl.main_loop.process_input(line)

0 commit comments

Comments
 (0)