Depowering the stepper coils when not stepping adds a wee bit of intelligence to the stepper library. Actual stepper motor controllers can be configured with separate step and hold currents. They also shape the stepping current into a more sinusoidal wave instead of square, but I digress. The important thing is that when not stepping and powered, the motor is stalled, and high currents in a stalled motor can be straight up harmful. I actually wrote my own stepper library that used PWM to have different currents but again I digress, sorry.
There are many applications that require no holding current after stepping, chiefly horizontal positioning like turntables for solar tracking (depowering is a bonus in solar apps) or 3D printer build table positioning.
I have a simple approach, just turn output off at the end of the step() routine:
Then a user could do something like:
foo.step(90);
do_heavy_lifting();
foo.step(-90);
And the motors will simply be depowered during the do_heavy_lifting() routine. If do_heavy_lifting() takes seconds it could keep the motors cool and reduce power.
Cheers,
Sean