# -*- coding: iso-8859-15 -*-
# The MIT License (MIT)
#
# Copyright  2014 Tim Bielawa <timbielawa@gmail.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

"""
Reference material:

Prefixes for binary multiples:
http://physics.nist.gov/cuu/Units/binary.html

decimal and binary prefixes:
man 7 units (from the Linux Documentation Project 'man-pages' package)
"""


class Bit(object):
    """The base class for all the other prefix classes"""
    def __init__(self, value='0b'):
        self.value = value

    def _norm(self):
        """Normalize the input value into a common base value"""
        pass

    def _guess_prefix(self, prefix):
        """Figure out which system the number is given in: NIST Binary, or
SI. Well... take our best shot at it anyway."""
        pass

    # Reference: http://docs.python.org/2.7/reference/datamodel.html#basic-customization

    def __repr__(self):
        """Called by the repr() built-in function and by string conversions
(reverse quotes) to compute the "official" string representation of an
object. If at all possible, this should look like a valid Python
expression that could be used to recreate an object with the same
value (given an appropriate environment). If this is not possible, a
string of the form <...some useful description...> should be
returned. The return value must be a string object. If a class defines
__repr__() but not __str__(), then __repr__() is also used when an
"informal" string representation of instances of that class is
required."""
        pass

    def __str__(self):
        """Called by the str() built-in function and by the print statement to
compute the "informal" string representation of an object. This
differs from __repr__() in that it does not have to be a valid Python
expression: a more convenient or concise representation may be used
instead. The return value must be a string object."""
        pass

    # Reference: http://docs.python.org/2.7/reference/datamodel.html#emulating-numeric-types

    """These methods are called to implement the binary arithmetic
operations (+, -, *, //, %, divmod(), pow(), **, <<, >>, &, ^, |). For
instance, to evaluate the expression x + y, where x is an instance of
a class that has an __add__() method, x.__add__(y) is called. The
__divmod__() method should be the equivalent to using __floordiv__()
and __mod__(); it should not be related to __truediv__() (described
below). Note that __pow__() should be defined to accept an optional
third argument if the ternary version of the built-in pow() function
is to be supported.

If one of those methods does not support the operation with the
supplied arguments, it should return NotImplemented."""

    def __add__(self, other):
        pass

    def __sub__(self, other):
        pass

    def __mul__(self, other):
        pass

    def __floordiv__(self, other):
        pass

    def __mod__(self, other):
        pass

    def __divmod__(self, other):
        pass

    def __pow__(self, other, modulo=None):
        pass

    def __lshift__(self, other):
        pass

    def __rshift__(self, other):
        pass

    def __and__(self, other):
        pass

    def __xor__(self, other):
        pass

    def __or__(self, other):
        pass

    def __div__(self, other):
        pass

    def __truediv__(self, other):
        """The division operator (/) is implemented by these methods. The
__truediv__() method is used when __future__.division is in effect,
otherwise __div__() is used. If only one of these two methods is
defined, the object will not support division in the alternate
context; TypeError will be raised instead."""
        pass

    def __neg__(self):
        pass

    def __pos__(self):
        pass

    def __abs__(self):
        pass

    def __invert__(self):
        """Called to implement the unary arithmetic operations (-, +, abs()
and ~)."""
        pass

@@ -1167,17 +1167,16 @@
 RE.%0A%0A%22%22%22
-%0A
 Referenc
@@ -1366,16 +1366,162 @@
 ackage)%0A
+%0A%0ARandom side note: These are prefixes because they modify the 'byte' or%0A'bit' unit. They don't appear before the numerical value they%0Adescribe.%0A%0A
 %22%22%22%0A%0A%0Acl
@@ -1631,16 +1631,97 @@
 ='0b'):%0A
+        %22%22%22If %60value%60 is given without a prefix, we default to assuming bits.%22%22%22%0A
         
@@ -4478,90 +4478,8 @@
 ss%0A%0A
-    def __div__(self, other):%0A        pass%0A%0A    def __truediv__(self, other):%0A    
     
@@ -4781,24 +4781,103 @@
  instead.%22%22%22
+%0A%0A    def __div__(self, other):%0A        pass%0A%0A    def __truediv__(self, other):
 %0A        pas

Move comments