;ò
†¨(Fc           @   s?  d  Z  d k l Z l Z l Z l Z d e f d „  ƒ  YZ e d d d ƒ Z d Z e e d d ƒ e d	 e ƒ Z	 e
 d
 „  e i ƒ  ƒ Z e i ƒ  xx e D]p Z e d o qš n d e e Z y d e e e f d UWn( e j
 o d e e e f d Un Xe Z qš W[ [ [ [ [ [ [ e e e f \ Z Z Z d S(   s   Description of bytes, including the kilo = 1024 twist ...

but note kibi, mibi etc. should obsolete these; see quantity.py

See also: units.py
(   s	   base_units   Quantitys   qSamples   _quantifier_dictionarys	   bQuantityc           B   s    t  Z d „  Z d „  Z e Z RS(   Nc         C   sV   y | d } Wn t j
 o d } n X| o |  i | | ƒ Sn t | | ƒ Sd  S(   Ns   biti    (   s   unitss   orders   KeyErrors   selfs	   __class__s   whats   Quantity(   s   selfs   whats   unitss   order(    (    s&   /home/eddy/.sys/py/study/value/byte.pys	   _quantity
   s       c   
      C   sÇ  |  i d ƒ }	 |  i |	 ƒ \ } } | d j  o d d f \ } } n |  t | t |	 ƒ } | i	 ƒ  } | i
 | i f \ } } |	 d j o£ |	 d j o | d } n d | |	 f } | og | i d ƒ } | d j  o | d | } q.| d j o | |  d | | | } q.| | } qx| } nG |	 d j  o9 |	 d	 j o d
 | | f } qxd | | |	 f } n | | f \ |  _
 |  _ | d j o | Sn | d j o | Sn
 t | ‚ d  S(   Ns   biti   s    i    s   bytes
   %sbyte^%d^s   /s   .iÿÿÿÿs	   %s/%sbytes   %s/%sbyte^%d^s	   _unit_strs   _number_str(   s   selfs   _unit_orders   orders   _quantade_split_s   factors   muls   pows   bytes   tails
   _primitives   _number_strs	   _unit_strs   nums   unis   heres   finds   inds   keys
   ValueError(
   s   selfs   keys   heres   tails   nums   factors   inds   muls   unis   order(    (    s&   /home/eddy/.sys/py/study/value/byte.pys   _lazy_get__unit_str_   s:        
   (   s   __name__s
   __module__s	   _quantitys   _lazy_get__unit_str_s   _lazy_get__number_str_(    (    (    s&   /home/eddy/.sys/py/study/value/byte.pys	   bQuantity	   s   		s   bits±   The definitive unit of binary data.

A single binary digit is capable of exactly two states, known as 0 and 1.
A sequence of n binary digits thus has pow(2, n) possible states.
s   bytes   besti   sØ  The standard unit of memory on a computer.

Whereas the bit is the *natural* unit of binary data, in practice one normally
manipulates data in larger chunks.  These may vary from machine to machine, but
one mostly deals with multiples of 8 bits (these days) - these suffice for 256
distinct values.  An 8-bit byte is also known as an `octet'.

Groups of (typically 2, 4, 8 and sometimes higher powers of two) bytes tend to
have special significance to the machine, and form the building blocks out of
which one builds data structures.

On the large scale, one tends to measure amounts of data in units of kilobytes,
megabytes, gigabytes, ... in which the factor by which each is a multiple of its
predecessor is 1024, rather than the 1000 normally used in kilo, mega, giga ...
So I also define Kb, Mb, Gb, along with the full swath of positive-exponent
quantifiers applied to byte, as kilobyte etc. above.  Indeed, it is mainly in
order to do this that I bother defining the byte ...
c         C   s
   |  d j S(   Ni    (   s   x(   s   x(    (    s&   /home/eddy/.sys/py/study/value/byte.pys   <lambda>O   s    i   s   %sbytes!   %s = Quantity(1024, %s, nom="%s")Ns"   %s = Quantity(1024L, %s, nom="%s")(   s   __doc__s   quantitys	   base_units   Quantitys   qSamples   _quantifier_dictionarys	   bQuantitys   bits   _names   bytes   filters   keyss   _rows   sorts   _keys   _noms   OverflowErrors   kilobytes   megabytes   gigabytes   Kbs   Mbs   Gb(   s	   base_units   qSamples   Kbs   _keys   _noms	   bQuantitys   _names   _quantifier_dictionarys   _rows   Gbs   bits   bytes   Mbs   Quantity(    (    s&   /home/eddy/.sys/py/study/value/byte.pys   ?   s.   (			
   
