-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Add composition example to internals.rst #9984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Define Original Data Structures using pandas | ||
-------------------------------------------- | ||
|
||
.. warning:: If you simply want to add some functionalities to ``pandas``, the easiest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be "functionality" not "functionalities (here and next paragraph)
0ee0d62
to
3cf2c13
Compare
|
||
This section describes how to define your original data structure which extends ``pandas`` functionality using `composition <http://en.wikipedia.org/wiki/Composition_over_inheritance>`_. | ||
|
||
Below example shows an original class which is mostly compatible with ``Series``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below example -> The example below
I made a few grammar/language suggestions. But actually, I'm not sure this example makes the best case for why composition is usually a better idea than subclassing. Using So many we should show an example of how subclassing can lead to unexpected behavior or a more realistic version of composition that simply makes use of a series or frame to hold internal state. |
status? |
@sinhrks going to move this to next version. |
@sinhrks can you update |
closing, but if you'd like to update, pls reopen |
Follow-up of #9802. Added an example of composition to internal.rst.
Also, fixed broken section name for subclass document.