graingert Github contribution chart
graingert Github Stats
graingert Most Used Languages

Activity

28 Sep 2022

Issue Comment

Graingert

gh-95601: restore support for awaitable objects that are not futures in `asyncio.wait`

  • Issue: gh-95601
  • Issue: https://github.com/python/cpython/issues/95920

Forked On 28 Sep 2022 at 12:03:44

Graingert

@serhiy-storchaka can you re-review this? I'll add the warning if you and @tiran agree it should be added in this PR.

Commented On 28 Sep 2022 at 12:03:44
Issue Comment

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Forked On 28 Sep 2022 at 08:54:38

Graingert

@graingert Could you submit a comment with suggested text that would make you happy about this note and that I can just commit and land?

I'm currently still 99% offline I'll be available in a few weeks I think

Commented On 28 Sep 2022 at 08:54:38
Issue Comment

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Forked On 24 Sep 2022 at 02:30:19

Graingert

I think here it makes most sense to have a very minimal comparative discussion of how other async frameworks handle this eg twisted and asyncio are very similar using a Future/Deferred callback/ trampoline pattern. curio and trio use an approach similar to kernel "traps" using

@types.coroutine
def _async_yield(v):
    return (yield v) 

Commented On 24 Sep 2022 at 02:30:19
Merge

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Forked On 24 Sep 2022 at 02:26:53

Graingert

dask/distributed uses: ```python def __await__(self): async def _(): ... return _().__await__() ``` To implement Awaitable classes, it's not clear to me if that's an intended use case.
On 24 Sep 2022 at 02:26:53

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Merged On 24 Sep 2022 at 02:26:54

Graingert

Commented On 24 Sep 2022 at 02:26:54
Merge

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Forked On 24 Sep 2022 at 02:24:21

Graingert

I don't think the special case of `await asyncio.sleep(0)` via `yield None` should be documented here
On 24 Sep 2022 at 02:24:21

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Merged On 24 Sep 2022 at 02:24:22

Graingert

Commented On 24 Sep 2022 at 02:24:22
Merge

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Forked On 24 Sep 2022 at 02:23:04

Graingert

This is also slightly off as asyncio should call `return yield from type(aw).__await__(aw)` or `return await aw` but actually calls `return yield from aw.__await__()` There's also exotic objects that are Awaitables but don't have an `__await__` method. I think via c extensions
On 24 Sep 2022 at 02:23:04

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Merged On 24 Sep 2022 at 02:23:05

Graingert

Commented On 24 Sep 2022 at 02:23:05
Merge

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Forked On 24 Sep 2022 at 02:19:36

Graingert

You're not supposed to use `yield from fut` anymore either - you should use `await fut`
On 24 Sep 2022 at 02:19:36

Graingert

bpo-41813: Clarify the vague specification of object.__await__

https://bugs.python.org/issue41813

Merged On 24 Sep 2022 at 02:19:36

Graingert

Commented On 24 Sep 2022 at 02:19:36
Issue Comment

Graingert

GH-75720: use `time.perf_counter` in asyncio loop.time()

  • Issue: gh-75720

Forked On 23 Sep 2022 at 04:52:46

Graingert

My understanding of https://github.com/python/cpython/issues/88494 is that it would fix this and all other uses of time.monotonic and the main thing blocking it is getting a suitable windows development environment available for @vstinner and or @njsmith

This PR looks good to me, but might be worth a docstring change?

Commented On 23 Sep 2022 at 04:52:46
Pull Request

Graingert

use itertools count for atomic increments

Created On 23 Sep 2022 at 02:12:14

Graingert

use itertools count for atomic increments

Pushed On 23 Sep 2022 at 02:12:10

Graingert

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).

Forked On 23 Sep 2022 at 02:10:25
Issue Comment

Graingert

GH-75720: use `time.perf_counter` in asyncio loop.time()

  • Issue: gh-75720

Forked On 23 Sep 2022 at 08:52:59

Graingert

See also https://github.com/python/cpython/issues/88494

Commented On 23 Sep 2022 at 08:52:59
Issue Comment

Graingert

Update powerline-status on pypi.org to 2.8.1

https://pypi.org/project/powerline-status/ is still at 2.7. Could someone update it to the latest release?

Forked On 22 Sep 2022 at 07:34:38

Graingert

You don't need a name transfer if I'm happy to add a secret to your GitHub actions

Commented On 22 Sep 2022 at 07:34:38
Issue Comment

Graingert

use asyncio.Runner(loop_factory=...) instead of the policy system on 3.11

Discussed in https://github.com/encode/uvicorn/discussions/1521

Originally posted by graingert June 17, 2022 As part of the GELectomy (removing the per thread global eventloop from asyncio.get_event_loop() ) asyncio.runners now provides a policy free way to select the eventloop implementation. uvicorn should use this on 3.11 and consider backporting the implementation for other python versions

