Normal dict behavior?

2014-05-07 Thread antoine
Hi, Python 2.7.5 (default, Nov 20 2013, 14:20:58) [GCC 4.7.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> {0.: None, 0:None} {0.0: None} The second item disappeared! Why? Is it normal? -- https://mail.python.org/mailman/listinfo/python-list

os.spawn* on Windows

2006-06-13 Thread Antoine
Hello list I am using Python 2.4 to invoke other programs on Windows XP, using syntax like this: os.spawnv(P_WAIT, "C:\\my.exe", ("C:\\my.exe",)) where my.exe is a console-mode program. When the above statement is executed, the my.exe program creates a window, what used to be called a Dos promp

SocketServer: replace network by hard drive

2010-09-24 Thread antoine
Hello, I would like to create a python server for which the requests are passed by files on the hard drive instead of a network. I am currently looking at the SocketServer python module, hoping for an easy modification. Is it doable at all? If yes, how should it be done? Thanks, Antoine

Re: Ordered dictionaries compared

2013-05-23 Thread Antoine Pitrou
Dan Stromberg gmail.com> writes: > > What kind of ordered dictionaries?  Sorted by key. Calling them "sorted dictionaries" avoids any confusions with Python's standard OrderedDict class: http://docs.python.org/3.3/library/collections.html#ordereddict-objects Rega

Re: usage of os.posix_fadvise

2013-05-29 Thread Antoine Pitrou
do anything on (modern) Linux kernels - POSIX_FADV_DONTNEED must be called *after* you are done with a range of data, not before you read it (note that I haven't tested to confirm it :-)) Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is regex so slow?

2013-06-18 Thread Antoine Pitrou
. And that's exactly how long it > should take for "if 'ENQ' not in line" to run as well. You should read again on the O(...) notation. It's an asymptotic complexity, it tells you nothing about the exact function values at different data points. So you can hav

Re: ssl handshake operation timed out on Python 3.3.2

2013-07-09 Thread Antoine Pitrou
iis-7-5-mercurial-setup-ignoring-maxallowedcontentlength http://bz.selenic.com/show_bug.cgi?id=3905 http://bugs.python.org/issue17948 Otherwise, dumping network traffic with Wireshark could give you some hints at to what is different between the SSL handshakes in the two setups. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stack Overflow moderator “animuson”

2013-07-18 Thread Antoine Pitrou
Joshua Landau landau.ws> writes: > > > The same with Unicode. We hate French people, > > And for good damn reason too. They're ruining our language, á mon avis. We do! Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why on CentOS, python consumes too much memory ?

2013-07-18 Thread Antoine Pitrou
OS 6.2(x86_64)+python2.6.6, it reports memory > error(exceeding 200M). Take a look at http://www.selenic.com/smem/ for accurate measurement of actual memory consumption under Linux. Virtual memory size is generally useless for this purpose. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: MyOpenID.com no longer supported

2013-07-29 Thread Antoine Pitrou
ot; or "MyCorporateOpenIDWithTrademarks". Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Antoine Pitrou
(), but it would add complication, and > it would be database-specific. I would prefer a cleaner solution. Just cast the result to bytes (`bytes(row[1])`). It will work both with bytes and memoryview objcts. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with psycopg2, bytea, and memoryview

2013-07-31 Thread Antoine Pitrou
Frank Millman chagford.com> writes: > > Thanks for that, Antoine. It is an improvement over tobytes(), but i am > afraid it is still not ideal for my purposes. I would suggest asking the psycopg2 project why they made this choice, and if they would reconsider. Returning a memory

Re: append in IMAP4 from imaplib very slow

2012-07-25 Thread Antoine Pitrou
o reply. Perhaps the Perl and Python IMAP libraries use different IMAP commands for appending? Regards Antoine. -- Software development and contracting: http://pro.pitrou.net -- http://mail.python.org/mailman/listinfo/python-list

Re: ssl: add msg_callback

2012-07-26 Thread Antoine Pitrou
to be written against the default branch, although I'm not sure it makes a difference here (see the devguide: http://docs.python.org/devguide/ for more information). Please open an issue at http://bugs.python.org and post your patch there. Thanks Antoine. -- Software develop

ANN: pathlib 0.7

2012-07-29 Thread Antoine Pitrou
bucket.org/pitrou/pathlib/ Regards Antoine Pitrou. -- Software development and contracting: http://pro.pitrou.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Flushing buffer on file copy on linux

2012-08-15 Thread Antoine Pitrou
/proc/sys/vm/drop_caches; to free pagecache, dentries and inodes, use echo 3 > /proc/sys/vm/drop_caches. Because this is a nondestructive operation and dirty objects are not freeable, the user should run sync(8) firs

Re: SSLSocket.getpeercert() doesn't return issuer, serial number, etc

2012-08-16 Thread Antoine Pitrou
g/py3k/library/ssl.html#client-side-operation (although the getpeercert() doc should be updated to reflect this) If some information is still lacking from the returned value, please open an issue at http://bugs.python.org Regards Antoine. -- Software development and contracting: http://pr

Re: Flexible string representation, unicode, typography, ...

2012-08-24 Thread Antoine Pitrou
Ramchandra Apte gmail.com> writes: > > The zen of python is simply a guideline What's more, the Zen guides the language's design, not its implementation. People who think CPython is a complicated implementation can take a look at PyPy :-) Regards Antoine. -- Softw

Re: Flexible string representation, unicode, typography, ...

2012-08-30 Thread Antoine Pitrou
funny way, this is what Python was doing and it > performs better! I honestly suggest you shut up until you have a clue. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for an IPC solution

2012-08-31 Thread Antoine Pitrou
/library/multiprocessing.html Regards Antoine. -- Software development and contracting: http://pro.pitrou.net -- http://mail.python.org/mailman/listinfo/python-list

Re: The opener parameter of Python 3 open() built-in

2012-09-05 Thread Antoine Pitrou
will see your modification, which is risky and fragile. Regards Antoine. -- Software development and contracting: http://pro.pitrou.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Py_AddPendingCall

2012-09-17 Thread Antoine Pitrou
;main Python thread" is the one from which Py_Initialize() was called. (*) for example, running one of the following functions: http://docs.python.org/dev/c-api/veryhigh.html Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Posix call (execve) breaks mercurial?

2012-10-12 Thread Antoine Pitrou
ooking to see what the > difference in environment is there. Your problem is a user question for the Mercurial mailing-list, not a Python problem. See http://selenic.com/mailman/listinfo/mercurial Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: deque and thread-safety

2012-10-12 Thread Antoine Pitrou
tests ("url in seen"). Like with lists or tuples, a containment test in a deque will be O(n). So if you want efficient containment tests, you should use a set or a dict. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory profiling: Python 3.2

2012-11-02 Thread Antoine Pitrou
? Again, not sure what you mean with "allocated to variables" (global variables? local variables? everything?). As for "re-capturable data not yet GC'd", the best way to figure out is to run gc.collect() :-) Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3k Signal Handling

