[issue29415] Exposing handle._callback and handle._args in asyncio

2017-02-01 Thread Yury Selivanov

Yury Selivanov added the comment:

> @yselivanov I just wanted to use the handler to avoid storing the callback 
> and args in my own data structure (I would just store the handlers whenever I 
> may need to reschedule). Not a big deal, I don't have to use handler as a 
> storage space, if it's not supported across implementations.

Alright, closing the issue. Thanks!

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29415] Exposing handle._callback and handle._args in asyncio

2017-02-01 Thread Max

Max added the comment:

@yselivanov I just wanted to use the handler to avoid storing the callback and 
args in my own data structure (I would just store the handlers whenever I may 
need to reschedule). Not a big deal, I don't have to use handler as a storage 
space, if it's not supported across implementations.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29415] Exposing handle._callback and handle._args in asyncio

2017-02-01 Thread Yury Selivanov

Yury Selivanov added the comment:

> Is it safe to use the _callback and _args attributes of asyncio.Handle? Is it 
> possible to officially expose them as public API?

I'd be -1 on exposing them.  Alternative asyncio event loop implementations 
such as uvloop don't have those attributes, and it's not always possible to add 
them.

> My use case:
>   def reschedule(handle):
>  event_loop.call_later(new_delay, handle._callback, *handle._args)
>  handle.cancel()

Why don't you just call `event_loop.call_later(delay, callback)`?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29415] Exposing handle._callback and handle._args in asyncio

2017-02-01 Thread Max

New submission from Max:

Is it safe to use the _callback and _args attributes of asyncio.Handle? Is it 
possible to officially expose them as public API?

My use case: 

handle = event_loop.call_later(delay, callback)

# this function can be triggered by some events
def reschedule(handle):
  event_loop.call_later(new_delay, handle._callback, *handle._args)
  handle.cancel()

--
components: asyncio
messages: 286709
nosy: gvanrossum, max, yselivanov
priority: normal
severity: normal
status: open
title: Exposing handle._callback and handle._args in asyncio
type: enhancement
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com