TL/DR: what's the purpose of new_directive() wrapper around NamedTuple()?
I've been following Beancount for a while, and I wanted to fork the project and make some modifications for my own use and maybe contribute back to the project at some point. But before that I want to get a good understanding of the source code. I was going through the basic data structures, and I'm trying to understand the
new_directive factory. In beancount.core some classes (e.g. Posting) are created via a
NamedTuple(), while others (e.g. Transaction) are created via
new_directive().
new_directive() itself is a thin wrapper around
NamedTuple() anyway.
So I would like to know what is the rationale for using one over the other, or for new_directive() existence in general?