You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PdfFileReader has about 9 cases of the following pattern. Take as a concrete example isEncrypted:
def getIsEncrypted(self):
return "/Encrypt" in self._trailer
isEncrypted = property(getIsEncrypted)
"""
Read-only boolean property showing whether this PDF file is encrypted.
Note that this property, if True, will remain True even after the
:meth:`decrypt()<PdfFileReader.decrypt>` method is called.
"""
I do not see any real utility in this code style and it actually causes more verbosity. I invite to change these many cases were getProperty() == property to something like (take isEncrypted as an example again):
"""
Read-only boolean property showing whether this PDF file is encrypted.
Note that this property, if True, will remain True even after the
:meth:`decrypt()<PdfFileReader.decrypt>` method is called.
"""
@property
def isEncrypted(self):
return "/Encrypt" in self._trailer
Please note that isEncrypted's docstring seems misleading. Indeed, I know of no default caching for property decorators, as attested here.
The text was updated successfully, but these errors were encountered:
PdfFileReader
has about9
cases of the following pattern. Take as a concrete exampleisEncrypted
:I do not see any real utility in this code style and it actually causes more verbosity. I invite to change these many cases were
getProperty() == property
to something like (takeisEncrypted
as an example again):Please note that
isEncrypted
's docstring seems misleading. Indeed, I know of no default caching for property decorators, as attested here.The text was updated successfully, but these errors were encountered: