Skip to content

Instantly share code, notes, and snippets.

View artfwo's full-sized avatar
💭
Patterns are meant to be broken.

Artem Popov artfwo

💭
Patterns are meant to be broken.
View GitHub Profile
@artfwo
artfwo / property.py
Created January 15, 2021 20:27
Pure Python runtime property to expression binding example using descriptors
#! /usr/bin/env python3
#
# Pure Python runtime property to expression binding example using descriptors
# (see below for usage example).
#
# This Property implementation allows setting a value using lambda expressions.
# The value will be recalculated if any property accessed during lambda evaluation
# changes its value.
class Property:
-- clock test
--
-- adjust mul/div
-- with e2/e3
--
-- change clock settings
-- from parameters menu
--
engine.name = 'PolyPerc'
-- clock test
--
-- ...
-- .
engine.name = 'PolyPerc'
local dividers = { 1, 2 }
local led_states = { false, false }
local tasks = { nil, nil }

Keybase proof

I hereby claim:

  • I am artfwo on github.
  • I am artfwo (https://keybase.io/artfwo) on keybase.
  • I have a public key whose fingerprint is AD0A A61E AF4E 58A0 CFE0 6003 ACA5 5732 FAF5 1E4F

To claim this, I am signing this object: