July 2, 2013

Pyson get some more syntax

Keeping in theme with the 'Python subset' idea, I thought of allowing keyword arguments in constructors as follows
DateTime = Type(
    "DateTime",
    ["year", "month", "day", "hour", "minute", "second"],
    defaults=[0, 0, 0],
    format="{year:D4}/{month:D2}/{day:D2} {hour:D2}:{minute:D2}:{second:D2}"
    )

No comments:

Post a Comment