]> git.alrj.org Git - bold.git/blob - Bold/BinArray.py
Cleaning and refactoring.
[bold.git] / Bold / BinArray.py
1 # -*- coding: utf-8 -*-
2
3 # kate: space-indent on; indent-width 2; mixedindent off; indent-mode python;
4
5 # Copyright (C) 2009 Amand 'alrj' Tihon <amand.tihon@alrj.org>
6 #
7 # This file is part of bold, the Byte Optimized Linker.
8 #
9 # You can redistribute this file and/or modify it under the terms of the
10 # GNU Lesser General Public License as published by the Free Software
11 # Foundation, version 2.1.
12
13 from array import array
14 import struct
15
16 class BinArray(array):
17   """A specialized array that contains bytes"""
18   def __new__(cls, data=None):
19     if data:
20       return array.__new__(BinArray, "B", data)
21     else:
22       return array.__new__(BinArray, "B")