Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ybastide on github.
  • I am ybastide (https://keybase.io/ybastide) on keybase.
  • I have a public key ASAksVIcMQ2G8xDwLIQMTq6WivYYRrVavIu6Axc7nYb_Fgo

To claim this, I am signing this object:

package main
import fmt "fmt"
func main() {
fmt.Printf("Go et ne nous oublie pas trop vite !\n")
}
@ybastide
ybastide / cached_property.py
Created September 10, 2015 13:41
Cached property, also for static properties
class cached_property(object):
"""
Decorator that converts a method with a single self argument into a
property cached on the instance, or a class method into a property
cached on the class.
Adapted from django/utils/functional.py.
"""
def __init__(self, func):
self.func = func