Skip to content
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

DOC: Small modification of error message #2956

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Nov 19, 2024

No description provided.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Nov 19, 2024

class ViewerPreferences(DictionaryObject):
    def _get_bool(self, key: str, deft: Optional[BooleanObject]) -> BooleanObject:
        return self.get(key, deft)

@pubpub-zz what is deft here? Can it be renamed for readability?

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.36%. Comparing base (92bb037) to head (2af3a12).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2956   +/-   ##
=======================================
  Coverage   96.36%   96.36%           
=======================================
  Files          52       52           
  Lines        8744     8744           
  Branches     1589     1589           
=======================================
  Hits         8426     8426           
  Misses        190      190           
  Partials      128      128           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@stefan6419846
Copy link
Collaborator

The name is default, as you can easily see from its usage as dict.get(key, default).

@j-t-1
Copy link
Contributor Author

j-t-1 commented Nov 19, 2024

It is obvious! I was reading it like a word, and not making the connection. Using "default" instead, would be marginally better? Unsure if good practice to do so.

@stefan6419846
Copy link
Collaborator

The official name inside the stdlib is default: https://docs.python.org/3/library/stdtypes.html#dict.get

@j-t-1
Copy link
Contributor Author

j-t-1 commented Nov 19, 2024

Right. So would be okay to change? Or are you saying because of this it would not be okay to change?

@stefan6419846
Copy link
Collaborator

It is internal and improves readability, thus changing it is possible and makes sense to avoid doubts.

Also slight improvement of two error messages.
To increase readability.

Also slight improvement of two error messages.
@pubpub-zz
Copy link
Collaborator

I prefered not to use default as a variable name. I have no objection to change it.

@stefan6419846 stefan6419846 merged commit bd5b962 into py-pdf:main Nov 19, 2024
16 checks passed
@j-t-1 j-t-1 deleted the ViewerPreferences branch November 19, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants