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

Improved implementation of resource's repr method #92

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

kbairak
Copy link

@kbairak kbairak commented Dec 6, 2022

Previous repr value:

>>> project
<<< '<Project: o:kb_org:p:kb1>'

New repr value:

>>> project
<<< Project(id='o:kb_org:p:kb1', attributes={'archived': False, 'datetime_created': '2022-10...1:18:33Z', ...}, relationships={'languages': '...', 'maintainers': '...', ...})

Previous repr value:

    >>> project
    <<< '<Project: o:kb_org:p:kb1>'

New repr value:

    >>> project
    <<< Project(id='o:kb_org:p:kb1', attributes={'archived': False, 'datetime_created': '2022-10...1:18:33Z', ...}, relationships={'languages': '...', 'maintainers': '...', ...})
@codecov-commenter
Copy link

Codecov Report

Merging #92 (0669740) into devel (103b6ac) will decrease coverage by 0.41%.
The diff coverage is 6.25%.

@@            Coverage Diff             @@
##            devel      #92      +/-   ##
==========================================
- Coverage   77.81%   77.40%   -0.42%     
==========================================
  Files          46       46              
  Lines        3809     3819      +10     
==========================================
- Hits         2964     2956       -8     
- Misses        845      863      +18     
Impacted Files Coverage Δ
transifex/api/jsonapi/resources.py 77.36% <6.25%> (-1.83%) ⬇️
transifex/_version.py 41.93% <0.00%> (-3.23%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines +866 to +871
r = reprlib.Repr()
r.maxlevel = 2
r.maxdict = 2
r.maxlist = 2
r.maxstring = 20

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw, this probably should be a module-level const variable, since it's immutable.

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