from __future__ import annotations
import json, dataclasses as dc
@dc.dataclass
class Skills:
languages : tuple[str, ...] = ('Java', 'Ruby', 'Python', 'JavaScript')
frameworks : tuple[str, ...] = ('Spring Boot', 'Rails', 'Flask', 'React')
databases : tuple[str, ...] = ('PostgreSQL', 'MySQL', 'MariaDB', 'Redis')
deployment : tuple[str, ...] = ('Kubernetes', 'Docker', 'Sidekiq', 'RabbitMQ')
def jsonify(self) -> str:
return json.dumps(dc.asdict(self), indent=4)
skills = Skills()
print(skills.jsonify())
from __future__ import annotations
import json, dataclasses as dc
@dc.dataclass
class Skills:
languages : tuple[str, ...] = ('Java', 'Ruby', 'Python', 'JavaScript')
frameworks : tuple[str, ...] = ('Spring Boot', 'Rails', 'Flask', 'React')
databases : tuple[str, ...] = ('PostgreSQL', 'MySQL', 'MariaDB', 'Redis')
deployment : tuple[str, ...] = ('Kubernetes', 'Docker', 'Sidekiq', 'RabbitMQ')
def jsonify(self) -> str:
return json.dumps(dc.asdict(self), indent=4)
skills = Skills()
print(skills.jsonify())