Content-Length: 347209 | pFad | http://github.com/python/cpython/pull/19985/commits/af90b25c99d76be03d2c004c2ad32d32f8fa6764

E6 bpo-32604: PEP 554 for use in test suite by nanjekyejoannah · Pull Request #19985 · python/cpython · GitHub
Skip to content

bpo-32604: PEP 554 for use in test suite #19985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 19, 2020
Prev Previous commit
Next Next commit
Fix white space
  • Loading branch information
nanjekyejoannah committed May 15, 2020
commit af90b25c99d76be03d2c004c2ad32d32f8fa6764
18 changes: 9 additions & 9 deletions Lib/test/support/interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@


def create(*, isolated=True):
"""
"""
Initialize a new (idle) Python interpreter.

"""
id = _interpreters.create(isolated=isolated)
return Interpreter(id, isolated=isolated)

def list_all():
"""
"""
Get all existing interpreters.
"""
return [Interpreter(id) for id in
_interpreters.list_all()]

def get_current():
"""
"""
Get the currently running interpreter.
"""
id = _interpreters.get_current()
Expand Down Expand Up @@ -88,14 +88,14 @@ def run(self, src_str, /, *, channels=None):


def is_shareable(obj):
"""
"""
Return `True` if the object's data can be
shared between interpreters and `False` otherwise.
"""
return _interpreters.is_shareable(obj)

def create_channel():
"""
"""
Create a new channel for passing data between
interpreters.
"""
Expand All @@ -104,7 +104,7 @@ def create_channel():
return (RecvChannel(cid), SendChannel(cid))

def list_all_channels():
"""
"""
Get all open channels.
"""
return [(RecvChannel(cid), SendChannel(cid))
Expand Down Expand Up @@ -133,7 +133,7 @@ def recv(self, *, _delay=10 / 1000): # seconds
time.sleep(_delay)
obj = _interpreters.channel_recv(self._id, sentinel)
return obj

_NOT_SET = object()

def recv_nowait(self, default=None):
Expand All @@ -158,7 +158,7 @@ def __init__(self, id):
self._id = id

def send(self, obj):
"""
"""
Send the object (i.e. its data) to the receiving
end of the channel and wait. Associate the interpreter
with the channel.
Expand All @@ -168,7 +168,7 @@ def send(self, obj):
time.sleep(2)

def send_nowait(self, obj):
"""
"""
Like send(), but return False if not received.
"""

Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/19985/commits/af90b25c99d76be03d2c004c2ad32d32f8fa6764

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy