Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upShould constructors initialized with `NA` set all elements to `NA`? #869
Comments
|
I thought about this briefly recently but didn't implement because of the efficiency and simplicity reasons. But I agree, for the sake of things like What do you need this internal "consistency" for? I am just afraid that syncronizing them might be a rabbit hole and might not be done properly in all situations. |
|
I'm working on vctrs methods for lubridate, and was adding a test that implicitly required |
|
Hmm, interesting corner case. Ok, let's add this in the constructor then. It should not harm, and it's the right thing to do anyhow. |
I find it a little strange that if you add an
NA, or initialize withNA, that it doesn't set all of the slots toNA. I feel like this implies that there are multiple "types" of missing Period objects. It might help internal consistency ifNApropagated to all slots. This would formalize a missing Period object as one where all slots areNAThis is what I expect internally: