-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
WIP/ DOC: Move 'For Developers' content from wiki to contributing docs. #30232 #30406
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,8 +569,40 @@ do not make sudden changes to the code that could have the potential to break | |
a lot of user code as a result, that is, we need it to be as *backwards compatible* | ||
as possible to avoid mass breakages. | ||
|
||
Additional standards are outlined on the `code style wiki | ||
page <https://github.com/pandas-dev/pandas/wiki/Code-Style-and-Conventions>`_. | ||
Cross-compatible code | ||
--------------------- | ||
|
||
It's important to write code that will be compatible with most recent version of | ||
Python 3. | ||
|
||
Python 2/3 Compatibility | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* After `v0.25.0 <https://github.com/pandas-dev/pandas/releases/tag/v0.25.0>`_ | ||
we have stopped supporting Python 2. | ||
* ``callable`` - was first removed from Python 3.0 then brought back in python | ||
3.2. | ||
|
||
Imports (aim for absolute) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can remove all but this section. (retain as subsection of Code Standards) |
||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
In Python 3, everything is an absolute import, so doing something like: ``import | ||
string`` will import the string module rather than ``string.py`` in the same directory. | ||
As much as possible, you should try to write out absolute imports that show the | ||
whole import chain from toplevel pandas. In test code, it might be easier to just | ||
reference local variables with relative imports (that start with ``.``) for clarity, | ||
but in other code better to be explicit. | ||
|
||
:: | ||
|
||
# cross compatible and preferred | ||
import pandas.core.common as com | ||
|
||
# may FAIL in Python 3 | ||
import common | ||
Comment on lines
+601
to
+602
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could remove this |
||
|
||
# okay in test code | ||
from .common import test_base | ||
|
||
Optional dependencies | ||
--------------------- | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
only py3.6+ is supported, so I think we can remove this too