a dictionary of actions and a dictionary of movable objects.
> Along with methods that work on objects... Working an action that digs
> into other objects may take some doing.
[snip]
I don't know about you, but I usually start with specific cases like
this and then generalize them. This could be a baby step, or merely a
first stage of evolution.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
> --Brian
>
> ---
>
> Thanks Steve and Brian,
>
> Brian: that is !!
>
> However, it's a bit difficult to understand now. I have read it several
> times :)
A list comp is straightforwardly equivalent to nested for loops. To
read, it may be easeier to write it out as loops:
l = []
for z in t:
for x in z:
l.append(x)
Which, you'll note, it the same as your working code only with
different names.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
appen.
> The general consensus is that Python 3.x isn't much of an
> improvement over the existing language.
I'm going to have to opine that you pulled this out of your ass.
> There's just not much demand for it.
Well that's a little mode defensible seeing that w
ve to do
something that doesn't fit the framework anticipated by the language
designer.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
h disk loading on demand could be a good choice.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
guess." How do you know if the bytes are utf-8
encoded?
I'm not sure if str() returning the repr() of a bytes object (when not
passed an encoding) is the right thing, but it's probably better than
throwing an exception. The problem is, str can't decide whether it's
a
On Apr 12, 11:51 am, Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On 12 Apr., 16:29, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > > And making an utf-8 encoding default is not possible without writing a
> > > new function?
>
> > I believe the Zen in effe
ansition to Java than to C++ from just about any
starting point.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
memory data structure won't be swapped--but a database solution should
at least be considered here.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 11, 12:08 pm, "Neil Cerutti" <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 10, 2008 at 8:25 PM, Carl Banks <[EMAIL PROTECTED]> wrote:
> > On Apr 10, 2:20 pm, Tommy Nordgren <[EMAIL PROTECTED]> wrote:
>
> > > On 9 apr 2008, at 03.01, [EMAIL PROTE
m in
> my opinion. And also a fiendish way to make code
> inscrutible -- which I thought was more of a Perl thing
> than a Python thing, or should be.
>
> I must be missing some of the deeper issues here. Please
> educate me.
The deeper issue is that you're benefiting from
t it's not, by itself, a good
thing.
For the record, I am not complaining about that GIL. As I said, I
understand and approve of why it's there. I am, however, complaining
about attitude that if you want to be free of the GIL you're doing
something wrong.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 17, 4:41 am, Sverker Nilsson <[EMAIL PROTECTED]> wrote:
> On Apr 17, 12:02 am, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Apr 16, 12:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote:
>
> > > On Apr 16, 12:27 pm, Rhamphoryncus <[EM
On Apr 17, 1:03 pm, Jonathan Gardner <[EMAIL PROTECTED]>
wrote:
> On Apr 17, 1:18 am, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > On Apr 17, 3:37 am, Jonathan Gardner <[EMAIL PROTECTED]>
> > wrote:
> > > If you can't rewrite
> > > your al
string%dict was just left in it wouldn't be an issue.
>
> Also, if making f(**d) support dict emulation
> has any negative performance implications
> then I don't want it please.
>
> sigh. -- Aaron Watters
If you don't like Python 3, DON'T USE IT.
It's been stated repeatedly that 2.x and 3.x are going to be supported
in parallel for years.
Refusing to use 3, thus casting your brain-share vote against it, is
far more likely to have an effect than you coming here and making
everyone's life miserable with your pitiful whining.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
.3.
(I bring this up to illustrate that if there are people clamoring for
a 2.3 updates, there are probably quite a few supporting 2.4 as well.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 20, 10:57 pm, [EMAIL PROTECTED] (Aahz) wrote:
> In article <[EMAIL PROTECTED]>,
> Carl Banks <[EMAIL PROTECTED]> wrote:
>
> >On Apr 17, 3:37 am, Jonathan Gardner <[EMAIL PROTECTED]>
> >wrote:
>
> >> Using 100% of the CPU is a bug, not a fe
On Apr 21, 9:20 am, [EMAIL PROTECTED] (Aahz) wrote:
> In article <[EMAIL PROTECTED]>,
> Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> >On Apr 20, 10:57 pm, [EMAIL PROTECTED] (Aahz) wrote:
> >> In article <[EMAIL PROTECTED]>,
> >> Carl
e no end of an ass!"
The crowd roared with laughter. The man was humiliated again. But
the social winked at him, indicating that he would soon give the clown
the perfect retort. The old man couldn't wait to hear what it was.
Suddenly the social worker stood up and shouted, "Hey clown!"
The crowd hushed, and clown whirled around to look at him.
"F**k you!"
(It makes even more sense when you consider that Perl programmers
pretty much are clowns.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
why I wholeheartedly favor MI: it allows
classes to share behavior with restraints.
Java (for example) allows a class to share behavior with only one
other class, and that *severely* limits the opportunities to minimize
redundancy.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 22, 10:36 am, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Apr 22, 10:22 am, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > Java (for example) allows a class to share behavior with only one
> > other class, and that *severely* limits the opportunities to mi
>
> But the *goal* of the polymorphy is mainly to have shared behavior.
Not at all. The goal of polymorphism is to have objects of different
types usable in the same situation. Two such classes might share some
behavior, but they don't have to.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
s at the same time it does support the += operator ???
Because "Features A and B are in language X. Python adds Feature A.
Therefore Python must also add Feature B (or it'll be weird)" is not
valid logic.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 25, 9:37 am, Neal Becker <[EMAIL PROTECTED]> wrote:
> On linux, I don't understand why:
>
> f = open ('/dev/eos', 'rw')
> m = mmap.mmap(f.fileno(), 100, prot=mmap.PROT_READ|mmap.PROT_WRITE,
> flags=mmap.MAP_SHARED)
>
> gives 'pe
On Apr 26, 11:10 am, n00m <[EMAIL PROTECTED]> wrote:
> Both codes below read the same huge(~35MB) text file.
> In the file > 100 lines, the length of each line < 99 chars.
>
> Stable result:
> Python runs ~0.65s
> C : ~0.70s
>
> Any thoughts?
Yes.
Most of the dirty work in the Python example
On Apr 26, 12:15 pm, n00m <[EMAIL PROTECTED]> wrote:
> fgets() from C++ iostream library???
Sheesh. That'll teach me to read carefully. (Ok, it probably won't.)
Other two points still apply.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
e,
that is true. But it returns None mostly to avoid confusing the user,
who is likely to assume that the operation is non-destructive (or
forget that it isn't).
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
in(u"x")
> > yields an unicode object. This is confusing (but will probably go
> > away with Python 3).
>
> It is only ugly because you aren't used to seeing method calls on string
> literals.
I'm used to seeing it and I think it's ugly.
imple), use ConfigParser, or use a
Python file that you exec.
Store the file in $HOME/.appname/config.ext on Unix, $USERDIR/
ApplicationData/Appname/config.ext on Windows. I don't recommend
using the Windows registry to store options; use it to modify Windows
behavior (like file ass
On May 1, 1:30 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> On Thu, 01 May 2008 09:45:28 -0700, Carl Banks wrote:
> > On May 1, 12:11 pm, Jon Ribbens <[EMAIL PROTECTED]> wrote:
> >> On 2008-05-01, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
>
> >>
On May 1, 4:50 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> On Thu, 01 May 2008 11:56:20 -0700, Carl Banks wrote:
> > On May 1, 1:30 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> >> On Thu, 01 May 2008 09:45:28 -0700, Carl Banks wrote:
> >> &g
On May 1, 7:54 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> No, all I want is to give the OP a useful alternative
Fair enough, I can't argue with that.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
tos de programa" y "Archivos de
> Programa" respectively, and the user may choose to move them to another
> location.
> Use SHGetFolderPath to obtain the path; see
> http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx
Thanks for the heads up: wasn't aware tho
housands of programs and
> modules that has to run out of the box on whatever system the client
> happens to run on.
If you're shipping a program that large you out to be packaging the
Python interpreter with it.
Frankly, this whole discussion is silly, as if it's some kind hard
th
tep process:
Yes, this will be atomic. It's a pretty good idea, in fact. The
underlying increment operation is protected by the GIL; it could be
three, forty, or a hundred steps and it'd be atomic at the Python
level.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
):
thread1=timer()
thread2=timer()
thread1.start()
thread2.start()
thread1.join()
thread2.join()
print 'final count:', count
print ' should be:', 2*N
if __name__=='__main__':
test()
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On May 4, 2:13 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> However, what I said was not wholly untrue: code in C extensions is
> protected by the GIL and thus not interruptable, unless it either
> releases the GIL, or calls back into Python code (which is apparently
> what numpy
on is very low for most projects. And even when it did
> happen, the evil corporation would likely submit patches.
The Wine project changed from MIT (I think) to LGPL because evil
corporations were hijacking its source code and not submitting
patches. It happens.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
rned about its viral aspects moreso than the
requirement to contribute back released changes.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ing
used only in open source packages.
LGPL? No, there is probably no reason to have a serious problem with
that if you're going to submit patches, but GPL, yes.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On May 7, 3:51 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Carl Banks <[EMAIL PROTECTED]> writes:
> > Nonsense. They could be more than willing to contribute their
> > patches, but aren't willing to accept the GPL's limitation to being
> > used
o involved with Apache, which does have a permissive
license.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
in the subscript opreator rules.
The effect of this is that the grouping a.(b[c]) is impossible.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
nux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'A'
>>> b = "%c" % a
>>> a
'A'
>>> b
'A'
>>> a is b
False
> You must not rely on the
> optimization.
Good advice.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
u.
Calling a nested function to perform cleanup is prone to omission
errors, and it doesn't guarantee that cleanup will happen if an
exception is raised.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 15, 3:42 pm, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > IOW, there is currently no recommended way to do *anything* with
> > annotations(**). That is entirely left up to users and third-party
> > packages, and the PEP goes out
On Aug 17, 9:34 am, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
> Carl Banks schrieb:
>
> > You are free to use it for other things. For example, the following
> > usage is obvious and sensible (insofar as listing exceptions is
> > sensible):
>
> >
On Aug 17, 7:25 pm, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > If it bothers you that much, go file a bug report. Someone might even
> > change it. But it's nothing but needless pedantry.
>
> Has my "de" domain inspired y
ed to the nearest integer.
> Maybe there's an interpolation operator?
There's nothing built in, but see the bisect module. It is a good way
to determine which interval you are in, and you can interpolate the
points yourself.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
name = substitutions.get(name,name)
...
-0 on adding a warning that's disbaled by default.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 23, 4:09 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 22 Aug 2008 20:37:09 -0700, Carl Banks wrote:
> > On Aug 22, 10:42 am, Steven D'Aprano <[EMAIL PROTECTED]
> > cybersource.com.au> wrote:
> >> Sometimes it seems
On Aug 26, 8:19 am, 一首诗 <[EMAIL PROTECTED]> wrote:
> What's your first choice when you have write a C/C++ module for Python?
1. Plain C code
2. Implement my own C extension code generator in Python
3. ctypes
...
...
Infinity. SWIG
Carl Banks
--
http://mail.python.org/mailman/l
xecute "print k['1']"?
Best I can tell, you want some sort of association list like this:
k = []
k.append(("1","Tom"))
k.append(("1","Tommy"))
which you can iterate through like this:
for key,value in k:
And if you need to retrieve items with a certain "key", probably it's
easiest to maintain sorted invariant, and to do insertion and lookup
with bisection algorithm (see bisect module).
I don't know of any class in the standard library that does all that
for you though.
Out of curiosity, what does a true multimap solve that a dictionary of
lists not solve?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 28, 2:41 pm, brad <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > Out of curiosity, what does a true multimap solve that a dictionary of
> > lists not solve?
>
> Nothing really. I went with a variation of the suggested work around...
> it's just that w
o, sometimes files fail to open for other reasons, such
as permissions.
For things like divide-by-zero, there's no way a local value can
change between the zero test and the operation (except in uncommon
situations), so it's just a matter of style which way you do it.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
t to check for errors".
I tend to use EAFP to check if something "wrong" happened (a missing
file, invalid input, etc.), and LBYL for expected conditions that can
occur with valid input, even when that condition could be tested with
a try...except. For instance, I'd write something like this:
if x is not None:
y = x.calculate_value()
else:
y = default_value
Main reason I do this is to document that None is an expected and
valid value for x, and not incidative of a problem. But it's purely a
matter of style and neither way is wrong.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 30, 2:03 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > I wouldn't say that the possibility of EAFP in Python makes it
> > obsolute to use LBYL.
>
> when using CPython, EAFP at the Python level always involve LBYL at the
> C leve
ect has no attribute '%s'" %
attr)
self.__dict__[attr] = val
def __init__(self,x):
self.y = x
I suspect most people who go into Python doing something like this
soon abandon it when they see how rarely it actually catches anything.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
f):
self._cursor = VanillaCursor()
self._connected = False
def __getattr__(self,attr):
if not self._connected:
self._cursor.connect()
self._connected = True
return getattr(self._cursor,attr)
cursor = SuperCursor()
That doens't use a mixin, but why should it?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
an unhealthy extreme. A mixin is simply the wrong tool
to do this with.
My advice: either use a proxy, or manage your connections better.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 4, 3:15 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> On 4 ÓÅÎÔ, 22:59, Carl Banks <[EMAIL PROTECTED]> wrote:
> > You can write code to guard against this if you want:
>
> > class A:
> > legal = set(["x"])
> > def __setattr
u can do it manually with Open Office. <http://www.openoffice.org/>
> A free office suite.
On Debian there is a package called "unoconv"--written in Python--that
can do the conversions from the command line. It requires a running
instance of Open Office. However, the doc-to-txt conversion of Open
Office isn't that good. (It wasn't as good as Word's formatted text
converter, last time I used it.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
solution, but
I'd like to point out that this is also trivially easy with recursion:
def print_nodes(element, ancestors = []):
s = hierarchy = ancestors + ["<" + element.tag + ">"]
if element.text is not None:
s = s + [element.text]
print " &qu
he slot in the object structure
by
querying the member descriptor of the type object.
descr = GetAttrString(cls,"varname");
offset = descr->d_member->offset;
slotvar = (PyObject*)(((char*)obj)+offset)
There might be some macros to simplify this.
Use at your own risk.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ious.
The offsetof() macro would help for the third line (in fact, it's the
recommended standard way since there are some C implmentions,
somewhere, that the pointer artithmetic method fails).
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
you're stuck with using threads in a standard Python release.
Generators can't serve as coroutines when you're yielding from a
nested call (they only go one level deep).
You can get coroutines with Stackless Python, a non-standard version
of Python. But even with Stackless I got the impression that you'd be
building coroutines atop something that was fairly thread-like. There
is no coroutine syntax.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 12, 12:35 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Steve Holden wrote:
> > The defence rests.
>
> can you please stop quoting that guy, so we don't have to killfile you
> as well...
Guy?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
to an A.I.'s.
>
> Your various outpourings appear so rambling and ill-conceived that
> silence is often the only polite response.
>
> If you are flattered to be compared to an AI you must come from the same
> race as Mr. Spock in Star Trek.
I'm surprised there is anyone who still gives castironpi credit for
being fully human.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
7;)
> cfile.write('and the web browser converts it. ')
> cfile.write(' http://python.about.com/
> index.html">Click me! ')
> cfile.write('The wording of your request was: "%s"' %(line))
> cfile.write('')
>
> cfile.close()
> csock.close()
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
you should never output anything you receive through the
network without checking it or escaping it to prevent malicious uses.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
.modules[__name__] or write a separate function to return the
appropriate nested module of __name__. Neither method is foolproof I
don't think.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
n't list an obvious way to report bugs so I wonder
if they're using bugs.python.org? Hope not)
If not, the OP should ask on the setuptools mailing list.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
e
or less) define what Python is, not trendy computer science catch
words.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ruth value of an expression...
And some would argue that it was wrong to have such a wide definition
for the truth value of an expression in the first place...
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ld be better for that, since it would
be a pretty complex thing that would benefit only a tiny fraction of
users.)
Carl Banks
(**) Actually the compiler can do some compile-time constant
expression folding, but that's about it. Otherwise it's object
agnostic.
--
http://mail.python.org/mailman/listinfo/python-list
might not want to do that.
For that matter, a library should never print error or status
messages. Messages should either be sent to the caller somehow, or
handled using the logging facility.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
never I write Blender plugins I usually do all the dirty work with
numpy.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
acts like threading
module but uses processes. I think you can still run it as a third-
party module in 2.5.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ide-effects can and
are supposed to happen in the process of trying.
Anyway, this proposal can easily be implemented more or less as
proposed without any syntax changes, using the same ideas as the
multimethod implementations, but guaranteeing trial-and-error
dispatching.
Carl Banks
(**)
to the indices.) This might be a
perfect fit for your needs. You have to upgrade to 2.6, though, which
won't be released for a few days.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 26, 7:43 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 26 Sep 2008 14:54:36 -0700, Carl Banks wrote:
> > However, it seems from the rest of your comments that speed is your main
> > concern. Last time someone reported __slots__ didn
On Sep 26, 8:53 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> It might still end up being slower (creating slot descriptors might
> take more time for all I know) but it's more than just an effect of
> less memory.
Actually scratch that. Descriptors are only created when the ty
ss,"_instance",None)
if obj is None:
obj = _NotOddClass._instance = NotOddClass()
return obj
If you're real kinky you can use a metaclass. There are reasons to
prefer any of these. I'd recommend the factory function unless you
think the users could significantly
ou to understanda a language for what
it is, not for whatever computer science buzzword labels it has.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
n syntax. There's no clear cut distinction there, it's just a
design decision. Likewise, making len() into a function is just a
design decision, that len is a common enough operation that it need
elevated status. It's really nothing more. Python wouldn't suffer
much regardless if len is a method, a built-in function, or an
operator with its own syntax.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
uldn't want that addition to `set`\s but at least it can be
> implemented without introducing inconsistencies.
If set behaved that way then "del a[1]" wouldn't behave like del
anymore. Normally, "del whatever" means that you can no longer use
"whatever"; in this proposal you can.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
the first dictionary entry but rather delete the entry in
> the object with a value of 1, which IMHO would be perfectly logical for a set
> (which is why I started this discussion).
It's not logical at all. In all current uses of del, the thing that
follows del is a valid expressio
ng. I suppose many LISPers do as well.
I guess which is less effort depends on whether you find it more
difficult to identify patterns whole line, or read an extra word.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> John Salerno wrote:
>
> > from time import sleep
> ...
> > sleep(1.0)
>
> Very picky point, but I'd like to know what others think of this. Should
> I import as above, or should I do this:
>
> import time
>
> time.sleep(60.0) ???
>
> I think the 'from time import sl
s, in which case it won't exactly hurt to put the
acquisition inside the try block. It might be true of mutexes for all
I know. But even in those rare cases, I recommend always sticking to
the idiom for consistency.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
that it's in the standard libarary. But interally it's
fairly similar to how you're doing it. (It has a few extra locks to
handle empty and full conditions, IIRC.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
oo for color in animal)
for i,(animal,zoo) in enumerate(aciter):
pass
But even the clear version isn't as nearly clear and straightforward as
the nested fors with the counter. I wouldn't forsake that clarity just
so it isn't "kludgy".
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
pretty good description), but I can't think of any particular reason to
search for all occurrences of them.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
> you like, you can grab them from:
>
> http://www.doxdesk.com/img/software/py/icons.png
I like 'em. Almost makes me wish I was using Windows.
(No it doesn't.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
implemented some workaround that I don't remember, and
forgot about the issue until your post.
But yeah, something like an InterruptableQueue might be a nice thing to
have.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
x27;s not applicable to your example, sometimes None
is an object you want to pass through. (I think Alex Martelli came up
with that one.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
Carl Banks wrote:
> But yeah, something like an InterruptableQueue might be a nice thing to
> have.
Ok, I see now that InterruptableQueue wouldn't help the OP, though it
would have helped me in my situation, so it'd still be a good idea.
Carl Banks
--
http://mail.python.org/
Rene Pijlman wrote:
> Carl Banks:
> >Rene Pijlman:
> >> for i in range(self.numberOfThreads):
> >> self.workQueue.put(None)
> >
> >Or, you could just put one sentinel in the Queue, and subclass the
> >Queue's _get method not
ent_array()
array([ [ 0., 1., 2.]])
>>> x.add_point([0,0,0])
>>> x.add_point([1,1,1])
>>> x.get_current_array()
array([[ 0., 1., 2.],
[ 0., 0., 0.],
[ 1., 1., 1.]])
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
the current directory, because
current directory is in sys.path. Unless there's a change sys.path
planned, the shadowing should still happen.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
1001 - 1100 of 1709 matches
Mail list logo