Refactor GainsTax function in calcfunctions.py module#3044
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3044 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 13 13
Lines 2721 2721
=========================================
Hits 2721 2721
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Refactor GainsTax: collapse hasqdivltcg flag, drop dead c05100, rename c24510
Three behavior-preserving cleanups in GainsTax:
Replace the 9-line hasqdivltcg int-flag pattern (three if-blocks
setting 1/0 followed by
if hasqdivltcg == 1) with a single booleanhas_qdivltcg = (not CG_nodiff) and (any of the five qual-div / LTCG inputs > 0).Remove dead intermediate local c05100 (= c24580; pure local, never
returned, never re-read). Foreign-earned-income-exclusion rationale
moved to a one-line comment; final assembly is now
taxbc = c24580.Rename single-use local c24510 → line9_base. c24510 was a relic of
an old Form 1040 Schedule D line label that no longer matches any
current IRS line; line9_base signals its role as the input to the
Sch D TW line-9 dwks9 calculation.
No function signature change, no return-tuple change, no body-formula change.
Sch D TW / QDCGTW logic, banner section comments, and docstring unchanged.