2012-11-10 Thread Antoine Pitrou
Jonathan Hayward pobox.com> writes: > > What needs changing here and how should I change it so that handle_signal() > is called and then things keep on ticking? So that it is called when exactly? Your message isn't clear as to what isn't working for you. Regard

Re: Thought of the day

2013-01-15 Thread Antoine Pitrou
Steven D'Aprano pearwood.info> writes: > > A programmer had a problem, and thought Now he has "I know, I'll solve > two it with threads!" problems. Host: Last week the Royal Festival Hall saw the first performance of a new logfile by one of the world's leading modern programmers, Steven "Two t

Re: nested embedding of interpreter

2012-02-06 Thread Antoine Pitrou
cluding stdout): any buffering in a still-open file opened for writing can be lost. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple TLS NPN negotiation not working on socket server

2012-04-18 Thread Antoine Pitrou
OTOCOL_SSLv23 gives the same result, but PROTOCOL_TLSv1 > makes it die with SSL3_GET_CLIENT_HELLO:wrong version number (strange, because > both browsers ostensibly support TLS). PROTOCOL_TLSv1 works here (with Firefox 11.0). Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Smallest/cheapest possible Python platform?

2012-05-26 Thread Antoine Pitrou
eeded at all, except that it's nice when running the full regression test suite). Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASE] mpdecimal-2.5.0

2020-06-29 Thread Antoine Pitrou
way AFAIK, from C or C++, to take a PyObject* and acccess the underlying `mpd_t*` directly, for fast conversions. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

parameterized metaclass (or metametaclass)

2005-01-06 Thread Antoine Pitrou
lasses can be used (successfully!) in the following way: class Address(object): __metaclass__ = Autohash3(('host', 'port')) # a = Address() a.host = 'localhost' a.port = b = copy.copy(a) hash(a) == hash(b) I was wondering if there is some simpler way of building parameterized metaclasses ? Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Self-defence

