Re: What is class method?

2008-08-26 Thread Medardo Rodriguez (Merchise Group)
On Tue, Aug 26, 2008 at 4:10 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > In Python, there's *no* relationship between classmethods and metaclasses. In OOP the concept of meta-class has everything to do with class methods, regardless if is in Python, SmallTalk or CLOSS. "classmethod" decor

Re: What is class method?

2008-08-24 Thread Medardo Rodriguez (Merchise Group)
On Sun, Aug 24, 2008 at 4:32 AM, Hussein B <[EMAIL PROTECTED]> wrote: > I'm familiar with static method concept, but what is the class method? > how it does differ from static method? when to use it? "Class Methods" are related to the meta-class concept introduced since the first beginning of OOP

Re: recursively change values in list of lists

2008-08-24 Thread Medardo Rodriguez (Merchise Group)
. I don't know if your inner polygons can contain lines and polygons, or only lines, so: #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2008 Medardo Rodriguez (Merchise Group) # # This is free software; you can redistribute it and/or modify it under # the terms of the GNU Gene

Re: Regex on a huge text

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 4:48 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Does not grep only work a line at a time? Just like the code below? My understanding was that if the regex contains "^" and "$", it will matches in the full file. I wasn't never test it. I tested just before, and didn't wor

Re: Generators can only yield ints?

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 6:44 PM, defn noob <[EMAIL PROTECTED]> wrote: > def letters(): >a = xrange(ord('a'), ord('z')+1) >B = xrange(ord('A'), ord('Z')+1) >while True: >yield chr(a) >yield chr(B) > > > TypeError: an integer is required No. Th

Re: >> and << operators?

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 6:30 PM, defn noob <[EMAIL PROTECTED]> wrote: > What does >> and << do? Normally they are bitwise operators: >> Shifts bits right << Shifts bits left print 1 << 3 8 because 8 = 1000 in binary Regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Generate alphabet?

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 6:02 PM, ssecorp <[EMAIL PROTECTED]> wrote: > .['a'..'z'] for a list of the alphabet. > > Is there a way in Python to generate chars? Not as nice as in Haskell (or other languages), but: [chr(i) for i in xrange(ord('a'), ord('z')+1)] Regards -- http://mail.python.org/mai

Re: Usual practice: running/testing modules in a package

2008-08-22 Thread Medardo Rodriguez (Merchise Group)
On Fri, Aug 22, 2008 at 1:25 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > what if __init__.py contains code? Thats what I usually do to solve the "problem", but for my taste it's better to write the test code of a module inside it. The code I write in "__init__.py" is related to structures o