Re: tests

2007-08-09 Thread dijkstra . arjen
On Aug 9, 4:04 pm, brad <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > You should be able to read chunks of each file in binary mode and do a
> > compare to check for equality. Some kind of loop should do the trick.
>
> Why not a simple md5 or sha with the hash library?

Or even:

http://docs.python.org/lib/module-filecmp.html

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about properties.

2007-08-10 Thread dijkstra . arjen
On Aug 10, 12:21 pm, king kikapu <[EMAIL PROTECTED]> wrote:
> Hi,
>
> i read in a book the following code snippet that is dealing with
> properties:
>
> class ProtectAndHideX(object):
> def __init__(self, x):
> assert isinstance(x, int), '"x" must be an integer!"'
> self.__x = ~x
>
> def get_x(self):
> return ~self.__x
>
> x = property(get_x)
>
> Can anyone please help me understand what the symbol "~" does here ??
>
> Thanks for any help!

>>> help(2)

 |  __invert__(...)
 |  x.__invert__() <==> ~x



hth.
Duikboot


-- 
http://mail.python.org/mailman/listinfo/python-list