(a) When the estate is otherwise ready to be distributed, it may be distributed in kind, unless the terms of the will provide otherwise or unless a partition sale is ordered.
(b)
(1) Upon petition of an interested person, except as provided in subdivision (b)(2) of this section, a distributee, who by the terms of the will is to receive land or any other thing to be purchased by the personal representative, and, if he or she notifies the personal representative before the thing is purchased, may elect to take the purchase price or property of the estate which the personal representative would otherwise sell to obtain the purchase price.
(2) If the terms of the will direct the purchase of an annuity, the person to whom the income thereof shall be directed to be paid shall not have the right to elect to take the capital sum directed to be used for the purchase in lieu of the annuity except to the extent that the will expressly provides that an assignable annuity be purchased.
(c) Nothing in this section shall affect the rights of election by a surviving spouse against a testamentary provision as provided in the Probate Code.