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
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
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
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
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
. 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
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
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
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
ot; or
"MyCorporateOpenIDWithTrademarks".
Regards
Antoine.
--
http://mail.python.org/mailman/listinfo/python-list
(), 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
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
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
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
bucket.org/pitrou/pathlib/
Regards
Antoine Pitrou.
--
Software development and contracting: http://pro.pitrou.net
--
http://mail.python.org/mailman/listinfo/python-list
/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
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
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
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
/library/multiprocessing.html
Regards
Antoine.
--
Software development and contracting: http://pro.pitrou.net
--
http://mail.python.org/mailman/listinfo/python-list
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
;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
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
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
?
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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):
>
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
ryone.
Thanks in advance
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
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
> 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
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
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
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
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
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 interested in this, please open a new issue at
http://bugs.python.org)
Regards
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
(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
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
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
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
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
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
;
> 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
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
.
Requirements
* Python 2.7, 3.2 or later.
Regards
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
except Germany).
Regards
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
> 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 ;-)
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
')
9 STORE_NAME 2 (__qualname__)
12 LOAD_CONST 1 (None)
15 RETURN_VALUE
Regards
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
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
ll rather than a system install
of Python (something akin to a virtual environment).
Regards
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
ostly fixed?) in 3.3.
Regards
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
obably looking at resident set size.
Regards
Antoine.
--
https://mail.python.org/mailman/listinfo/python-list
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
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.
-
big picture, they are good enough.
Regards
Antoine.
--
http://mail.python.org/mailman/listinfo/python-list
s/2006/12/09.html
Regards
Antoine.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
cket
<https://bitbucket.org/pitrou/pathlib/>`_.
Regards
Antoine.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
portability and
community support are concerned, you probably can't go wrong with Twisted.
Regards
Antoine.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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:
$
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
> 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
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
ovide the waiting
features that queue.Queue provides.
Regards
Antoine.
--
http://mail.python.org/mailman/listinfo/python-list
>> 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
> 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 - 100 of 332 matches
Mail list logo