Skip to main content
added 13 characters in body
Source Link
smac89
  • 1.5k
  • 10
  • 24

...is already built into the string class. It is called rjust. So replace all uses of your over-engineeredover-engineered function with str.rjust(longest), or change the function to use rjust.

...is already built into the string class. It is called rjust. So replace all uses of your over-engineered function with str.rjust(longest), or change the function to use rjust.

...is already built into the string class. It is called rjust. So replace all uses of your over-engineered function with str.rjust(longest), or change the function to use rjust.

Rollback to Revision 4
Source Link
smac89
  • 1.5k
  • 10
  • 24

The recommended way of doing it is by using the is operator (if you want to be explicit), or not operator if you are trying to be subtle, so:

if given is None: # or if not given:
    ...

The recommended way of doing it is by using the is operator (if you want to be explicit), or not operator if you are trying to be subtle, so:

if given is None: # or if not given:
    ...

The recommended way of doing it is by using the is operator, so:

if given is None:
    ...
added 104 characters in body
Source Link
smac89
  • 1.5k
  • 10
  • 24

The recommended way of doing it is by using the is operator (if you want to be explicit), or not operator if you are trying to be subtle, so:

if given is None: # or if not given:
    ...

The recommended way of doing it is by using the is operator, so:

if given is None:
    ...

The recommended way of doing it is by using the is operator (if you want to be explicit), or not operator if you are trying to be subtle, so:

if given is None: # or if not given:
    ...
added 178 characters in body; deleted 134 characters in body
Source Link
smac89
  • 1.5k
  • 10
  • 24
Loading
deleted 2 characters in body; added 6 characters in body
Source Link
smac89
  • 1.5k
  • 10
  • 24
Loading
Bolder headings
Source Link
smac89
  • 1.5k
  • 10
  • 24
Loading
Source Link
smac89
  • 1.5k
  • 10
  • 24
Loading