Package topo :: Package misc :: Module asizeof :: Class Asizer
[hide private]
[frames] | no frames]

Class Asizer

source code


Sizer state and options.
Instance Methods [hide private]
 
__init__(self, **opts)
See method reset for the available options.
source code
 
_clear(self)
Clear state.
source code
 
_nameof(self, obj)
Return the object's name.
source code
 
_prepr(self, obj)
Like prepr().
source code
 
_prof(self, key)
Get _Prof object.
source code
 
_repr(self, obj)
Like repr().
source code
 
_sizer(self, obj, deep, sized)
Size an object, recursively.
source code
 
_sizes(self, objs, sized=None)
Return the size or an Asized instance for each given object and the total size.
source code
 
asized(self, *objs, **opts)
Size each object and return an Asized instance with size information and referents up to the given detail level (and with modified options, see method set).
source code
 
asizeof(self, *objs, **opts)
Return the combined size of the given objects (with modified options, see also method set).
source code
 
asizesof(self, *objs, **opts)
Return the individual sizes of the given objects (with modified options, see also method set).
source code
 
exclude_refs(self, *objs)
Exclude any references to the specified objects from sizing.
source code
 
exclude_types(self, *objs)
Exclude the specified object instances and types from sizing.
source code
 
print_profiles(self, w=0, cutoff=0, **print3opts)
Print the profiles above cutoff percentage.
source code
 
print_stats(self, objs=(), opts={}, sized=(), sizes=(), stats=3.0, **print3opts)
Print the statistics.
source code
 
print_summary(self, w=0, objs=(), **print3opts)
Print the summary statistics.
source code
 
print_typedefs(self, w=0, **print3opts)
Print the types and dict tables.
source code
 
set(self, align=None, code=None, detail=None, limit=None, stats=None)
Set some options.
source code
 
_get_duplicate(self)
Number of duplicate objects.
source code
 
_get_missed(self)
Number of objects missed due to errors.
source code
 
_get_total(self)
Total size accumulated so far.
source code
 
reset(self, align=8, all=False, clip=80, code=False, derive=False, detail=0, ignored=True, infer=False, limit=100, stats=0)
Reset options, state, etc.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _align_ = 8
int(x[, base]) -> integer
  _all_ = False
bool(x) -> bool
  _clip_ = 80
int(x[, base]) -> integer
  _code_ = False
bool(x) -> bool
  _derive_ = False
bool(x) -> bool
  _detail_ = 0
int(x[, base]) -> integer
  _infer_ = False
bool(x) -> bool
  _limit_ = 100
int(x[, base]) -> integer
  _stats_ = 0
int(x[, base]) -> integer
  _cutoff = 0
int(x[, base]) -> integer
  _depth = 0
int(x[, base]) -> integer
  _duplicate = 0
int(x[, base]) -> integer
  _excl_d = None
  _ign_d = 'ignored'
str(object) -> string
  _incl = ''
str(object) -> string
  _mask = 7
int(x[, base]) -> integer
  _missed = 0
int(x[, base]) -> integer
  _profile = False
bool(x) -> bool
  _profs = None
  _seen = None
  _total = 0
int(x[, base]) -> integer
Properties [hide private]
  duplicate
Number of duplicate objects.
  missed
Number of objects missed due to errors.
  total
Total size accumulated so far.

Inherited from object: __class__

Method Details [hide private]

__init__(self, **opts)
(Constructor)

source code 
See method reset for the available options.
Overrides: object.__init__

_sizes(self, objs, sized=None)

source code 
Return the size or an Asized instance for each given object and the total size. The total includes the size of duplicates only once.

asized(self, *objs, **opts)

source code 

Size each object and return an Asized instance with size information and referents up to the given detail level (and with modified options, see method set).

If only one object is given, the return value is the Asized instance for that object.

exclude_refs(self, *objs)

source code 

Exclude any references to the specified objects from sizing.

While any references to the given objects are excluded, the objects will be sized if specified as positional arguments in subsequent calls to methods asizeof and asizesof.

exclude_types(self, *objs)

source code 

Exclude the specified object instances and types from sizing.

All instances and types of the given objects are excluded, even objects specified as positional arguments in subsequent calls to methods asizeof and asizesof.

print_profiles(self, w=0, cutoff=0, **print3opts)

source code 

Print the profiles above cutoff percentage.

w=0 -- indentation for each line cutoff=0 -- minimum percentage printed print3options -- print options, as in Python 3.0

print_stats(self, objs=(), opts={}, sized=(), sizes=(), stats=3.0, **print3opts)

source code 

Print the statistics.

w=0 -- indentation for each line objs=() -- optional, list of objects opts={} -- optional, dict of options used sized=() -- optional, tuple of Asized instances returned sizes=() -- optional, tuple of sizes returned stats=3.0 -- print statistics and cutoff percentage print3options -- print options, as in Python 3.0

print_summary(self, w=0, objs=(), **print3opts)

source code 

Print the summary statistics.

w=0 -- indentation for each line objs=() -- optional, list of objects print3options -- print options, as in Python 3.0

print_typedefs(self, w=0, **print3opts)

source code 

Print the types and dict tables.

w=0 -- indentation for each line print3options -- print options, as in Python 3.0

set(self, align=None, code=None, detail=None, limit=None, stats=None)

source code 

Set some options. Any options not set remain the same as the previous setting.

align=8 -- size alignment code=False -- incl. (byte)code size detail=0 -- Asized refs level limit=100 -- recursion limit stats=0.0 -- print statistics and cutoff percentage

reset(self, align=8, all=False, clip=80, code=False, derive=False, detail=0, ignored=True, infer=False, limit=100, stats=0)

source code 

Reset options, state, etc.

The available options and default values are:

align=8 -- size alignment all=False -- all current GC objects and referents clip=80 -- clip repr() strings code=False -- incl. (byte)code size derive=False -- derive from super type detail=0 -- Asized refs level ignored=True -- ignore certain types infer=False -- try to infer types limit=100 -- recursion limit stats=0.0 -- print statistics and cutoff percentage

See function asizeof for a description of the options.


Class Variable Details [hide private]

_align_

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
8

_all_

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
False

_clip_

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
80

_code_

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
False

_derive_

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
False

_detail_

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
0

_infer_

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
False

_limit_

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
100

_stats_

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
0

_cutoff

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
0

_depth

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
0

_duplicate

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
0

_ign_d

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'ignored'

_incl

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
''

_mask

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
7

_missed

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
0

_profile

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Value:
False

_total

int(x[, base]) -> integer

Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.

Value:
0

Property Details [hide private]

duplicate

Number of duplicate objects.
Get Method:
_get_duplicate(self) - Number of duplicate objects.

missed

Number of objects missed due to errors.
Get Method:
_get_missed(self) - Number of objects missed due to errors.

total

Total size accumulated so far.
Get Method:
_get_total(self) - Total size accumulated so far.