Open csilvers opened 8 years ago
Adding one to this list: in addition to attributes it's not entirely clear which modules within ndb are considered public. For example, are the public functions in eventloop
considered public? I might expect it to be considered private, but the documentation at https://cloud.google.com/appengine/docs/standard/python/refdocs/google.appengine.ext.ndb.eventloop mentions it and doesn't imply it's private (as, it does e.g. for utils
).
This is closely related to #187 -- it may be considered a superset of it.
ndb.Property has this docstring:
However, it does not document which attributes are considered public. Guido stated in #187 that symbols corresponding to attributes, such as _repeated, are public. But that list is not comprehensive, I think.
There is also a separate(?) issue of which attributes are 'protected' -- that is, intended to be overridable by subclasses. The docstring talks about some of these: _validate(), _to_base_type(), _from_base_type(). But again, there's no authoritative list.
Here's an example of some symbols that Property defines, that would be good to document if they are public, protected, or private:
_code_name
,_values
,_store_value
,_value_to_repr
.A similar question applies to Model. Does the same underscore-but-still-public rule apply to model? I think I saw some documentation somewhere saying
_projection
falls into that category. Also, there seem to be 'protected' symbols, intended to be overridden/called by subclasses, such as_validate_key
. Symbols like_class_name
are less clear: docstring says polymodel may override it, but can user-defined models?One reason I'm wondering this is that we are writing code that needs to call
_class_name
,_get_kind
, and_from_pb
. Is such code safe, in that these are part of the stable API? Or are they private symbols that may change or disappear in a future release?