Application of subsection in case of partnerships and S corporations
In the case of a partnership or S corporation—
(A)#
this subsection shall be applied at the partner or shareholder level, and
(B)#
each partner’s or shareholder’s allocable share of the items of income, gain, deduction, or loss of the partnership or S corporation for any taxable year from trades or businesses attributable to the partnership or S corporation shall be taken into account by the partner or shareholder in applying this subsection to the taxable year of such partner or shareholder with or within which the taxable year of the partnership or S corporation ends.
For purposes of this paragraph, in the case of an S corporation, an allocable share shall be the shareholder’s pro rata share of an item.