A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-January/132083.html below:

[Python-Dev] cpython: Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum

[Python-Dev] cpython: Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum [Python-Dev] cpython: Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximumAntoine Pitrou solipsis at pitrou.net
Sat Jan 25 22:35:34 CET 2014
On Sat, 25 Jan 2014 15:02:56 +0100 (CET)
victor.stinner <python-checkins at python.org> wrote:
> +
> +        @tasks.coroutine
> +        def wait():
> +            loop = self.loop
> +            calls.append(loop._run_once_counter)
> +            yield from tasks.sleep(loop.granularity * 10, loop=loop)
> +            calls.append(loop._run_once_counter)
> +            yield from tasks.sleep(loop.granularity / 10, loop=loop)
> +            calls.append(loop._run_once_counter)
> +
> +        self.loop.run_until_complete(wait())
> +        calls.append(self.loop._run_once_counter)
> +        self.assertEqual(calls, [1, 3, 5, 6])

Could you add a comment explaining the number of calls to run_once()?
For example, why does it jump from 1 to 3 and then 3 to 5, rather than
1 to 2 and then 2 to 3?

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4