You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found myself needing to generate documentation for the sheet importer. Since there's a large overlap between the sheet definition and the documentation of each field, it's nice to put everything in one place:
But this seems like scope creep for Tribune itself. Perhaps we could address this by making the Field type extensible. This could be accomplished several ways.
Use make it a super class
Instead of using a namedtuple, turn Field into a class that can be inherited. As long as children classes have the necessary fields of header, key, parser, they can add as much as they want, including documentation metadata.
Allow Field to take an additional metadata field.
Keep Field as a namedtuple but add one more field to be used for anything the end-coder needs:
I've found myself needing to generate documentation for the sheet importer. Since there's a large overlap between the sheet definition and the documentation of each field, it's nice to put everything in one place:
But this seems like scope creep for Tribune itself. Perhaps we could address this by making the
Field
type extensible. This could be accomplished several ways.Instead of using a
namedtuple
, turnField
into a class that can be inherited. As long as children classes have the necessary fields ofheader
,key
,parser
, they can add as much as they want, including documentation metadata.Field
to take an additionalmetadata
field.Keep
Field
as anamedtuple
but add one more field to be used for anything the end-coder needs:Ideally we'd make this
metadata
field optional and default it toNone
or something. That can be achieved several ways that I won't mention here.The nice thing about option #2 is that in maintains the immutable nature of
tuples
and it's still very simple.The text was updated successfully, but these errors were encountered: