Standardization of class / method / function names #850
MartinThoma
started this conversation in
Ideas
Replies: 1 comment 4 replies
-
e.g. @MasterOdin / @sekrause ? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to rename:
Those 3 classes don't necessarily operate on files. They can operate on streams. Hence removing the "file" part makes sense to me.
Additionally, I would remove getters / setters in favor of properties in many cases.
Renames for PyPDF2.PdfFileReader:
getDocumentInfo
,documentInfo
➔metadata
getXmpMetadata
,xmpMetadata
➔xmp_metadata
getNumPages
,numPages
➔len(reader.pages)
getPage
➔reader.pages[0]
getNamedDestinations
,namedDestinations
➔named_destinations
getFields
➔fields
getPageLayout
,pageLayout
➔page_layout
getPageMode
,pageMode
➔page_mode
getFormTextFields
➔form_text_fields
getOutlines
: remove from public interface (add a leading underscore)getObject
➔get_object
readObjectHeader
➔read_object_header
getPageNumber
➔get_page_number
getDestinationPageNumber
➔get_destination_page_number
cacheGetIndirectObject
/cacheIndirectObject
: Is there a point in having those public?readNextEndLines
should this be public?What do you think about this renaming for PyPDF2 2.0.0?
Beta Was this translation helpful? Give feedback.
All reactions