mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Added tests for random.choice
This commit is contained in:
@@ -18,11 +18,11 @@ next(reversed(arr))
|
|||||||
def yielder():
|
def yielder():
|
||||||
yield None
|
yield None
|
||||||
|
|
||||||
#?
|
#?
|
||||||
next(reversed(yielder()))
|
next(reversed(yielder()))
|
||||||
|
|
||||||
# empty reversed should not raise an error
|
# empty reversed should not raise an error
|
||||||
#?
|
#?
|
||||||
next(reversed())
|
next(reversed())
|
||||||
|
|
||||||
#? str()
|
#? str()
|
||||||
@@ -140,7 +140,7 @@ import copy
|
|||||||
#? int()
|
#? int()
|
||||||
copy.deepcopy(1)
|
copy.deepcopy(1)
|
||||||
|
|
||||||
#?
|
#?
|
||||||
copy.copy()
|
copy.copy()
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -149,7 +149,20 @@ copy.copy()
|
|||||||
|
|
||||||
# We don't want any results for json, because it depends on IO.
|
# We don't want any results for json, because it depends on IO.
|
||||||
import json
|
import json
|
||||||
#?
|
#?
|
||||||
json.load('asdf')
|
json.load('asdf')
|
||||||
#?
|
#?
|
||||||
json.loads('[1]')
|
json.loads('[1]')
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# random
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
import random
|
||||||
|
class A(object):
|
||||||
|
def say(self): pass
|
||||||
|
class B(object):
|
||||||
|
def shout(self): pass
|
||||||
|
cls = random.choice([A, B])
|
||||||
|
#? ['say', 'shout']
|
||||||
|
cls().s
|
||||||
|
|||||||
Reference in New Issue
Block a user