Skip to content

Commit

Permalink
STY: Replace remaining old style classes with classes subclassing obj…
Browse files Browse the repository at this point in the history
…ect.
  • Loading branch information
charris committed Apr 5, 2011
1 parent 06dc702 commit 2812406
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion numpy/_import_tools.py
Expand Up @@ -3,7 +3,7 @@

__all__ = ['PackageLoader']

class PackageLoader:
class PackageLoader(object):
def __init__(self, verbose=False, infunc=False):
""" Manages loading packages.
"""
Expand Down
8 changes: 4 additions & 4 deletions numpy/core/code_generators/genapi.py
Expand Up @@ -257,7 +257,7 @@ def should_rebuild(targets, source_files):
return False

# Those *Api classes instances know how to output strings for the generated code
class TypeApi:
class TypeApi(object):
def __init__(self, name, index, ptr_cast, api_name):
self.index = index
self.name = name
Expand All @@ -283,7 +283,7 @@ def internal_define(self):
""" % {'type': self.name}
return astr

class GlobalVarApi:
class GlobalVarApi(object):
def __init__(self, name, index, type, api_name):
self.name = name
self.index = index
Expand Down Expand Up @@ -311,7 +311,7 @@ def internal_define(self):

# Dummy to be able to consistently use *Api instances for all items in the
# array api
class BoolValuesApi:
class BoolValuesApi(object):
def __init__(self, name, index, api_name):
self.name = name
self.index = index
Expand All @@ -337,7 +337,7 @@ def internal_define(self):
"""
return astr

class FunctionApi:
class FunctionApi(object):
def __init__(self, name, index, return_type, args, api_name):
self.name = name
self.index = index
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/getlimits.py
Expand Up @@ -181,7 +181,7 @@ def __str__(self):
''' % self.__dict__


class iinfo:
class iinfo(object):
"""
iinfo(type)
Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/environment.py
Expand Up @@ -3,7 +3,7 @@

__metaclass__ = type

class EnvironmentConfig:
class EnvironmentConfig(object):
def __init__(self, distutils_section='ALL', **kw):
self._distutils_section = distutils_section
self._conf_keys = kw
Expand Down
2 changes: 1 addition & 1 deletion numpy/distutils/misc_util.py
Expand Up @@ -30,7 +30,7 @@
'is_sequence', 'is_string', 'as_list', 'gpaths', 'get_language',
'quote_args', 'get_build_architecture', 'get_info', 'get_pkg_info']

class InstallableLib:
class InstallableLib(object):
"""
Container to hold information on an installable library.
Expand Down
6 changes: 3 additions & 3 deletions numpy/lib/_iotools.py
Expand Up @@ -142,7 +142,7 @@ def flatten_dtype(ndtype, flatten_base=False):



class LineSplitter:
class LineSplitter(object):
"""
Object to split a string at a given delimiter or at given places.
Expand Down Expand Up @@ -228,7 +228,7 @@ def __call__(self, line):



class NameValidator:
class NameValidator(object):
"""
Object to validate a list of strings to use as field names.
Expand Down Expand Up @@ -448,7 +448,7 @@ class ConversionWarning(UserWarning):



class StringConverter:
class StringConverter(object):
"""
Factory class for function transforming a string into another object (int,
float).
Expand Down
4 changes: 2 additions & 2 deletions numpy/linalg/lapack_lite/make_lite.py
Expand Up @@ -36,7 +36,7 @@
'''

class FortranRoutine:
class FortranRoutine(object):
"""Wrapper for a Fortran routine in a file.
"""
type = 'generic'
Expand Down Expand Up @@ -65,7 +65,7 @@ def __init__(self, name):
def dependencies(self):
return []

class FortranLibrary:
class FortranLibrary(object):
"""Container for a bunch of Fortran routines.
"""
def __init__(self, src_dirs):
Expand Down
2 changes: 1 addition & 1 deletion numpy/ma/timer_comparison.py
Expand Up @@ -14,7 +14,7 @@
if sys.version_info[0] >= 3:
from functools import reduce

class moduletester:
class moduletester(object):
def __init__(self, module):
self.module = module
self.allequal = module.allequal
Expand Down
4 changes: 2 additions & 2 deletions numpy/numarray/numerictypes.py
Expand Up @@ -137,11 +137,11 @@ def __getstate__(self):
class BooleanType(NumericType):
pass

class SignedType:
class SignedType(object):
"""Marker class used for signed type check"""
pass

class UnsignedType:
class UnsignedType(object):
"""Marker class used for unsigned type check"""
pass

Expand Down
2 changes: 1 addition & 1 deletion numpy/testing/print_coercion_tables.py
Expand Up @@ -4,7 +4,7 @@
import numpy as np

# Generic object that can be added, but doesn't do anything else
class GenericObject:
class GenericObject(object):
def __init__(self, v):
self.v = v

Expand Down
2 changes: 1 addition & 1 deletion numpy/testing/utils.py
Expand Up @@ -1380,7 +1380,7 @@ def __str__(self):
"line : %r}" % (self.message, self._category_name,
self.filename, self.lineno, self.line))

class WarningManager:
class WarningManager(object):
"""
A context manager that copies and restores the warnings filter upon
exiting the context.
Expand Down

0 comments on commit 2812406

Please sign in to comment.