2013-11-17 Thread Antoine Pitrou
free" discussion space can always open their own. We'll see how well it fares in practice, but I'm not holding my hopes very high :-) Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

ANN: pathlib 0.97 released

2013-12-10 Thread Antoine Pitrou
I changes are too long to list; if you are already a pathlib user, I would recommend you read the documentation and find out what has changed for you (your code will likely break loudly, anyway!). Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Blog "about python 3"

2013-12-31 Thread Antoine Pitrou
who won't. Indeed. This would be extremely destructive (not to mention alienating the people doing *actual* maintenance and enhancements on Python-and-its-stdlib, of which at least 95% are committed to the original plan for 3.x to slowly supercede 2.x). Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Blog "about python 3"

2014-01-02 Thread Antoine Pitrou
for > whatever reason the python 3.3 version runs slower > > 2.7 Ran 223 tests in 66.578s > > 3.3 Ran 223 tests in 75.703s Running a test suite is a completely broken benchmarking methodology. You should isolate workloads you are interested in and write a benchmark simulating them.

Re: "More About Unicode in Python 2 and 3"

2014-01-05 Thread Antoine Pitrou
7;s a rant. "In some cases Python 3 is a bit less practical than Python 2" doesn't equate to "Python 3 is broken and 2.8 should be released instead". Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Antoine Pitrou
ot;Kenneth and Armin" are not the whole Python community. Your whole argument seems to be that a couple "revered" (!!) individuals should see their complaints taken for granted. I am opposed to rockstarizing the community. Their contribution is always welcome, of course. (as for ne

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Antoine Pitrou
Chris Angelico gmail.com> writes: > > On Tue, Jan 7, 2014 at 3:29 AM, Antoine Pitrou pitrou.net> wrote: > > People don't use? According to available figures, there are more downloads of > > Python 3 than downloads of Python 2 (Windows installers, mostly): >

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Antoine Pitrou
will bow with extreme diligence to the community's every outburst. Please try to respect us. ((*) Wikipedia: "A customer (sometimes known as a client, buyer, or purchaser) is the recipient of a good, service, product, or idea, obtained from a seller, vendor, or supplier for a monetary o

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Antoine Pitrou
ryone. Thanks in advance Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Antoine Pitrou
Terry Reedy udel.edu> writes: > > On 1/6/2014 11:29 AM, Antoine Pitrou wrote: > > > People don't use? According to available figures, there are more downloads of > > Python 3 than downloads of Python 2 (Windows installers, mostly): > > http://www.python.org/we

Re: SQLite + FTS (full text search)

2014-01-23 Thread Antoine Pitrou
> I'd like the Windows binary to include SQLite 3 with FTS4 support, but I don't know how much work that > involves or if it would make the Python .msi file too big? You can create a feature request on http://bugs.python.org Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: AssertionError (3.X only) when calling Py_Finalize with threads

2015-01-31 Thread Antoine Pitrou
Hi Tom, Tom Kent gmail.com> writes: > > I'm getting an error output when I call the C-API's Py_Finalize() from a different C-thread than I made a > python call on. Can you please post a bug on https://bugs.python.org ? Be sure to upload your example there. Thank you

Re: which async framework?

2014-03-11 Thread Antoine Pitrou
n you should consider writing them in a way that's framework-agnostic. See as an example: https://pypi.python.org/pypi/obelus/0.1 (if you really want to settle on a single framework and don't mind supporting old Python versions, then I recommend asyncio) Regards Antoine. -- https://m

Re: which async framework?

2014-03-11 Thread Antoine Pitrou
bably issue system calls to the kernel directly, the libc is overrated (as is portability, I suppose). Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: which async framework?

2014-03-11 Thread Antoine Pitrou
Sturla Molden gmail.com> writes: > > Antoine Pitrou pitrou.net> wrote: > > > Yes, why use a library when you can rewrite it all yourself? > > This assumes something equivalent to the library will have to be written. > But if it can be replaced with somethin

Re: What does gc.get_objects() return?

2014-03-17 Thread Antoine Pitrou
for low-level debugging). In most situations, gc.get_objects() is certainly the wrong tool to use. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Thread._stop() behavior changed in Python 3.4

2014-03-17 Thread Antoine Pitrou
re interested in this, please open a new issue at http://bugs.python.org) Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

[ANN] pathlib 1.0

2014-03-25 Thread Antoine Pitrou
(only pure ASCII, though). - Issue #21: fix TypeError under Python 2.7 when using new division. - Add tox support for easier testing. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: [ANN] pathlib 1.0

