Browse Source

Zwischen Commit

master
Olli Graf 2 weeks ago
parent
commit
ea14cde427
  1. 9
      docker/docker-compose.yml
  2. 1
      gettattr/.gitignore
  3. 19
      gettattr/Kreis_getattr.py

9
docker/docker-compose.yml

@ -0,0 +1,9 @@
---
version: "2.1"
services:
fibserver:
image: hans:5000/fibserver:1
container_name: fibserver
ports:
- 8085:8085
restart: unless-stopped

1
gettattr/.gitignore

@ -0,0 +1 @@
__pycache__

19
gettattr/Kreis_getattr.py

@ -0,0 +1,19 @@
from math import pi as pi
class Kreis_getattr:
def __init__(self, radius):
self.radius = radius
self.operators ={
'durchmesser': lambda x: self.radius * 2,
'umfang': lambda x: self.durchmesser * pi,
'flaeche': lambda x: self.radius**2 *pi
}
def __getattr__(self, name):
if name not in self.operators:
raise TypeError(f'unbekannte Operation {name}')
return self.operators[name](0)
Loading…
Cancel
Save