Assembly comprising a rotary encoder, a tolerance ring, and a body receiving the rotary encoder and the tolerance ring, wherein the rotary encoder - has a shaft (1.11) to which a scale element (1.12) is fixed for conjoint rotation, and - a housing (1.21) accommodating a scanning unit (1.22) which is connected for conjoint rotation to the housing (1.21), wherein the shaft (1.11) is arranged so as to be rotatable relative to the housing (1.21) about an axis, and the scale element (1.12) is scannable by the scanning unit (1.22), wherein furthermore the housing (1.21) has an outer wall which has a first distance from the axis in a first portion (1.211), and has a second distance from the axis in a second portion (1.212), wherein the first distance is greater than the second distance, and the body has a recess (3.1), wherein the recess (3.1) - is radially delimited with respect to the axis by a first inner wall (3.11), has a third distance from the axis in a third portion (3.113) and has a fourth distance from the axis in a fourth portion, wherein the fourth distance is greater than the third distance, and the recess (3.1) - is delimited by a second inner wall (3.12) which forms an axial stop for the housing (2.1) with respect to the axis, wherein the fourth portion (3.114) is arranged in an axial direction between the second inner wall (3.12) and the third portion (3.113), wherein the tolerance ring surrounds the housing (1.21) and is arranged within the recess (3.1) such that the tolerance ring is located radially between the first portion (1.211) and the fourth portion (3.114) and between the second portion (1.212) and the third portion (3.113), wherein the tolerance ring is radially clamped between the housing (1.21) and the body. the rotary encoder - has a shaft (1.11) to which a scale element (1.12) is fixed for conjoint rotation, and - a housing (1.21) accommodating a scanning unit (1.22) which is connected for conjoint rotation to the housing (1.21), wherein - has a shaft (1.11) to which a scale element (1.12) is fixed for conjoint rotation, and - a housing (1.21) accommodating a scanning unit (1.22) which is connected for conjoint rotation to the housing (1.21), wherein the shaft (1.11) is arranged so as to be rotatable relative to the housing (1.21) about an axis, and the scale element (1.12) is scannable by the scanning unit (1.22), wherein furthermore the housing (1.21) has an outer wall which has a first distance from the axis in a first portion (1.211), and has a second distance from the axis in a second portion (1.212), wherein the first distance is greater than the second distance, and has a first distance from the axis in a first portion (1.211), and has a second distance from the axis in a second portion (1.212), wherein the first distance is greater than the second distance, and the body has a recess (3.1), wherein the recess (3.1) - is radially delimited with respect to the axis by a first inner wall (3.11), has a third distance from the axis in a third portion (3.113) and has a fourth distance from the axis in a fourth portion, wherein the fourth distance is greater than the third distance, and the recess (3.1) - is delimited by a second inner wall (3.12) which forms an axial stop for the housing (2.1) with respect to the axis, wherein the fourth portion (3.114) is arranged in an axial direction between the second inner wall (3.12) and the third portion (3.113), wherein - is radially delimited with respect to the axis by a first inner wall (3.11), has a third distance from the axis in a third portion (3.113) and has a fourth distance from the axis in a fourth portion, wherein the fourth distance is greater than the third distance, and the recess (3.1) has a third distance from the axis in a third portion (3.113) and has a fourth distance from the axis in a fourth portion, wherein the fourth distance is greater than the third distance, - is delimited by a second inner wall (3.12) which forms an axial stop for the housing (2.1) with respect to the axis, wherein the fourth portion (3.114) is arranged in an axial direction between the second inner wall (3.12) and the third portion (3.113), wherein