2014-03-25 Thread Antoine Pitrou
Oh, and of course it is published on PyPI: https://pypi.python.org/pypi/pathlib/ Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: imaplib: how to specify SSL/TLS protocol version?

2014-04-10 Thread Antoine Pitrou
to IMAP_SSL: https://docs.python.org/3.3/library/imaplib.html#imaplib.IMAP4_SSL Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Everything you did not want to know about Unicode in Python 3

2014-05-16 Thread Antoine Pitrou
this. And the documentation has now been fixed: http://bugs.python.org/issue21364 So something *can* come out of a python-list rantfest, it seems. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pair of filenos read/write each other?

2013-08-14 Thread Antoine Pitrou
x27;)) end1.write(b"foo") end1.flush() end2.read(3) # -> return b"foo" ) An alternative is to use multiprocessing.Pipe(): http://docs.python.org/3.3/library/multiprocessing.html#multiprocessing.Pipe In any case, Python doesn't lack facilities for doing what you want. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pair of filenos read/write each other?

2013-08-15 Thread Antoine Pitrou
rocessing.Pipe() provides: http://docs.python.org/3.3/library/multiprocessing.html#multiprocessing.Connection.fileno Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.4.0a2

2013-09-09 Thread Antoine Pitrou
; > Those last two PEPs are still in draft form and not accepted nor have > any committed code yet. Unless Larry enthusiastically sneaked them into the release. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: [python-committers] [RELEASED] Python 3.4.0a2

2013-09-09 Thread Antoine Pitrou
d > sockets not only the subprocess module. I don't think Larry's description is wrong. "Non-inheritable" is a shorthand for "non-inheritable in subprocesses" with "subprocesses" taken in the general sense (i.e. not only created with the subprocess module). Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

ANN: Obelus 0.1 -- Asterisk AMI / AGI implementation

2013-09-12 Thread Antoine Pitrou
. Requirements * Python 2.7, 3.2 or later. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Tab completion in Python3.4

2013-09-30 Thread Antoine Pitrou
ginning of the line: Such a change is much more likely to happen if someone actually proposes a patch for it, rather than merely "ask for it". I don't think anyone is ideologically opposed to it. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-22 Thread Antoine Pitrou
failed. Cython mitigates the issue by exposing a superset of Python (including type hints, etc.). Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-22 Thread Antoine Pitrou
Steven D'Aprano pearwood.info> writes: > > On Tue, 22 Oct 2013 08:55:15 +, Antoine Pitrou wrote: > > > If you don't implement exec() and eval() then people won't be able to > > use namedtuples, which are a common datatype factory. > > Philip

Re: Will Python 3.x ever become the actual standard?

2013-10-24 Thread Antoine Pitrou
except Germany). Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

[OT] Re: Python Front-end to GCC

2013-10-29 Thread Antoine Pitrou
> http://en.wikipedia.org/wiki/List_of_animals_with_fraudulent_diplomas > > PhD's are more expensive, which leads me to think that Mark Jenssen is > being a tad flexible with the truth when he claims to have one. He could be an upper-class twit. He would certainly have his chance in the yearly competition ;-)

[ANN] pathlib 1.0.1

2014-09-03 Thread Antoine Pitrou
now part of the standard library. For Python 3.3 and earlier, ``easy_install pathlib`` or ``pip install pathlib`` should do the trick. Changelog for version 1.0.1 --- - Pull request #4: Python 2.6 compatibility by eevee. Regards Antoine. -- https://mail.python.org

Re: __qualname__ in python 3.3

2014-09-07 Thread Antoine Pitrou
') 9 STORE_NAME 2 (__qualname__) 12 LOAD_CONST 1 (None) 15 RETURN_VALUE Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: weakref, memory management and execution slow down in PyQt4

2014-09-07 Thread Antoine Pitrou
older versions: https://docs.python.org/3/library/tracemalloc.html http://pytracemalloc.readthedocs.org/ But regardless of such tools, the approach above (try to decompose your workload into separate parts until your find the culprit) is highly recommended. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Newer Debian versions of python on older Debian distros?

2014-09-13 Thread Antoine Pitrou
ll rather than a system install of Python (something akin to a virtual environment). Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: "High water" Memory fragmentation still a thing?

2014-10-03 Thread Antoine Pitrou
ostly fixed?) in 3.3. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: "High water" Memory fragmentation still a thing?

2014-10-04 Thread Antoine Pitrou
obably looking at resident set size. Regards Antoine. -- https://mail.python.org/mailman/listinfo/python-list

