Skip to content

Commit

Permalink
ENH: Remove alias to 'object' variable name
Browse files Browse the repository at this point in the history
Use targeted import with alias to avoid
polution (import sys) and cleanup (del sys)
paradigm.
  • Loading branch information
hjmjohnson committed Oct 16, 2020
1 parent a867b5e commit 8223831
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions Wrapping/Generators/Python/itkExtras.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# ==========================================================================*/

import re
from sys import stderr as system_error_stream

# The following line defines an ascii string used for dynamically refreshing
# the import and progress callbacks on the same terminal line.
Expand Down Expand Up @@ -147,19 +148,13 @@ def force_load():
getattr(itk, k)


import sys


def echo(object, f=sys.stderr):
"""Print an object is f
def echo(obj, f=system_error_stream):
"""Print an object to stream
If the object has a method Print(), this method is used.
repr(object) is used otherwise
repr(obj) is used otherwise
"""
print(f, object)


del sys
print(f, obj)


def size(image_or_filter):
Expand Down

0 comments on commit 8223831

Please sign in to comment.