Cheap Chanel Watches for sale at: http://www.luxuryowner.net/
Chanel Watches collection:
http://www.luxuryowner.net/replica-chanel-watches.html
Chanel J12 Automatic Watches:
http://www.luxuryowner.net/Chanel-J12-Automatic-Watches.html
Chanel J12 Quartz Watches:
http://www.luxuryowner.net/Chan
Cheap Chanel Watches for sale at: http://www.luxuryowner.net/
Chanel Watches collection:
http://www.luxuryowner.net/replica-chanel-watches.html
Chanel J12 Automatic Watches:
http://www.luxuryowner.net/Chanel-J12-Automatic-Watches.html
Chanel J12 Quartz Watches:
http://www.luxuryowner.net/Chan
I may be attempting something improper here, but maybe I'm just going
about it the wrong way. I'm subclassing
http.server.CGIHTTPRequestHandler, and I'm using a decorator to add
functionality to several overridden methods.
def do_decorate(func):
. def wrapper(self):
. if appropriate():
.
d)) for a in alph for b in alph for c in alph for d in
>>> alph
... if (a!=b and b!=c and c!=d and d!=a and b!=d and a!=c)])
358800
>>> len([''.join((a,b,c,d)) for a in alph for b in alph for c in alph for d in
>>> alph
... if (a>b and b>c and c>d)])
14950
cheers,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
Since this is a container that needs to be "immutable, like a tuple",
why not just inherit from tuple? You'll need to override the __new__
method, rather than the __init__, since tuples are immutable:
class a(tuple):
def __new__(cls, t):
return tuple.__new__(cls, t
then that processing should take place in a.__new__.
cheers,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
the yield statement.
thanks,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
msoulier wrote:
> I find that DP junkies don't tend to keep things simple.
+1 QOTW. There's something about these "political" threads that seems
to bring out the best quotes. b^)
--
http://mail.python.org/mailman/listinfo/python-list
ty of the interlocutors. To
summarize: first post is a use case, second post is an implementation
of that use case, and subsequent posts alternate between "that's not
how I want to do it" and "please provide a more specific use case for
which the provided implementation is not
Thanks for the great advice, Alex. Here is a subclass that seems to
work:
from Queue import Queue
from itertools import count
class reentrantQueue(Queue):
def _init(self, maxsize):
self.maxsize = 0
self.queue = [] # so we don't have to override put()
self.counter =
Alex wrote:
> Last, I'm not sure I'd think of this as a reentrantQueue, so
> much as a ReentrantCounter;-).
Of course! It must have been late when I named this class... I think
I'll go change the name in my code right now.
--
http://mail.python.org/mailman/listinfo/python-list
Paul wrote:
>def f():
>lock = threading.Lock()
>i = 0
>while True:
>lock.acquire()
>yield i
>i += 1
>lock.release()
>
> but it's easy to make mistakes when implementing things like that
> (I'm not even totally confident tha
I just noticed, if you don't define maxsize in _init(), you need to
override _full() as well:
def _full(self):
return False
cheers,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
hon?
I started the discussion with simpler versions of these same questions.
I'm convinced that using Queue is safe, but now I'm not convinced that
just using a generator is not safe.
cheers,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
d. If it matters, I'm using 2.6,
but I can change versions if it will help.
Should I give up on this, or is there something else I can try? Keep
in mind, I must redefine __eq__(), and I'd like to be able to compare
instances of the class to both set and frozenset instances.
cheers,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
return True
> return super(eqmixin, self).__eq__(other)
>
> class frozenset(eqmixin, frozenset):
> pass
That's nice, but it means that everyone who imports my class will have
to import the monkeypatch of frozenset, as well. I'm not sure I want
tha
On Oct 29, 3:54 pm, Mick Krippendorf wrote:
> Jess Austin wrote:
> > That's nice, but it means that everyone who imports my class will have
> > to import the monkeypatch of frozenset, as well. I'm not sure I want
> > that. More ruby than python, ne?
>
> I t
It may be
best not to sully such generalized code with a special case for
this.
I may do some experiments with bytes, str, and unicode, since that
seems to be an analogous case. There is a basestring type, but at
this point I don't know that it really helps with anything.
cheers,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
ozenset()
True
I doubt that either of these invariants is amenable to modification,
even for purposes of "consistency". I'm not sure how to resolve this,
but you've definitely helped me here. Perhaps the test in
set_richcompare can return NotImplemented in particular cases but not
in others? I'll think about this; let me know if you come up with
anything more.
thanks,
Jess
--
http://mail.python.org/mailman/listinfo/python-list
19 matches
Mail list logo