Basic Question: updating Transform.rotation withouth lerping

Hi, I just started out with unity, for a 2d game prototype, and I ran into the following:

I want to immediately rotate a gameObject through a script.

when I do this:

Quaternion rot = playerTransform.rotation;
rot.z = Mathf.PI;
playerTransform.localRotation = rot;

I expect the rotation z in the inspector to jump to 180, but instead it’s 157 or something, and after some more calls to this function it lerps towards 180. I did not add any physics or anything.

How can I set it to update immediately?

It seems I misunderstand Quaternions, I am sorry.

For whom it might interest, I know do:

playerTransform.rotation = Quaternion.Euler(0, 0, 180);

If you want to rotate an object use the functon:

Transform.Rotate(Vector3)

Or for a specific rotation on an axis:

Transform.Rotate.X(float)
Transform.Rotate.Y(float)
Transform.Rotate.Z(float)