mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Move opcode to 2and3 (#938)
* Move opcode to 2and3 * Fix python3 versions * Fix tests * Bring Dict back
This commit is contained in:
committed by
Łukasz Langa
parent
1260d41cd1
commit
e3fb935ca4
@@ -1,11 +1,18 @@
|
||||
from typing import List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict
|
||||
|
||||
from opcode import (hasconst, hasname, hasjrel, hasjabs, haslocal, hascompare,
|
||||
hasfree, hasnargs, cmp_op, opname, opmap, HAVE_ARGUMENT,
|
||||
EXTENDED_ARG, stack_effect)
|
||||
|
||||
import sys
|
||||
import types
|
||||
|
||||
from opcode import (hasconst, hasname, hasjrel, hasjabs, haslocal, hascompare,
|
||||
hasfree, cmp_op, opname, opmap, HAVE_ARGUMENT,
|
||||
EXTENDED_ARG)
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
from opcode import stack_effect
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from opcode import hasnargs
|
||||
|
||||
_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type]
|
||||
_have_code_or_string = Union[_have_code, str, bytes]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user