Skip to content

Conversation

@tarasmatsyk
Copy link

@tarasmatsyk tarasmatsyk commented Dec 31, 2017

Current representation:
<coroutine object f at 0x7f86c9733790>

A goal is to display more information:
<coroutine at 0x7f86c9733790, running, file "/home/antoine/cpython/default/Lib/logging/init.py", line 123, code getLogger>

https://bugs.python.org/issue32469

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@tarasmatsyk
Copy link
Author

tarasmatsyk commented Dec 31, 2017

Note: SLA is in the progress.

@pitrou
Copy link
Member

pitrou commented Dec 31, 2017

Hi @tarasmatsyk,

I think you misunderstood the enhancement request. What I mean is the repr() of actual generator objects, for example:

>>> 
>>> def g():
...     yield 1
... 
>>> g()
<generator object g at 0x7f80eb781ad8>
>>> async def f():
...     await None
... 
>>> f()
<coroutine object f at 0x7f80eb781b80>

@pitrou
Copy link
Member

pitrou commented Dec 31, 2017

I'm also not sure what GeneratorWrapper is for, it's the first time I see it. @1st1

@tarasmatsyk
Copy link
Author

I see, anyway I would be happy to see the right solution or if no one comes up with it - I might be able to figure it out on my own. I will wait to get a response regarding GeneratorWrapper and will close this PR.

@1st1
Copy link
Member

1st1 commented Jan 1, 2018

GeneratorWrapper is what generator-like objects (like generators compiled with Cython) are wrapped with to become awaitables.

Lib/types.py Outdated
Copy link
Member

Choose a reason for hiding this comment

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

We can't just use 'coroutine' here, that would make it harder to debug things. I propose to use 'coroutine-like-object', which is a bit verbose but readable.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@tarasmatsyk
Copy link
Author

@pitrou, thanks for the hint, I have updated coroutine and generator representation. I am happy to make any other changes if I missed something.

@1st1, yep, that makes much more sense, a requested change has been applied.

Current representation:
<coroutine object f at 0x7f86c9733790>

A goal is to display more information:
<coroutine at 0x7f86c9733790, running, file "/home/antoine/cpython/default/Lib/logging/__init__.py", line 123, code getLogger>
@tarasmatsyk tarasmatsyk requested a review from asvetlov as a code owner January 1, 2018 21:25
@tarasmatsyk
Copy link
Author

An SLA is finally approved and all required changes have been made. If I missed anything - let me know, would be happy to update.

A code phrase:
I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@1st1: please review the changes made to this pull request.

@ahcub
Copy link
Contributor

ahcub commented Jun 30, 2018

nice work!
looking forward to seeing those changes merged

@vstinner vstinner closed this May 3, 2021
@vstinner vstinner deleted the branch python:master May 3, 2021 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants