Attempt at removing the duplicate padding calculations from real.py (#389)