cached-property-bel-1.0.1
توضیحات
A cached-property decorator.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | cached-property-bel-1.0.1 |
| نام | cached-property-bel |
| نسخه کتابخانه | 1.0.1 |
| نگهدارنده | ['Justus Schwabedal'] |
| ایمیل نگهدارنده | ['jschwabedal@belco.tech'] |
| نویسنده | Justus Schwabedal |
| ایمیل نویسنده | jschwabedal@belco.tech |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/cached-property-bel/ |
| مجوز | - |
# Cached Property
This module adds a decorator `cached_property` and a function `drop_cache`.
## Example
```python
from cached_property import cached_property, drop_cache
import time
class Dummy:
@cached_property
def the_answer(self):
time.sleep(0.5)
return 42
dummy = Dummy()
t0 = time.time()
err = dummy.the_answer
dt = time.time()-t0
print(dt)
# dt -> ~0.5 seconds
t0 = time.time()
err = dummy.the_answer
dt = time.time()-t0
print(dt)
# dt -> ~1e-6 seconds
drop_cache(dummy, 'the_answer')
t0 = time.time()
err = dummy.the_answer
dt = time.time()-t0
print(dt)
# dt -> ~0.5 seconds
```
## License and Copyright
Copyright 2019 Brain Electrophysiology Laboratory Company LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this module or the code within it except in
compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl cached-property-bel-1.0.1:
pip install cached-property-bel-1.0.1.whl
نصب پکیج tar.gz cached-property-bel-1.0.1:
pip install cached-property-bel-1.0.1.tar.gz