It turned out to be a loading order issue. That message is generated
at import time, and "filterwarnings" hadn't been called yet.
John Nagle
Peter Otten wrote:
John Nagle wrote:
Feedparser isn't supported for Python 3.0, so
ed down at compile
time.
(Plus, of course, something so that multithreaded programs don't
suck so bad on multicore CPUs.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ore serious database. Especially if you're doing much updating.
SQLite can do multiple SELECT operations in parallel, but the entire
database is locked for all operations that write.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
thin your running program.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
dads wrote:
Sorry forgot to mention I'm using python 2.6
This looks like a homework assignment.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ncates sequences silently, which may or may not be what you want.
-[]z.
Ah, introspection. Is that a defined feature of Python or an implementation
quirk of CPython?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
new SSL support, but MySQLdb doesn't support
Python 2.6, so I can't convert yet.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Heikki Toivonen wrote:
John Nagle wrote:
M2Crypto, from
http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.20.1.tar.gz
won't build on Red Hat Linux / 386. The error is
It's some incompatibility between Red Hat include file packaging and
M2Crypto.
Yup, all Fedora
n can process
just fine.
Printing kanjii in a terminal window is troublesome on some operating systems.
But it's possible to get everything working in Unicode, which will result in
kanjii text appearing.
Reading the Japanese may be a problem, although you can put the text through
Google
Heikki Toivonen wrote:
John Nagle wrote:
The right question is "uname --hardware-platform". That returns "i386" if
running on something emulating a 386, even it it's 64-bit capable.
Thanks, I'll make a note that I'll need to clarify that part.
With that c
used in a dictionary.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
eaded compute-bound Python programs really suck
on multiprocessors. Adding a second CPU makes the program go slower,
due to a lame mechanism for resolving conflicts over the global interpreter
lock.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
t, while you don't have to
declare types, each variable generally has to stay the same type
throughout its life. (Different subclasses of the same class are OK.)
This is enough to make huge speedups possible.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ine with a COM3 port?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
libraries (you call them) over "frameworks"
(they call you) if you're doing something unusual. Frameworks are more
useful if you're doing yet another "Web 2.0" web site.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
John Nagle schrieb:
Alan Harris-Reid wrote:
I am very much new to Python, and one of my first projects is a simple
data-based website. I am starting with Python 3.1
Until MySQLdb gets ported to something later than Python 2.5, support
for a "data-based web
l
They image the whole planet at 0.42m resolution in color every
two days. Upload that to some cloud system and find all red dots
in the continental US that weren't there before the event.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
is used, and the thread
waiting on "fd" is not the main thread, will a signal cause the
waiting thread to get a read completion? Or is this another "first
thread only" thing"?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ectively thread cancellation.
So right now, you can kill the first thread from another thread.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
erial port produces
an IOError exception, but the read side doesn't seem to notice.
Any ideas?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Antoine Pitrou wrote:
John Nagle animats.com> writes:
I'd argue against general thread cancellation. Inter-thread
signals, though, have safety problems no worse than the first-thread
only signals we have now. You're allowed to raise an exception
in a signal handler, which i
sure the
environment works - Python loads, the Python program loads, and you
can get a response back.
Bear in mind that most hosting services don't make much of an attempt
to support Python. Expect important libraries to be missing or obsolete.
hanism is simple enough. In a static language, you can
convert "duck typing" to inheritance at link time, when you have the chance
to see what can match what. So the implementation doesn't actually have to
search for a match at run time.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
structure and form have usually been fully determined by
the time the program begins execution.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
if the machinery for dynamic
attributes needs to be provided for that class. This allows the "slots"
optimization, and direct compilation into struct-type code.
Python is a very clean language held back from widespread use by slow
implementations. If Python ran faster, Go would be unnecessary.
And yes, performance matters when you buy servers in bulk.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
LOAD command. That's
far faster than doing vast numbers of INSERT operations. The
LOAD command loads all the data, unindexed, then builds the indices.
Expect a 10x speed improvement or better.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
x27;,
description="Baudot Teletype RSS and SMS program",
version='1.0',
author="John Nagle",
author_email="na...@animats.com",
packages=['messager'],
requires=['pyserial', 'feedparser']
)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
his error today:
urllib.py:1197: UnicodeWarning: Unicode equal comparison failed to convert both
arguments to Unicode - interpreting
them as being unequal
res = map(safe_map.__getitem__, s)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
I suggest
ALTER DATABASE dbname DEFAULT CHARACTER SET utf8;
before doing any CREATE TABLE operations. Then strings
will be UTF8 in the database.
Read this: http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html
It all works quite well.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
25-rpms-for-rhel-5-centos-5/
Google Translate gives me
"[...] On this entry uses the src.rpm. Kitara dropped, rpmbuild-rebuild
(rpm-rebuild, but often seen the entry, it says, there's this option only old
rpm) [...]"
I'm trying to figure that out.
gic.
Has anyone tried using "affinity" ("http://pypi.python.org/pypi/affinity";)
to lock each Python process to a single CPU? Does that help?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin wrote:
John Nagle writes:
Analysis of each domain is
performed in a separate process, but each process uses multiple
threads to read process several web pages simultaneously.
Some of the threads go compute-bound for a second or two at a time as
they parse web pages.
You
Steve Holden wrote:
John Nagle wrote:
Paul Rubin wrote:
John Nagle writes:
Analysis of each domain is
performed in a separate process, but each process uses multiple
threads to read process several web pages simultaneously.
Some of the threads go compute-bound for a second or two at a
I used to do stuff like this back when I did physics engines
with efficient 3D collision detection.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
make module search return an
error if two modules satisfy the search criteria. "First find"
isn't a good solution.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
"datavars": {"charAsInt": charAsInt}})
Every time through the loop (once per character), they build that frozen
set again.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Forthminder wrote:
...
Ignore. Well-known nut. See "http://www.nothingisreal.com/mentifex_faq.html";
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
modern Windows and Linux systems support
Unicode consoles, but Python somehow doesn't get this.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ou're using IDLE, or some Python debugger, it may need to be
told to have its window use Unicode.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
This approach makes threading much easier for the typical programmer.
Instead of race conditions and random errors, you get error messages.
And we get rid of the GIL.
I look at this as Python's answer to multicore CPUs and "Go".
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy wrote:
On 2/16/2010 3:15 PM, John Nagle wrote:
In the beginning, Python had some types which were "frozen",
> and some which weren't.
In the beginning, there was only one 'frozen' general purpose collection
type, the tuple. And Guido resisted the sug
Daniel Stutzbach wrote:
On Tue, Feb 16, 2010 at 3:15 PM, John Nagle wrote:
One possible implementation would be
to have unfrozen objects managed by reference counting and locking as
in CPython. Frozen objects would live in a different memory space and be
garbage collected by a concurrent
John Nagle wrote:
I look at this as Python's answer to multicore CPUs and "Go".
On that note, I went to a talk at Stanford yesterday by one of the
designers of Intel's Nelahem core. The four-core, eight thread
version is out now. The six-core, twelve thread ver
sjdevn...@yahoo.com wrote:
On Feb 18, 2:58 pm, John Nagle wrote:
Multiple processes are not the answer. That means loading multiple
copies of the same code into different areas of memory. The cache
miss rate goes up accordingly.
A decent OS will use copy-on-write with forked processes
t if release is just resource
recovery. Reference counting will recover most objects when they
go out of scope anyway.
Don't get carried away just because a new feature is available.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
sjdevn...@yahoo.com wrote:
On Feb 20, 9:58 pm, John Nagle wrote:
sjdevn...@yahoo.com wrote:
On Feb 18, 2:58 pm, John Nagle wrote:
Multiple processes are not the answer. That means loading multiple
copies of the same code into different areas of memory. The cache
miss rate goes up
mk wrote:
sjdevn...@yahoo.com wrote:
On Feb 20, 9:58 pm, John Nagle wrote:
sjdevn...@yahoo.com wrote:
On Feb 18, 2:58 pm, John Nagle wrote:
Multiple processes are not the answer. That means loading
multiple
copies of the same code into different areas of memory. The cache
miss rate
#x27;s
restrictions are inherently necessary. The one Shed Skin
developer has accomplished far more than the PyPy army of ants.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ually.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
s quality control, with testers and a test reporting system.
PyPi does not.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
databases have to be carefully
organized to avoid excessive cross-machine locking. If you don't need
general joins, a system which doesn't support them is far simpler.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ut they have more
baggage.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
at program load time,
rather than when the main function is called, may give trouble.
Also, be careful about leaving files, database connections, and
sockets open after the main function returns.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
transaction volumes much better than sqlite.
You use sqlite for configuration files, your personal databases, and
other small stuff. You run your Web 2.0 site on MySQL or Postgres.
You run your Fortune 1000 company on Oracle.
John Nagle
--
http://mail.py
ters.
OK. Then you need to be writing arrays of bytes, not strings.
Encoding is your problem. This has nothing to do with Unicode.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
甜瓜 wrote:
> Well, Database is not proper because 1. the table is very big (~10^9
> rows) 2. we should support very fast *simple* query that is to get
> value corresponding to single key (~10^7 queries / second).
Ah, crypto rainbow tables.
J
ype on a light brown background. One could write a good paper on this
topic, but this isn't it.
By the same author: "The Case For Uncreative Web Design", which
has no examples.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Then
regenerate HTML from the tree.
Or just use HTML Tidy: "http://www.w3.org/People/Raggett/tidy/";
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
legant/common python expression for this?
Yes, Python has ternary operator-like syntax:
return ('Yes' if a==b else 'No')
Note that this requires a recent version of Python.
Who let the dogs in? That's awful syntax.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
representations, due to rounding problems.
Long discussion of this here: "http://bugs.python.org/issue1580";
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
are dead.
I just tried "Dejavu", which only has a link to "projects.amor.org". That
subdomain is dead. "amor.org" is some kind of religious organization.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Alf P. Steinbach wrote:
* Jean-Michel Pichavant:
John Nagle wrote:
Jonathan Hayward wrote:
I've posted "Usability, the Soul of Python: An Introduction to the
Python Programming Language Through the Eyes of Usability", at:
http://JonathansCorner.com/python/
No, it&
mes.
So don't do that.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
abc']
which is almost as short as
obj.abc
but safer.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
y leak.
Did that get fixed?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
It doesn't have
the storage management problems of C and C++, the awful syntax
of Perl, the object-as-copy semantics of Javascript, or the
mess of stacked libraries of Java.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
stion."
So Google has pulled the plug on Unladen Swallow. It looks
like they underestimated the difficulty of speeding up the CPython
model. The performance improvement achieved was so low
that cluttering up CPython with a JIT system and LLVM probably is
a lose.
se for segmentation fault.
Either fix the program so it doesn't crash,or run the offending
module and the C code in a subprocess.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ut of the cage and thumps its head on the counter. Throws
it up in the air and watches it plummet to the floor.)
Mr. Praline: Now that's what I call a dead parrot.
(There's more, but you get the idea.)
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 11/18/2010 4:24 AM, BartC wrote:
"John Nagle" wrote in message
news:4ce37e01$0$1666$742ec...@news.sonic.net...
On 11/16/2010 10:24 PM, swapnil wrote:
AFAIK, the merging plan was approved by Guido early this year. I
guess Google is expecting the community to drive the project
fr
On 11/18/2010 5:35 PM, Mark Wooding wrote:
John Nagle writes:
Python is defined by what a naive interpreter with late binding
and dynamic name lookups, like CPython, can easily implement. Simply
emulating the semantics of CPython with generated code doesn't help
all that much.
I
e cookies for position information. The browser's "Back"
button won't do what users expect if you do that.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
multiple inheritance might not even be
aware that there's a clash further up in the hierarchy. This is
one of those areas where all the code looks right locally, but it's
wrong globally.
Best practice for this is "don't do it." Some name clashes ought
to simply be detect
On 11/25/2010 5:36 PM, Raymond Hettinger wrote:
On Nov 25, 3:38 pm, John Nagle wrote:
Best practice for this is "don't do it." Some name clashes ought
to simply be detected as errors, rather than being given such
complex semantics.
That may well be true. If a coder has
True"
or a counterexample. The algorithm uses the simplex method
from linear programming, but with rational arithmetic.
But that's an exotic application. For ordinary number crunching,
rational arithmetic is completely inappropriate.
John Nagle
--
http
On 11/26/2010 4:21 PM, Mark Wooding wrote:
John Nagle writes:
I'd argue that a better implementation would require that when there's
a name clash, you have to specify the class containing the name. In
other words, if A is a subclass of B, then B.foo() overrides
A.foo(). But
seful ever get done about that? This
ought to be in the "time" module for each platform.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
e of the issues that came up. Defining addition in a way that
is not associative and commutative leads to problems, and breaks
generic algorithms. If the basic operators follow the expected rules,
generic algorithms will work on them. That was botched in Python.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
h the accelerometer data
and video frames are buffered, then you can do your processing in
Python without trying to meet hard real-time constraints. This is
the usual approach in Windows land.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ly not the right approach.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
uot; databases for very
large distributed systems. You worry about this if you're Facebook
or Google, or are running a big game server farm.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
hack from the PDP-11 era.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ce had to handle floating point
overflow, which indicated that the computation had to be backed
up and rerun with a smaller time step. It's possible to do this
safely under Windows on x86 if you read all the appropriate documents.
It's not portable. That's why I'm a
t worst.
Right. You're not entitled to assume that StopIteration is
how a generator exits. That's a CPyton thing; generators were
a retrofit, and that's how they were hacked in. Other implementations
may do generators differently.
John Nagl
On 12/6/2010 2:24 PM, Mark Wooding wrote:
John Nagle writes:
Right. You're not entitled to assume that StopIteration is how a
generator exits. That's a CPyton thing; generators were a retrofit,
and that's how they were hacked in. Other implementations may do
generators diff
model
well. This held the language back and eventually killed it.)
C I/O returned a unique value on EOF, but there was no way to
test for it before reading. Works much better. The same issues apply
to pipes, sockets, qeueues, interprocess communication, etc.
aster. Realistically, though,
this is the kind of problem that runs slow in CPython.
This is why you don't write your own collision library.
(I once did, for 3D, but that was in 1996, when it was
cutting-edge technology.)
John Nagle
--
http://mail.python.o
nd (not b)
not (not a) == a
should all hold, or an type exception should be raised.
With Python accepting both "True" and "1" as sort of
equivalent, there are cases where those don't hold.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ts, because incorrect branches would be taken
and the final bogus results might not contain NaNs.
I personally think that comparing NaN with numbers or other
NaNs should raise an exception. There's no valid result for
such comparisons.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
definition of
comparison associated with the object, you probably can't order
it properly, either.
"<" can't be some random function. For sorting to work,
a < b and b < c implies a < c
must hold.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 12/8/2010 7:56 PM, geremy condra wrote:
On Wed, Dec 8, 2010 at 1:01 PM, John Nagle wrote:
On 12/7/2010 3:59 PM, Mark Wooding wrote:
Exactly one of
a > b
a = b
a < b
is true, or an type exception must be raised.
Here's an example where this iss
32 bit
machines with more than 4GB of RAM.
None of the real 64-bit architectures, from AMD64 to SPARC
to Itanium, need this hack.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 12/9/2010 12:36 AM, Terry Reedy wrote:
On 12/9/2010 2:58 AM, Steven D'Aprano wrote:
On Wed, 08 Dec 2010 20:16:57 -0800, John Nagle wrote:
I believe that is that exactly one of <,=.> are true.
Not for NaNs.
>>> NaN = float('nan')
>>> NaN == NaN
ppropriate, and will scale to terabytes if necessary.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Interestingly, some of the motivation for
"functional programming" in Python, with lambdas and list
comprehensions, is to get a very local scope for a very local
variable.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
scope.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
in subtle ways.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
nd back not-too-strict XML or JSON. This is
called a "REST" interface.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
801 - 900 of 1270 matches
Mail list logo