Skip to content

Commit

Permalink
Added a summary to the ptype.block class from the ptypes library that…
Browse files Browse the repository at this point in the history
… displays the block size.
  • Loading branch information
arizvisa committed Jun 19, 2024
1 parent 1b6df57 commit f539142
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ptypes/ptype.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,10 @@ def repr(self):
if self.blocksize() > 0:
return self.details() + '\n'
return self.summary()
def summary(self):
if self.initializedQ():
return '...' if self.length is None and self.size() == 0 else "({:d}) {:s}".format(self.size(), super(block, self).summary())
return super(block, self).summary(self)
def __setvalue__(self, *values, **attrs):
"""Set entire type equal to ``value``"""
if not values:
Expand Down

0 comments on commit f539142

Please sign in to comment.