Closed AKuederle closed 1 year ago
I'm not sure what this means. Everything is public in Python.
I know that everything is public in Python, but "things with leading underscore" are by convention viewed as private. I.e. internal API that is not expected for external consumption/if you need to use it, you probably doing something wrong.
So to signal users that it is "ok" to import Distribution
in their code, I would suggest reexporting it from pomegrenate.distributions
.
I think that's the right signal to send, though. You shouldn't ever be creating a Distribution
object directly in your code, and you should only use the Distribution
when implementing your own distributions. I still view that as private because I don't see a semantic difference between distributions that I've implemented and custom distributions that the user implements, in terms of public/private. Basically, if private meant that a user should never touch them in any circumstance, you're saying that the user is unable to make custom extensions that use such methods. I know in some other languages private literally means that the function/method cannot be accessed outside the code, but Python isn't like those.
Please re-open if you'd like to keep chatting -- always happy to hear alternate perspectives.
I think it would make sense to expose the base
Distribution
class via the "public" API.This would help with typing of user code and probably this is required when implementing custom distributions.