1
0
forked from VimPlug/jedi

Remove some more Python 3.5 references

This commit is contained in:
Dave Halter
2020-07-02 02:13:06 +02:00
parent 182e1e864c
commit 17343bb57c
9 changed files with 52 additions and 95 deletions

View File

@@ -133,48 +133,6 @@ weakref.ref(1)
#? int() None
weakref.ref(1)()
# -----------------
# functools
# -----------------
import functools
basetwo = functools.partial(int, base=2)
#? int()
basetwo()
def function(a, b):
return a, b
a = functools.partial(function, 0)
#? int()
a('')[0]
#? str()
a('')[1]
kw = functools.partial(function, b=1.0)
tup = kw(1)
#? int()
tup[0]
#? float()
tup[1]
def my_decorator(f):
@functools.wraps(f)
def wrapper(*args, **kwds):
return f(*args, **kwds)
return wrapper
@my_decorator
def example(a):
return a
#? str()
example('')
# From GH #1574
#? float()
functools.wraps(functools.partial(str, 1))(lambda: 1.0)()
# -----------------
# sqlite3 (#84)
# -----------------
@@ -386,8 +344,47 @@ X().name
X().attr_x.attr_y.value
# -----------------
# functools Python 3.5+
# functools
# -----------------
import functools
basetwo = functools.partial(int, base=2)
#? int()
basetwo()
def function(a, b):
return a, b
a = functools.partial(function, 0)
#? int()
a('')[0]
#? str()
a('')[1]
kw = functools.partial(function, b=1.0)
tup = kw(1)
#? int()
tup[0]
#? float()
tup[1]
def my_decorator(f):
@functools.wraps(f)
def wrapper(*args, **kwds):
return f(*args, **kwds)
return wrapper
@my_decorator
def example(a):
return a
#? str()
example('')
# From GH #1574
#? float()
functools.wraps(functools.partial(str, 1))(lambda: 1.0)()
class X:
def function(self, a, b):
return a, b
@@ -440,11 +437,6 @@ X().just_partial('')[0]
#? str()
X().just_partial('')[1]
# -----------------
# functools Python 3.8
# -----------------
# python >= 3.8
@functools.lru_cache