Skip to content

Instantly share code, notes, and snippets.

View LewisGaul's full-sized avatar
🪲

Lewis Gaul LewisGaul

🪲
View GitHub Profile
@LewisGaul
LewisGaul / str_array.py
Created March 25, 2018 19:11
Mutable string array with most string methods treating it as a string
from functools import wraps
def use_str(method, self):
@wraps(method)
def new_method(*args, **kwargs):
return getattr(self.__str__(), method.__name__)(*args, **kwargs)
return new_method
class Buffer(bytearray):