Forked On 20 Sep 2022 at 12:14:54

Graingert

It might be better to copy the implementation from python 3.10 asyncio.runners and ignore the broken implementation in 3.11

Commented On 20 Sep 2022 at 12:14:54
Issue Comment

Graingert

add test for #48
Forked On 18 Sep 2022 at 02:26:09

Graingert

@graingert do you still plan to work on this?

@fsouza I'm happy for someone else to take this over!

Commented On 18 Sep 2022 at 02:26:09
Issue Comment

Graingert

test_asyncio's `GenericWatcherTests.test_create_subprocess_fails_with_inactive_watcher` is not run

Bug report GenericWatcherTests does not inherit from TestCase, and so doesn't get run

Forked On 17 Sep 2022 at 01:08:07

Graingert

I was going to backport it to 3.10 but the change ended up too controversial

Commented On 17 Sep 2022 at 01:08:07
Issue Comment

Graingert

Rewrite `asyncio.wait_for` using `asyncio.timeout`

Over the years a lot of issues have accumulated for asyncio.wait_for and the code has become complicated. The asyncio.timeout can be used to simplify this a lot and will also fix bugs which are already fixed or don't exist in asyncio.timeout. This rewrite won't be backported. asyncio.wait_for should be nothing more than a wrapper around asyncio.timeout.

asyncio.wait_for issues: https://github.com/python/cpython/issues?q=is%3Aissue+is%3Aopen+wait_for+label%3Aexpert-asyncio

Forked On 17 Sep 2022 at 10:52:02

Graingert

https://github.com/python/cpython/pull/31847#discussion_r925531271 here's the work so far

Commented On 17 Sep 2022 at 10:52:02
Issue Comment

Graingert

Rewrite `asyncio.wait_for` using `asyncio.timeout`

Over the years a lot of issues have accumulated for asyncio.wait_for and the code has become complicated. The asyncio.timeout can be used to simplify this a lot and will also fix bugs which are already fixed or don't exist in asyncio.timeout. This rewrite won't be backported. asyncio.wait_for should be nothing more than a wrapper around asyncio.timeout.

asyncio.wait_for issues: https://github.com/python/cpython/issues?q=is%3Aissue+is%3Aopen+wait_for+label%3Aexpert-asyncio

Forked On 17 Sep 2022 at 10:31:39

Graingert

Yeah I'm interested, but one thing to note is that wait_for has changed dramatically between versions so matching the behavior is hard

Commented On 17 Sep 2022 at 10:31:39
Issue Comment

Graingert

Decorated property not supported

class Foo(object):
    @property
    @some_decorator
    def foo(self):
        ... 

is valid in Python 2, but MyPy complains Decorated property not supported. Adding type: ignore does not ignore the error.

Forked On 17 Sep 2022 at 07:49:25

Graingert

Gah! How is this possibly still an issue in late 2022? It's literally been eight years. Sad panda is sad.

so sad panda so sad panda

Afaik it's fixed in GitHub

Commented On 17 Sep 2022 at 07:49:25

Graingert

Initial work
Forked On 16 Sep 2022 at 07:53:46

Graingert

```shell $ pipx run --python=python3.10 --spec=mypy mypyc mypyc_task Traceback (most recent call last): File "mypyc/irbuild/classdef.py", line 95, in transform_class_def File "mypyc/irbuild/classdef.py", line 200, in add_method File "mypyc/irbuild/function.py", line 369, in handle_ext_method File "mypyc/irbuild/function.py", line 256, in gen_func_item File "mypyc/irbuild/env_class.py", line 98, in load_env_registers File "mypyc/irbuild/env_class.py", line 165, in add_args_to_env File "mypyc/irbuild/builder.py", line 1073, in type_to_rtype File "mypyc/irbuild/mapper.py", line 113, in type_to_rtype mypyc_task/tasks.py:240: AssertionError: unexpected type <class 'mypy.types.DeletedType'> ```
On 16 Sep 2022 at 07:53:46

Graingert

Initial work
Merged On 16 Sep 2022 at 07:53:47

Graingert

Commented On 16 Sep 2022 at 07:53:47

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:52:36

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:52:36

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:52:36

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:52:36

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:52:36

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:51:44

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:51:44

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:51:44

Graingert

--wip-- [skip ci]

Pushed On 16 Sep 2022 at 07:51:44

Graingert

use python3.10

Pushed On 15 Sep 2022 at 11:54:38

Graingert

hatch new

Pushed On 15 Sep 2022 at 11:54:38

Graingert

mypy config

Pushed On 15 Sep 2022 at 11:54:38

Graingert

apply mypy_clean_slate

Pushed On 15 Sep 2022 at 11:54:38

Graingert

--wip-- [skip ci]

Pushed On 15 Sep 2022 at 11:54:38

Graingert

use python3.10

Pushed On 15 Sep 2022 at 11:15:02