syrusakbary / promise

Ultra-performant Promise implementation in Python
MIT License
362 stars 76 forks source link

Use WeakKeyDictionary for caching types in is_future_like #76

Closed freininghaus closed 4 years ago

freininghaus commented 5 years ago

This allows types to be garbage collected if they are not referenced any more elsewhere, and can prevent out-of-memory issues in applications that dynamically create new types and use them in Promises.

This fixes issue #75 (possible out-of-memory if dynamically generated types are used in Promises).