Re: Getting involved

2012-01-07 Thread Antoine Pitrou
n and/or Java which > are currently active (vivid) and useful? CPython itself - the reference and most used implementation - is written partly in Python (most of the stdlib is) and partly in C. It is easy to find things to do even without touching C. You could take a look: http://doc

Re: IMAP4_SSL and OpenSSL compatibility

2013-02-26 Thread Antoine Pitrou
eyfile, self.certfile, > ssl_version = ssl.PROTOCOL_SSLv3) > > Would it make sense, to make this change in the Python standard > library? There is already the ssl_context option for that: http://docs.python.org/3.3/library/imaplib.html#imaplib.IMAP4_SSL Regards Antoine. -

Re: Do you feel bad because of the Python docs?

2013-02-27 Thread Antoine Pitrou
big picture, they are good enough. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Do you feel bad because of the Python docs?

2013-02-27 Thread Antoine Pitrou
s/2006/12/09.html Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to same file from two threads

2013-02-27 Thread Antoine Pitrou
tween competing locks, you can have difficult to diagnose issues. Queues have their internal locking all done for you. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to same file from two threads

2013-03-01 Thread Antoine Pitrou
Steven D'Aprano pearwood.info> writes: > > On Wed, 27 Feb 2013 13:26:18 +, Antoine Pitrou wrote: > > > For the record, binary files are thread-safe in Python 3, but text files > > are not. > > Where is this documented please? In the documentation, of c

Re: Speeding up Python's exit

2013-03-01 Thread Antoine Pitrou
g system, but other resources > such as opened files may not be. The OS always disposes of per-process resources when the process terminates (except if the OS is buggy ;-)). However, file buffers will not be flushed, atexit handlers and other destructors will not be called, database transactions

Re: IMAP4_SSL and OpenSSL compatibility

2013-03-01 Thread Antoine Pitrou
3.3 feature to > Python 2? No, we don't backport new features to maintenance releases. > 2. Would the following lines be correct for Python 3.3? > > >>> import imaplib > >>> IMAP4_SSL("192.168.1.1.", ssl_context = > SSLContext(s

Re: Speeding up Python's exit

2013-03-01 Thread Antoine Pitrou
are closed (without flushing) is implementation-defined.” http://pubs.opengroup.org/onlinepubs/9699919799/functions/_exit.html (under the hood, os._exit() calls C _exit()) Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

ANN: pathlib 0.8

2013-03-01 Thread Antoine Pitrou
cket <https://bitbucket.org/pitrou/pathlib/>`_. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Speeding up Python's exit

2013-03-01 Thread Antoine Pitrou
Dave Angel davea.name> writes: > > Note he didn't say the python buffers would be flushed. It's the OS > buffers that are flushed. Now please read my message again. The OS buffers are *not* flushed according to POSIX. -- http://mail.python.org/mailman/listinfo/python-list

Re: standalone vs embedded interpreter

2013-04-09 Thread Antoine Pitrou
in)) and isatty(fileno(stdout)) both true? If you want to debug, take a look at PyOS_Readline() in Parser/myreadline.c. It probably holds the answer to your question. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode issue with Python v3.3

2013-04-10 Thread Antoine Pitrou
terested in "being right on the Internet" rather than helping people out. (this is where the StackOverflow mechanics probably work better, sadly) Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: The node.js Community is Quietly Changing the Face of Open Source

2013-04-17 Thread Antoine Pitrou
ll designed from a language theoretist's point of view, but I suspect most average programmers would find it a hell to code in. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing contextual information when logging

2008-01-08 Thread Antoine Pitrou
the exception() method call Logger.error() rather than Logger.exception() ? One suggestion : pass in a Logger object rather than a logger name to the LoggerAdapter constructor. (this also means that users could stack LoggerAdapter objects if they wanted to) Thanks Antoine. -- http://mail.pyth

Re: Moving from Python 2 to Python 3: A 4 page "cheat sheet"

2009-12-02 Thread Antoine Pitrou
ust one thing: « Copyright © Qtrac Ltd. 2009. All rights reserved » Might I suggest that you release it under a free license instead? (such as the CC by, CC by-sa, or the Free Art License) Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for small, fast, Python based web server

2009-12-11 Thread Antoine Pitrou
portability and community support are concerned, you probably can't go wrong with Twisted. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: a huge shared read-only data in parallel accesses -- How? multithreading? multiprocessing?

