Skip to content

Instantly share code, notes, and snippets.

@kvas-it
kvas-it / slot-test.py
Last active April 20, 2016 12:40
Demonstrate how __getattr__ and __setattr__ interact with slots and normal properties. The interesting part is that if a slot is not assigned a value, __getattr__ will be called for it as for normal attributes.
# Demonstrate when __getattr__ and __setattr__ get called for slots
# and normal attributes.
#
# The output is:
# a = Main(42)
# __setattr__(abc, 42) called
# a.abc: 42
# __getattr__(cba) called
# a.cba: None
# __getattr__(slot) called
@kvas-it
kvas-it / designer.html
Last active August 29, 2015 14:16
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../paper-calculator/paper-calculator.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;