In this case, this is not a security risk, since a security risk occurs when the executable line is what the user has access to. In this case, it is a string literal.
However, even if this is not a security risk, it is execalmost always a bad choice. Why not use getattrand setattrinstead?
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))
, __init__, , .