Skip to content

bpo-32357: Optimize asyncio.iscoroutine() for non-native coroutines#4915

Merged
1st1 merged 2 commits into
python:masterfrom
1st1:cached_isinstance
Dec 19, 2017
Merged

bpo-32357: Optimize asyncio.iscoroutine() for non-native coroutines#4915
1st1 merged 2 commits into
python:masterfrom
1st1:cached_isinstance

Conversation

@1st1

@1st1 1st1 commented Dec 18, 2017

Copy link
Copy Markdown
Member

Comment thread Lib/asyncio/coroutines.py Outdated
_COROUTINE_TYPES = (types.CoroutineType, types.GeneratorType,
Coroutine, CoroWrapper)
collections.abc.Coroutine, CoroWrapper)
_iscoroutine_typecache = {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it required to be dict?
Looks like set is enough.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Makes sense! Updated both C and Python versions.

@1st1 1st1 merged commit a9d7e55 into python:master Dec 19, 2017
@1st1 1st1 deleted the cached_isinstance branch December 19, 2017 12:18
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.

4 participants