from datetime import datetime


class Article:
    published = datetime.now()

def __init__(self):
    for propname in 'year month day hour minute second'.split():
        setattr(self, propname, getattr(self.published, propname))
Is using 'exec' under controlled conditions a security threat?