Thomas I haven't tried it, but using psyco in a script and building an
Thomas exe from it with py2exe should work right out of the box - but
Thomas maybe this isn't what you had in mind?
I was thinking of implicitly mixing in psyco, even if the script didn't use
it. Maybe I have too
Martin If you really want side-by-side installation of different
Martin versions, and a mechanism to select between them, the package
Martin could support
Martin import xml_0_8_2 as xml
Martin IOW, import-as should be sufficient for what you want to achieve.
That's
Eric Unless you are doing comparison tests, where it would be nice to
Eric be able to state in a generic way that the new implementation
Eric should not change answers. May be something like:
Eric import spam[1] as spamnext# next version
Eric import spam[0]
Andrew There's a bunch of jobs we (CSV module maintainers) have been
Andrew putting off - attached is a list (in no particular order):
...
In addition, it occurred to me this evening that there's functionality in
the csv module I don't think anybody uses. For example, you can
Magnus Quite a while ago I posted some material to the csv-list about
Magnus problems using the csv module on Unix-style colon-separated
Magnus files -- it just doesn't deal properly with backslash escaping
Magnus and is quite useless for this kind of file. I seem to recall the
* is CSV going to be maintained outside the python tree?
If not, remove the 2.2 compatibility macros for: PyDoc_STR,
PyDoc_STRVAR, PyMODINIT_FUNC, etc.
Andrew Does anyone thing we should continue to maintain this 2.2
Andrew compatibility?
With the release of 2.4, 2.2 has
Is there a reason the standard library needs both os.removedirs and
shutil.rmtree? They seem awful similar to me (I can see they aren't really
identical). Ditto for os.renames and shutil.move. Presuming they are all
really needed, is there some reason they don't all belong in the same
module?
Raymond Would the csv module be a good place to add a DBF reader and
Raymond writer?
Not really.
Raymond I've posted a draft on ASPN. It interoperates well with the
Raymond rest of the CSV module because it also accepts/returns a list
Raymond of fieldnames and a sequence of
Andrew The csv parser consumes lines from an iterator, but it also has
Andrew it's own idea of end-of-line conventions, which are currently
Andrew only used by the writer, not the reader, which is a source of
Andrew much confusion. The writer, by default, also attempts to emit a
Michael This must be one of those cases where I am mislead by my
Michael background... I thought of Liskov substitution principle as a
Michael piece of basic CS background that everyone learned in school
Michael (or from the net, or wherever they learned
Michael programming).
Jack On MacOSX you really want universal newlines. CSV files produced
Jack by older software (such as AppleWorks) will have \r line
Jack terminators, but lots of other programs will have files with
Jack normal \n terminators.
Won't work. You have to be able to write a Windows csv
A couple months ago I proposed (maybe in a SF bug report) that
time.strptime() grow some way to parse time strings containing fractional
seconds based on my experience with the logging module. I've hit that
stumbling block again, this time in parsing files with timestamps that were
generated
Brett The problem I have always had with this proposal is that the
Brett value is worthless, time tuples do not have a slot for fractional
Brett seconds. Yes, it could possibly be changed to return a float for
Brett seconds, but that could possibly break things.
Actually,
I realize the %4N notation is distasteful, but without it I think you
will have trouble parsing something like
13:02:00.704
What would be the format string? %H:%M:%S.%N would be incorrect.
Brett Why is that incorrect?
Because 704 represents the number of
Stuart I don't think it is possible for plpythonu to fix this by simply
Stuart translating the line endings, as this would require significant
Stuart knowledge of Python syntax to do correctly (triple quoted
Stuart strings and character escaping I think).
I don't see why not. If
Phillip Actually, this is one of those rare cases where optimization
Phillip and clarity go hand in hand. Human brains just don't handle
Phillip nesting that well. It's easy to visualize two levels of nested
Phillip structure, but three is a stretch unless you can abstract at
Fredrik s = s.replace(\r, \n[\n in s:])
This fails on admittedly weird strings that mix line endings:
s = abc\rdef\r\n
s = s.replace(\r, \n[\n in s:])
s
'abcdef\n'
where universal newline mode or Just's re.sub() gadget would work.
Skip
Just Skip Montanaro wrote:
Just re.sub([\r\n]+, \n, s) and I think you're good to go.
Just I don't think that in general you want to fold multiple empty
Just lines into one.
Whoops. Yes.
Skip
___
Python-Dev mailing list
Python-Dev
Michael CPython CAN leverage such environments, and it IS used that
Michael way. However, this requires using multiple Python processes
Michael and inter-process communication of some sort (there are lots of
Michael choices, take your pick). It's a technique which is more
Brett Everyone went silent on this topic. Does this mean people just
Brett stopped caring (which I doubt since I know Skip wants this bad
Brett enough to bring it up every so often)? Was it the issue of
Brett symmetry with strftime?
I have a patch to do strptime() fractional
vacancies can be found here:
http://www.python.org/Jobs-howto.html
--
Skip Montanaro
[EMAIL PROTECTED]
http://www.mojam.com/
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http
How will Python releases made in response to security bugs be done:
will they just include the security fix (rather than being taken from
CVS HEAD), without the usual alpha / beta testing cycle? Or what...?
Guido On python.org, however, we tend to take the maintenance branch
Raymond [Skip]
If lists are conceptually like vectors or arrays in other languages
and tuples are like C structs or Pascal records, then by converting
from list to tuple form you've somehow muddied the data structure
water just to take advantage of tuples' immutability.
Raymond Any objections to replacing the likes of types.IntType and
Raymond types.ListType with int and list?
+1
Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Phillip I was just responding to the OP, who was advocating it for
Phillip Python default behavior, or behavior controlled by the command
Phillip line. That's why I said, Yes, but not as a default behavior.
My original intent was that it would probably not fly as default behavior.
Maybe some ambitious PSF activitst could contact Roskind and Steve
Kirsch and see if they know who at Disney to talk to... Or maybe the
Disney guys who were at PyCon last year could help.
Matthias please could somebody give me a contact address?
Steve's easy enough to get
I am frantically trying to get ready to be out of town for a week of
vacation. Someone sent me some patches for datetime and asked me to look at
them. I begged off but referred him to http://www.python.org/dev/ and made
mention of the five patch review idea. Can someone make sure that's
Based on some ideas from Skip, I had tried transforming the likes of
x in (1,2,3) into x in frozenset([1,2,3])
Fredrik savings in what? time or bytecode size? constructed
Fredrik micro-benchmarks, or examples from real-life code?
Fredrik do we have any statistics on
It seems to me that either urllib's docs are wrong or its code is wrong
w.r.t. how the User-agent header is handled. In part, the docs say:
By default, the URLopener class sends a User-Agent: header of
urllib/VVV, where VVV is the urllib version number. Applications can
define their
It seems to me that either urllib's docs are wrong or its code is
wrong w.r.t. how the User-agent header is handled.
Guido I propose fixing the docs...
Done (also backported to 2.4 branch).
Skip
___
Python-Dev mailing list
Anthony Initially, I was inclined to be much less anal about the
Anthony no-new-features thing. But since doing it, I've had a quite
Anthony large number of people tell me how much they appreciate this
Anthony approach - vendors, large companies with huge installed bases
Anthony Goal 4: Try and prevent something like
Anthony try:
Anthony True, False
Anthony except NameError:
Anthony True, False = 1, 0
Anthony from ever ever happening again.
I will point out that in
Bob try:
Bob set
Bob except NameError:
Bob from sets import Set as set
Bob You don't need the rest.
Sure, but then pychecker bitches about a statement that appears to have no
effect. ;-)
Skip
___
Python-Dev mailing list
I added UnicodeReader and UnicodeWriter example classes to the csv module
docs just now. They mention problems with ASCII NUL characters (which I
vaguely remember - NUL-terminated strings are used internally, right?). Do
NULs still present a problem? I saw nothing in the log messages that
vivek I have to implement tree data structure using python. How it can
vivek be done in python.
Wrong list. This is about development *of* Python, not development *with*
Python. Try python-list@python.org (or its sister Usenet newsgroup,
comp.lang.python) instead.
--
Skip Montanaro
Jeff == Jeff Epler [EMAIL PROTECTED] writes:
Jeff I get 500 Internal Server Error messages when I try to access the
Jeff URLs in the recent patch summary.
Jeff Is this happening to anybody else?
Yup.
I don't have time to look into the problem, however...
Here's a traceback:
Grant Not a big deal, but I noticed that https://mail.python.org/ is
Grant live and shows a generic Welcome to your new home in
Grant cyberspace! message. One of the webmasters may want to
Grant automatically redirect to http://mail.python.org.
Thanks, I forwarded this along to
Raymond Does anyone know what has become of ...
Raymond Charles G Waldman
I'd scratch Charles from the list. I work at the same company he did.
Nobody here has been in touch with him for over a year. Several of us have
tried to get ahold of him but to no avail.
Skip
Martin Yet, this *still* is a platform dependence. Python makes no
Martin guarantee that 1e1000 is a supported float literal on any
Martin platform, and indeed, on your platform, 1e1000 is not supported
Martin on your platform.
Are float(inf) and float(nan) supported everywhere?
Michael I suppose one could jsut do it unconditionally and wait for one
Michael of the three remaining VAX users[2] to compile Python 2.5 and
Michael then notice.
You forgot the two remaining CRAY users. Since their machines are so much
more powerful than VAXen, they have much more
Guido or perhaps even (making for VAR optional in the for-loop syntax)
Guido with
Guido in synchronized(the_lock):
Guido BODY
This could be a new statement, so the problematic issue of implicit
try/finally in every for statement wouldn't be necessary. That
PEP 340 describes the block statement translation as:
itr = EXPR1
val = arg = None
ret = False
while True:
try:
VAR1 = next(itr, arg)
except StopIteration:
if ret:
return val
me It uses a variable ret that is always False.
Gaack. Please ignore.
Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Anders How do I tell try/except that I really only meant to trap
Anders opening('file1'), but opening 'file2' is not supposed to fail so
Anders I want any exception from that propagated? Better if I could
Anders write:
Anders in opening('file1') as f1:
Anders
Pierre == Pierre Barbier de Reuille [EMAIL PROTECTED] writes:
Pierre Tom Rothamel a écrit :
I have a question/suggestion about PEP 340.
As I read the PEP right now, the code:
while True:
block synchronized(v1):
if v1.field:
Robert P.S. Do you have a valid email address, RB? I wasn't able to fix
Robert up your nospam address by hand.
That's because it didn't need fixing... Note Reinhold's sig:
Reinhold --
Reinhold Mail address is perfectly valid!
wink
Skip
mwh Fix test_site to not call open('...', 'wU'), as that now raises an
mwh error.
mwh Is anyone running the test suite regularly at the moment?
Whoops. I obviously failed to run it after applying that change. My
apologies.
Skip
___
Reinhold - Flat namespace: Should we tend to a more hierarchic library
Reinhold (e.g. inet.url, inet.http, inet.nntp)? This would increase
Reinhold clarity when searching for a module.
We've talked about this before. The main technical challenge seems to be
backward
Barry == Barry Warsaw [EMAIL PROTECTED] writes:
Barry On Mon, 2005-06-06 at 14:38, Skip Montanaro wrote:
import urllib
from www.urllib import urlopen
the module-level code should only be executed once, and
urlopen == urllib.urlopen
should evaluate
Tim On 6/6/05, Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
- Flat namespace: Should we tend to a more hierarchic library (e.g.
inet.url, inet.http, inet.nntp)? This would increase clarity when
searching for a module.
Tim -1. I feel the opposite way: when trying to figure
Raymond Add untokenize() function to allow full round-trip tokenization.
Raymond Should significantly enhance the utility of the module by
Raymond supporting the creation of tools that modify the token stream
Raymond and writeback the modified result.
Raymond,
Very interesting.
I'm horsing around with recognizing switch-like if statements like:
if x == 1:
print 1
elif x == 2:
print 2
else:
print unknown
in the compiler and generating O(1) code. x can be any expression, but
must be precisely the same in each elif clause, the
Michael ... but if there's some side effect going on here, I don't see
Michael it. What am I missing?
Mea culpa. I was thinking of the print as a side efefct. Obviously
mistaken.
Skip
___
Python-Dev mailing list
Python-Dev@python.org
Michael So I went looking for other instances of the same problem. I
Michael didn't find any (though I don't understand how _csv.c gets away
Michael with line 1579)...
Same reason the Py_INCREF of ProfileError isn't necessary I think.
PyDict_New() returns a new reference which is
Michael ... (though I don't understand how _csv.c gets away
Michael with line 1579)...
Michael Oops; I meant line 1590.
Hmmm... Me either. Is it possible it was just never DECREF'd? I checked
in the obvious fix on both head and the 2.4 release branch.
Skip
I updated the patch that supports PEP 304, Controlling Generation of
Bytecode Files to apply cleanly against current CVS. I've tested it on Mac
OS X (straight Unix build only). I'd appreciate it if some Linux, Windows
and Mac framework folks could apply the patch, rebuild, then run the tests
Skip http://python.org/sf/677103
Thomas There's no patch attached.
*sigh*
Thanks for noticing the problem. Apparently, since I last updated the
patch, SF implemented a 250kbyte limit on file uploads. This one is big
because it includes a suitably modified configure script that was
Why this discussion of yet another serialization format? The wire-encoding
for XML-RPC is quite stable, handles all the basic Python types proposed in
the proto-PEP, and is highly interoperable. If performance is an issue,
make sure you have a C-based accelerator module like sgmlop installed.
Simon XML is simply not suitable for database appplications, real time
Simon data capture and game/entertainment applications.
I use XML-RPC as the communications protocol between an Apache web server
and a middleware piece that talks to a MySQL database. The web server
contains a
Simon I hacked things a bit, and instead of sending XML, sent pickles
Simon inside the XML response.
I've done the same thing (I think I may have used marshal). It works fine
as long as you know both ends are Python.
Skip
___
Python-Dev
Raymond Suggest rejecting this PEP and making a note for Py3.0 to
Raymond either sync-up the type names or abandon the types module
Raymond entirely.
I thought the types module was already deprecated, at least verbally if not
officially.
Skip
As I see it, a lambda is an anonymous function. An anonymous function
is a function without a name. We already have a syntax for a
function... why not use it. ie:
f = filter(def (a): return a 1, [1,2,3])
Kay You mix expressions with statements.
You could remove
Fredrik Is there actually much code around that relies on the
Fredrik particular precision of 32- or 64-bit binary floats for
Fredrik arithmetic, and ceases working when higher precision is
Fredrik available?
Umm, yeah... The path you take from one or more string literals
I wrote PEP 304, Controlling Generation of Bytecode Files:
http://www.python.org/peps/pep-0304.html
quite awhile ago. The first version appeared in January 2003 in response to
questions from people about controlling/suppressing bytecode generation in
certain situations. It sat idle for a
Phillip It has many ways to do the same thing, and many of its property
Phillip and method names are confusing because they either do the same
Phillip thing as a standard function, but have a different name (like
Phillip the 'parent' property that is os.path.dirname in disguise),
Walter I think ctime, mtime and atime should be (or return)
Walter datetime.datetime objects instead of integer timestamps.
+1
Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Phillip ... but have a different name (like the 'parent' property that
Phillip is os.path.dirname in disguise) ...
Phillip ... (like the 'listdir()' method that returns full paths rather
Phillip than just filenames).
Skip To the extent that the path module tries to provide a
We're getting enough discussion about various aspects of Jason's path module
that perhaps a PEP is warranted. All this discussion on python-dev is just
going to get lost.
Skip
___
Python-Dev mailing list
Python-Dev@python.org
Configure with --without-cxx to not use g++. Since there is an
option in configure, I assume it is intentional.
Dave O-kay... any idea what the rationale for this decision might be?
I believe it's so that people can link in libraries written in C++ and have
them initialized
Brett #. Gather important information
Brett Info such as Python version, operating system version, etc.;
Brett anything that might have influenced the code that lead to the
Brett bug.
I'd change this to something more explicit:
# Gather important information
Ummm... What's a context manager?
Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Ummm... What's a context manager?
Michael Something that goes
Michael with ... as var:
Michael ^ here
Michael If you have a better name, feel free to suggest it, but please
Michael catch up on python-dev first (it's been discussed to
Michael unconsciousness,
raymond Log Message:
raymond Brett requests that Flovis's permissions be dropped.
Not to put too fine a spin on things, but I think it was more like Brett got
tired of waiting for Flovis's permissions to be increased and retracted his
original request.
Skip
That leaves error reduction and clarity as the main motivations for
changing 'and' and 'or' to act like '' and '||' and for introducing a
conditional operator to handle everyone's favorite use cases.
I predict that people who use and and or correctly today will
start confusing with and ||
Anthony I've done a lot of the work to get Python to build with g++ -
Is this on a branch or available as a patch somewhere?
It's the trunk.
Is there a primer that will get me to where Anthony is? I tried the obvious
CC=g++ ./configure --with-cxx=g++
and the build fails trying
I'm unable to get the (apprently external?) 2to3 to update:
% svn up
Fetching external item into 'Tools/2to3'
svn: PROPFIND request failed on '/projects/sandbox/trunk/2to3'
svn: PROPFIND of '/projects/sandbox/trunk/2to3': could not connect
to server (http://svn.python.org)
Something
I don't know what svnmerge.py is ...
As always, the dev FAQ has the answer you are looking for:
http://python.org/dev/faq/#how-do-i-merge-between-branches .
OK, I ran svnmerge, resolved conflicts, ran the tests, checked in the
changes with the commit message svnmerge generated. Am I supposed
I'd like to try backporting the multiprocessing module to Python 2.4. My first
problem appears to be the reliance on a complete(?) rewrite of the buffer stuff.
Any clues about transforming this code would be much appreciated.
(Note: I'm backporting because the Python 2.6 version appears to be
I had been approached to do the exact same thing, are you trying to
back port the trunk version (2.6) or py3000?
I'm trying to backport from 2.6. It appears that the buffer stuff is
completely
new though (backported from Python 3.0).
S
___
A friend at work who is new to Python wondered why this didn't work with
pickle:
class Outer:
Class Inner:
...
def __init__(self):
self.i = Outer.Inner()
I explained:
http://docs.python.org/library/pickle.html#what-can-be-pickled-and-unpickled
One of my colleagues with a background in the high performance computing
realm sent me this press release:
http://www.pathscale.com/ekopath4-open-source-announcement
I'm not personally familiar with the Pathscale compilers, but thought some
folks here might be and might want to experiment
I'd like to urge stdlib contributors and core devs to
heed it -- or explain why you can't.
Where I can, I do, however I often find it difficult to come up with a
one-liner, especially one that mentions the parameters to functions.
If the one-line rule is going to be violated, I go whole hog and
http://mail.python.org/pipermail/python-list/2013-July/653046.html
One correspondent objected that I was artificial biasing my histogram
because wrapped lines are, more-or-less by definition, going to be
80 characters. Off-list I responded with a modified version of my
graph where I eliminated
It is also likely that the mentor gets overworked after the GSoC period is
over,
is unable to finalize the patch and push it...
Given that Python development is done using a good DVCS now, it seems
that if each manageable chunk of changes is done on a separate branch,
the likelihood of
We then realized that it isn't really used by anyone (pydoc uses it but it
should have been using textwrap). Looking at the history of the module it
has just been a magnet for cleanup revisions and not actual usage or
development since Guido added it back in 1995.
Note that it is/was used in
On Thu, Sep 05, 2013 at 02:35:16PM -0400, Donald Stufft don...@stufft.io
wrote:
Persona is the logical successor to OpenID.
OpenID lived a short life and died a quiet death. I'm afraid Persona
wouldn't live even that much. Dead-born idea, in my so humble opinion.
I don't think there's
I think Persona is just too new to see it around much yet. Or maybe Mozilla
needs better PR.
The Persona site touts: Signing in using Persona requires only a
valid email address; allowing you to provide personal information on
as-needed basis, when and where you think it’s appropriate.
They
Whether a given site chooses to authroize an
authenticated-but-otherwise-unknown user to do anything meaningful is
logically distinct.
But the least they could have done was pick a demo site that didn't do
exactly what they contend you shouldn't need to do: cough up all sorts
of personal
I have spend a very long time on a patch for Dtrace support in most
platforms with dtrace available. Currently working under Solaris and
derivatives, and MacOS X. Last time I checked, it would crash FreeBSD
because bugs in the dtrace port, but that was a long time ago.
I looked at this
However, it's common in economic statistics to have a rectangular
array, and extract both certain rows (tuples of observations on
variables) and certain columns (variables). For example you might
have data on populations of American states from 1900 to 2012, and
extract the data on New
(case-insensitive but case-preserving, as the best filesystems are ;-))
I have a sweet spot for transformdict myself.
Antoine,
Transform does not remind me of case-insensitive but
case-preserving. If this is important enough to put into the
collections module (I'm skeptical), shouldn't that
Seriously, I'm curious: what needs to mature, according to you?
In my mind, its availability on PyPI along with demonstrated use in
the wild (plus corresponding votes to demonstrate that people use/like
it) would help. That you can find several implementations at this
doesn't mean it's
Note: Because dir() is supplied primarily as a convenience for
use at an interactive prompt [...]
This was always my interpretation of its intent. In fact, I use a
customized dir() for my own needs which would probably break inspect
(elides _-prefixed functions by default, notes modules or
I don't really understand why the releases should be manually listed.
Is it some kind of defensive coding?
I think it's to give people who care about such things all the
information they need to make informed decisions. As I recall, the 1.6
series was problematic, because it wasn't actually
As a MacBook Pro user running Snow Leopard/10.6.8, I would find the
lack of a binary release problematic, were it not for the fact that I
routinely build from source (and don't do anything Mac-specific with
Python). For those not familiar with the platform, it's perhaps worth
noting that upgrade
That's why I get my Python (for Snow Leopard) from MacPorts.
Unless things have changed, that probably doesn't support Mac-specific
stuff, does it?
I was thinking more of non-developer users who are likely to need/want
Mac-specific interfaces for tools which are written in Python. That
might
It would be great if the docstring contained a link to the online
documentation.
That would have to be a feature of help(), not hardcoded in each docstring.
That *is* a feature of the help function:
Help on built-in module sys:
help(sys)
NAME
sys
FILE
(built-in)
MODULE DOCS
https://github.com/python/cpython is now live as a semi-official, *read
only* Github mirror of the CPython Mercurial repository. Let me know if you
have any problems/concerns.
Thanks for this, Eli. I use git regularly at work, so I'm getting much
more comfortable with it. Do you have a
Splitting into two pieces also means you can implement it for 3.4
first and identify possible problems caused by preexisting pip
installs before deciding whether to add it to 2.7 and 3.3.
Skip
___
Python-Dev mailing list
Python-Dev@python.org
If this love-in continues I'll prep a release tonight and commit it in the
morning... just before my flight home across the Atlantic.
You've got it backwards. You're supposed to release, then leave town
for two weeks, not come home to field complaints. I think it might
even be in the Zen of
1 - 100 of 323 matches
Mail list logo