DavidBuchanan314 / unsafe-python

A library to assist writing memory-unsafe code in "pure" python, without any imports (i.e. no ctypes etc.)
MIT License
217 stars 6 forks source link

Overflow error #5

Closed freQuensy23-coder closed 4 months ago

freQuensy23-coder commented 5 months ago

In [1]: import unsafe

In [2]: unsafe.getmem Out[2]: <function unsafe.getmem()>

In [3]: unsafe.getmem() Out[3]: --------------------------------------------------------------------------- OverflowError Traceback (most recent call last) File ~/Documents/venv/lib/python3.11/site-packages/IPython/core/formatters.py:711, in PlainTextFormatter.call(self, obj) 704 stream = StringIO() 705 printer = pretty.RepresentationPrinter(stream, self.verbose, 706 self.max_width, self.newline, 707 max_seq_length=self.max_seq_length, 708 singleton_pprinters=self.singleton_printers, 709 type_pprinters=self.type_printers, 710 deferred_pprinters=self.deferred_printers) --> 711 printer.pretty(obj) 712 printer.flush() 713 return stream.getvalue()

File ~/Documents/venv/lib/python3.11/site-packages/IPython/lib/pretty.py:411, in RepresentationPrinter.pretty(self, obj) 408 return meth(obj, self, cycle) 409 if cls is not object \ 410 and callable(cls.dict.get('repr')): --> 411 return _repr_pprint(obj, self, cycle) 413 return _default_pprint(obj, self, cycle) 414 finally:

File ~/Documents/venv/lib/python3.11/site-packages/IPython/lib/pretty.py:779, in _reprpprint(obj, p, cycle) 777 """A pprint that just redirects to the normal repr function.""" 778 # Find newlines and replace them with p.break() --> 779 output = repr(obj) 780 lines = output.splitlines() 781 with p.group():

OverflowError: bytearray object is too large to make repr

Im using python 3 11 9

DavidBuchanan314 commented 5 months ago

This is expected behaviour, the bytearray is indeed too large to make repr