Adds distribution() convenience function.#440
Conversation
I'm tired of typing `Distribution.from_shape` all the time. This seems to be the main entry point, so `distribution` is a shortcut.
|
One down side- I often name my instances |
|
OK, what about this design then:
I'd really like a shorter name for what is now |
distribution() conveinence function.distribution() convenience function.
|
Haha, yeah, that's probably the way to go. I think that's the way it was before, and we changed it to this way because we wanted the most general constructor to be |
|
We have considered two design principles for alternate constructors:
I'm leaning towards (2.) now, as makes sense for the shortest name to call the most commonly-used method. I seem to remember Raymond Hettinger recommending that as well. I do think we should try, as much as possible, to have all constructors call an underlying general constructor; else we can end up with bugs where some constructors don't create all the same instance attributes as others. |
|
@kwmsmith: Should we close this PR and make an issue? |
|
Closing. Will be addressed by a different PR. |
I'm tired of typing
Distribution.from_shapeall the time. This seemsto be the main entry point, so
distributionis a shortcut.