bpo-32363: Disable Task.set_exception() and Task.set_result() by 1st1 · Pull Request #4923 · python/cpython (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kozzztik Thanks for the explanation!

When you try to inherit from Task on Py>3.6 (on 3.5 it is ok) that is not obvious, but you inherit CTask which not uses this method.

@asvetlov As I expected. It's not possible to use either method since 3.6.

Just remove it (may be also make C implementation be similar to python variant and respect method overriding)

Can't do that, Task inherits from Future. It's possible to remove them from C Task, but not from Python version.

Add comment to "raise" statement why it looks so. Sure, someone will spend hours to understand what that mean.

OK.

I'll change NotImplementedError to some other exception.