def trailing_whitespace(physical_line):
 physical_line = physical_line.rstrip('\n')
 physical_line = physical_line.rstrip('\r')
 physical_line = physical_line.rstrip('\x0c')
 stripped = physical_line.rstrip('  DCTB \x0b')
 if (physical_line != stripped):
  if stripped:
   return (len(stripped), 'W291 trailing whitespace')
  else:
   return (0, 'W293 blank line contains whitespace')

def trailing_whitespace ( physical_line ) : physical_line = physical_line . rstrip ( '\n' ) physical_line = physical_line . rstrip ( '\r' ) physical_line = physical_line . rstrip ( '\x0c' ) stripped = physical_line . rstrip ( '  DCTB \x0b' ) if ( physical_line != stripped ) : if stripped : return ( len ( stripped ) , 'W291 trailing whitespace' ) else : return ( 0 , 'W293 blank line contains whitespace' )
jcr: trailing whitespace is superfluous .