Skip to main content
quote from the referenced link
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 309

It's a difference in philosophy. The Pythonic design philosophy is EAFP: it is easier to ask for forgiveness than permission.

Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many try and except statements. The technique contrasts with the LBYL style common to many other languages such as C...

It's a difference in philosophy. The Pythonic design philosophy is EAFP: it is easier to ask for forgiveness than permission.

It's a difference in philosophy. The Pythonic design philosophy is EAFP:

Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many try and except statements. The technique contrasts with the LBYL style common to many other languages such as C...

Source Link
user4828
user4828

It's a difference in philosophy. The Pythonic design philosophy is EAFP: it is easier to ask for forgiveness than permission.