2009-12-11 Thread Antoine Pitrou
Le Wed, 09 Dec 2009 06:58:11 -0800, Valery a écrit : > > I have a huge data structure that takes >50% of RAM. My goal is to have > many computational threads (or processes) that can have an efficient > read-access to the huge and complex data structure. > > "Efficient" in particular means "withou

Re: Recommendation for small, fast, Python based web server

2009-12-11 Thread Antoine Pitrou
Le Fri, 11 Dec 2009 19:40:21 +0100, Irmen de Jong a écrit : > > I don't think that number is fair for Python. I think a well written > Python web server can perform in the same ballpark as most mainstream > web servers written in C. Especially Apache, which really isn't a top > performer. And I'm

Re: Dangerous behavior of list(generator)

2009-12-14 Thread Antoine Pitrou
dify it as official spec or 2) change it. In other words, it should be considered undefined behaviour, and perhaps other Python implementations behave differently. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is PyMethod_GET_CLASS in Python 3?

2009-12-17 Thread Antoine Pitrou
g tracker: http://bugs.python.org Finally, there's also a dedicated mailing-list for porting to py3k: http://mail.python.org/mailman/listinfo/python-porting While it hasn't seen a lot of activity lately, I'm sure there are people there willing to answer any questions you have! Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3.1: gzip encoding with UTF-8 fails

2009-12-21 Thread Antoine Pitrou
ary file (a gzip file). This bug has been fixed now; in the next 3.x versions it will raise a TypeError: >>> x = gzip.open("testdatei", "wb") >>> x.write("ä") Traceback (most recent call last): File "", line 1, in File "/home/antoin

Re: Semantic of operations on a closed file object

2009-12-26 Thread Antoine Pitrou
27;a') Traceback (most recent call last): File "", line 1, in ValueError: I/O operation on closed file You could/should open a bug about this on http://bugs.python.org so that it isn't forgotten. Thank you Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for small, fast, Python based web server

2009-12-26 Thread Antoine Pitrou
Le Fri, 25 Dec 2009 10:38:19 -0800, Aahz a écrit : > In article , > Antoine Pitrou wrote: >> >>Apparently you have debugged your speed issue so I suppose you don't >>have performance problems anymore. Do note, however, that Python is >>generally not as fast as

Re: detect interactivity

2009-12-29 Thread Antoine Pitrou
Le Tue, 29 Dec 2009 16:09:58 +0100, Roald de Vries a écrit : > Dear all, > > Is it possible for a Python script to detect whether it is running > interactively? It can be useful for e.g. defining functions that are > only useful in interactive mode. Try the isatty() method (*) on e.g. stdin: $

Re: detect interactivity

2009-12-30 Thread Antoine Pitrou
Le Wed, 30 Dec 2009 03:33:18 +0100, Roald de Vries a écrit : > > I'm using a database, and want to use python interactively to manipulate > it. On the other hand, I also want to be able to use it non- > interactively. In that case, it would be a waste of CPU to load the > function/class definition

Re: multithreading, performance, again...

2009-12-31 Thread Antoine Pitrou
> 39123 function calls (38988 primitive calls) in 6.004 CPU > seconds > [...] > > It's not burning CPU time in the main thread (profiling with cProfile > indicated smth similar to the above), it's not burning it in the > individual worker threads What do you mean, it's not b

Re: fsync() doesn't work as advertised?

2010-01-04 Thread Antoine Pitrou
Le Mon, 04 Jan 2010 08:09:56 -0800, Brian D a écrit : > > What I've seen is that flush() alone produces a complete log when the > loop finishes. When I used fsync(), I lost all of the write entries > except the first, along with odd error trap and the last entry. Perhaps you are writing to the fi

Re: Speeding up network access: threading?

2010-01-05 Thread Antoine Pitrou
ovide the waiting features that queue.Queue provides. Regards Antoine. -- http://mail.python.org/mailman/listinfo/python-list

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Antoine Pitrou
>> Couldn't you just use the built-in enumerate() to replace the whole >> thing? > > Because that would involve, like, reading an entire Python book just to > locate that method? Actually, no. It just involves reading one of the most important pages in the documentation, the page which describ

Re: please help shrink this each_with_index() implementation

2010-01-05 Thread Antoine Pitrou
> The point: int('') or int('something') both throw an error. In general, > this is hand-holding, but in specific I don't think the "rich and > structured" documentation will cover how to beat a 0 out of it in less > than 3 lines. Because it's a bad idea to do so and Python doesn't encourage such

  1   2   3   4   >