Skip to content

Commit 516e260

Browse files
author
Dorian Birraux
committed
drop 4 async generators.
Async generators are not valid in 3.5. They are not critical.
1 parent 1b7c17d commit 516e260

2 files changed

Lines changed: 34 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Version 1.1.3
22
- Update asynchronous evaluator classes. Remove the `loop` parameter. Most optional loop parameters are deprecated in the Python standart library `asyncio` and in most libraries, mainly because it is misleading and lead to misuses and bugs. The loop parameter is useful when instantiating asynchronous evaluators outside the scope of an event loop. It's implementation was not good enough and was relying on usages deprecated in 3.8.
3+
- Removing four asynchronous generators in asynchronous evaluation result classes: `iter_messages`, `iter_messages_name`, `iter_messages_tuple` and `iter_output`. These coroutines are only working on python 3.6+ and are not critical enough to drop support for 3.5. Asynchronous properties: `messages`, `messages_name` and `output` provide the same information.
34

45
# Version 1.1.2
56
- Fix a backward incompatible change introduced in 12.1. Make sure the library works with any kernel version starting with 11.3.

wolframclient/evaluation/result.py

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -372,29 +372,39 @@ async def messages_name(self):
372372
await self.build()
373373
return self._messages_name
374374

375-
async def iter_messages(self):
376-
"""
377-
Iterator over all text messages issued during the evaluation.
378-
:return: message text as a string.
379-
"""
380-
msgs = await self.messages
381-
if msgs:
382-
for msg in msgs:
383-
yield msg
384-
385-
async def iter_messages_name(self):
386-
names = await self.messages_name
387-
if names:
388-
for name in names:
389-
yield name
390-
391-
async def iter_messages_tuple(self):
392-
""" Iterator over all messages returned as a tuple: (message name, message text)"""
393-
msg = await self.messages
394-
names = await self.messages_name
395-
if msg and names:
396-
for tuple_msg in zip(names, msg):
397-
yield tuple_msg
375+
# a bunch of asynchronous generators. These functions are not critical and we can't define them on 3.5.
376+
# removing them for now.
377+
#
378+
# async def iter_messages(self):
379+
# """
380+
# Iterator over all text messages issued during the evaluation.
381+
# :return: message text as a string.
382+
# """
383+
# msgs = await self.messages
384+
# if msgs:
385+
# for msg in msgs:
386+
# yield msg
387+
#
388+
# async def iter_messages_name(self):
389+
# names = await self.messages_name
390+
# if names:
391+
# for name in names:
392+
# yield name
393+
#
394+
# async def iter_messages_tuple(self):
395+
# """ Iterator over all messages returned as a tuple: (message name, message text)"""
396+
# msg = await self.messages
397+
# names = await self.messages_name
398+
# if msg and names:
399+
# for tuple_msg in zip(names, msg):
400+
# yield tuple_msg
401+
#
402+
# async def iter_output(self):
403+
# """ Iterator over all printed output."""
404+
# output = await self.output
405+
# if output:
406+
# for line in self.output:
407+
# yield line
398408

399409
@property
400410
async def output(self):
@@ -403,13 +413,6 @@ async def output(self):
403413
await self.build()
404414
return self._output
405415

406-
async def iter_output(self):
407-
""" Iterator over all printed output."""
408-
output = await self.output
409-
if output:
410-
for line in self.output:
411-
yield line
412-
413416
@property
414417
async def is_message_failure(self):
415418
if not self._built:

0 commit comments

Comments
 (0)