Yelp / bravado-core

Other
109 stars 98 forks source link

Use setattr instead on manipulating __dict__ in cached_property #329

Closed macisamuele closed 5 years ago

macisamuele commented 5 years ago

The goal of this CR is to allow usage of cached_property as lazy evaluated and cached class attribute in case of usage in meta class.

The idea of this change is to allow definition of Model class attributes as lazy attribute, this could improve creation speed (not all the attributes need to be defined at init time) as well as memory consumption (only needed attributes will be evaluated).

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.0009%) to 98.482% when pulling c56a7b43ac21600264726e730c272bfbe36ecc14 on macisamuele:maci-cached-property-enhancement into ed6c04020adb12edb6d099be23e786ef5cf676cb on Yelp:master.