Define constants for month numbers in calendar module

Issue updated.

1 Like

Yes, I linked to some above:

And:

I think people see things without leading underscores and quite reasonably think they’re public and use them.

2 Likes

Maybe someone could send a PR to jsonargparse.

I don’t think that lack of underscores makes it “reasonable” to import anything from anywhere. I wish there was a consensus that __all__ defines what is public. The underscore convention affects import * when __all__ is not used. When __all__ is used it should denote what is public.

EDIT: The actual code using this in json_argparse is just in the tests and even has a type: ignore which is presumably because mypy/pyright complains about using a name that is not exposed in __all__:

The are only two times when that is reasonable:

  • no __all__ is defined; or
  • the object in question is shown as public in the documentation

Well, that’s how Python treats it, so those who use Python would do well to also treat it like that.