Skip to content

Commit f8ce916

Browse files
committed
Mark optional arguments as optional
1 parent 5629bbe commit f8ce916

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

bpython/curtsiesfrontend/interpreter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from typing import Any, Dict
2+
from typing import Any, Dict, Optional
33

44
from pygments.token import Generic, Token, Keyword, Name, Comment, String
55
from pygments.token import Error, Literal, Number, Operator, Punctuation
@@ -60,7 +60,11 @@ def format(self, tokensource, outfile):
6060

6161

6262
class Interp(ReplInterpreter):
63-
def __init__(self, locals: Dict[str, Any] = None, encoding=None):
63+
def __init__(
64+
self,
65+
locals: Optional[Dict[str, Any]] = None,
66+
encoding: Optional[str] = None,
67+
) -> None:
6468
"""Constructor.
6569
6670
We include an argument for the outfile to pass to the formatter for it

bpython/curtsiesfrontend/repl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ class BaseRepl(Repl):
312312
def __init__(
313313
self,
314314
config: Config,
315-
locals_: Dict[str, Any] = None,
316-
banner: str = None,
317-
interp: code.InteractiveInterpreter = None,
318-
orig_tcattrs: List[Any] = None,
315+
locals_: Optional[Dict[str, Any]] = None,
316+
banner: Optional[str] = None,
317+
interp: Optional[code.InteractiveInterpreter] = None,
318+
orig_tcattrs: Optional[List[Any]] = None,
319319
):
320320
"""
321321
locals_ is a mapping of locals to pass into the interpreter

0 commit comments

Comments
 (0)