PyO3 / tokio

Asyncio event loop written in Rust language
Other
245 stars 12 forks source link

tokio object can not set python attr #53

Closed LuoZijun closed 7 years ago

LuoZijun commented 7 years ago

https://github.com/PyO3/tokio/blob/master/tokio/__init__.py#L9

import asyncio
import tokio

asyncio.set_event_loop_policy(tokio.EventLoopPolicy())

loop = tokio.new_event_loop()
asyncio.set_event_loop(loop)

class Empty(object):
    pass

# This not work!
loop.xyz = Empty()
fafhrd91 commented 7 years ago

This is known limitation of pyo3. Next vetsion will support __dict__ and AbstractEventLook

messense commented 7 years ago

@LuoZijun The limitation of pyo3 has been addressed in https://github.com/PyO3/pyo3/pull/68 FYI

LuoZijun commented 7 years ago

@messense @fafhrd91 thx.

fafhrd91 commented 7 years ago

should be fixed in master