Skip to main content
deleted 2 characters in body
Source Link
Toby Speight
  • 88.7k
  • 14
  • 104
  • 327

General (non-) review:

  • Don't run words together like that in identifiers. PEP-8 says you should use underscores as word separators; e.g. distancia_punto rather than distanciapunto.
  • The function's doc-commentdocstring is missing. It needs to describe the meaning of the arguments, and also the global variable (transformer) that is referenced.
  • Prefer to pass transformer as an argument rather than using a global variable.
  • Choose a better exceptional return (10 000 metres is a plausible distance between two points on Earth; 50 000 is impossible; None clearly distinguishes from an actual value). Better, don't catch the exception and instead allow the caller to decide what should happen.
  • The final line (outside the function) references another global into which I have no insight.

General (non-) review:

  • Don't run words together like that in identifiers. PEP-8 says you should use underscores as word separators; e.g. distancia_punto rather than distanciapunto.
  • The function's doc-comment is missing. It needs to describe the meaning of the arguments, and also the global variable (transformer) that is referenced.
  • Prefer to pass transformer as an argument rather than using a global variable.
  • Choose a better exceptional return (10 000 metres is a plausible distance between two points on Earth; 50 000 is impossible; None clearly distinguishes from an actual value). Better, don't catch the exception and instead allow the caller to decide what should happen.
  • The final line (outside the function) references another global into which I have no insight.

General (non-) review:

  • Don't run words together like that in identifiers. PEP-8 says you should use underscores as word separators; e.g. distancia_punto rather than distanciapunto.
  • The function's docstring is missing. It needs to describe the meaning of the arguments, and also the global variable (transformer) that is referenced.
  • Prefer to pass transformer as an argument rather than using a global variable.
  • Choose a better exceptional return (10 000 metres is a plausible distance between two points on Earth; 50 000 is impossible; None clearly distinguishes from an actual value). Better, don't catch the exception and instead allow the caller to decide what should happen.
  • The final line (outside the function) references another global into which I have no insight.
Source Link
Toby Speight
  • 88.7k
  • 14
  • 104
  • 327

General (non-) review:

  • Don't run words together like that in identifiers. PEP-8 says you should use underscores as word separators; e.g. distancia_punto rather than distanciapunto.
  • The function's doc-comment is missing. It needs to describe the meaning of the arguments, and also the global variable (transformer) that is referenced.
  • Prefer to pass transformer as an argument rather than using a global variable.
  • Choose a better exceptional return (10 000 metres is a plausible distance between two points on Earth; 50 000 is impossible; None clearly distinguishes from an actual value). Better, don't catch the exception and instead allow the caller to decide what should happen.
  • The final line (outside the function) references another global into which I have no insight.