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
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
menti
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 Mon
Terry> The page http://www.python.org/download/ needs to be added to the
Terry> list of things updated with a new release.
Terry,
I'll let others take care of that list (I don't know where it's kept). In
the meantime, I updated the download page to reference 2.4.1.
Skip
__
> "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 trace
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 alon
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 every
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 mor
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 comp
Guido> At the same time, having to use it as follows:
Guido> for f in with_file(filename):
Guido> for line in f:
Guido> print process(line)
Guido> is really ugly, so we need new syntax, which also helps with
Guido> keeping 'for' semantically backwa
Nick> But while you can mark functions to be called with the 'register'
Nick> method, there's no 'unregister' method to remove them from the
Nick> stack of functions to be called. Nor is there any way to view
Nick> this stack and e.g. call 'del' on a registered function.
Nick
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:
http://mail.python.org/mailman/options/python-dev/arch
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.fie
>>>>> "Guido" == Guido van Rossum <[EMAIL PROTECTED]> writes:
Guido> [Skip Montanaro]
>> Yeah, but "block synchronized(v1)" doesn't look like a loop. I think
>> this might be a common stumbling block for people using this
Guido> Nice one. Should be a piece of cake to implement. Please talk to
Guido> [EMAIL PROTECTED] about getting it checked into the PEP database.
Guido> I'm +1 on accepting this now -- anybody against?
I'm not against it, but I thought there were ambiguity reasons that this
construct
Tim> What about `else` mixed with try/except/finally?
Tim> try:
Tim> A
Tim> except:
Tim> B
Tim> else:
Tim> C
Tim> finally:
Tim> D
Tim> If A executes without exception, does D execute before or after C?
According to Guido, execution is A, C
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!
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
___
Py
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 compatib
>>>>> "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 e
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
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 interesti
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 comp
Raymond> I think it unwise to allow x to be any expression.
How do you decide what's "too complex"? Even an apparently simple variable
can have side effects, so the semantic change bit is important no matter how
complex the expression. (Consider the builtin help object. Type it at the
pr
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
http:
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
Armin> But it's all quite obscure.
If this was comp.lang.python I'd nominate this for QOTW...
Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
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 ge
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. I
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 mixt
> > 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 t
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 mail
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 co
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
re
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
Unsubscri
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 provi
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
http://mail.python.org/mail
>> 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 p
>> I believe it's so that people can link in libraries written in C++
>> and have them initialized properly.
Dave> Can you give specifics? What do you mean by "link in?" Do you
Dave> mean "statically link into the Python interpreter," or something
Dave> else?
Probably not.
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> unconsc
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
Greg Ewing canterbury.ac.nz> writes:
>
> Raymond Hettinger wrote:
> > I propose that in Py3.0, the "and" and "or" operators be simplified to
> > always return a Boolean value instead of returning the last evaluated
> > argument.
>
> But then I would no longer be able to write
>
>foo = some
> 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 "&&" wit
301 - 353 of 353 matches
Mail list logo