Re: Guido rethinking removal of cmp from sort method

2011-04-02 Thread Brian Quinlan
I suspect that this debate is a sink hole that I won't be able to escape from alive but... On 2 Apr 2011, at 19:29, harrismh777 wrote: In other words, does the PSF have a responsibility to maintain the L.sort(cmp= key= reverse=) interface for strictly *philosophical* principle based on e

Re: Guido rethinking removal of cmp from sort method

2011-04-02 Thread Brian Quinlan
On 3 Apr 2011, at 16:22, geremy condra wrote: I think we're talking at cross purposes. The point I'm making is that there are lots of issues where popularity as a third party module isn't really a viable test for whether a feature is sufficiently awesome to be in core python. As part of determini

Re: Guido rethinking removal of cmp from sort method

2011-04-02 Thread Brian Quinlan
On 3 Apr 2011, at 15:30, harrismh777 wrote: Brian Quinlan wrote: I suspect that this debate is a sink hole that I won't be able to escape from alive but... ... live long and prosper my friend. Something to consider is that OOP philosophy is technically one of the most aest

Re: "no variable or argument declarations are necessary."

2005-10-04 Thread Brian Quinlan
Have those of you who think that the lack of required declarations in Python is a huge weakness given any thought to the impact that adding them would have on the rest of the language? I can't imagine how any language with required declarations could even remotely resemble Python. And if you wa

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Brian Quinlan
Paul Rubin wrote: > Brian Quinlan <[EMAIL PROTECTED]> writes: > >>Have those of you who think that the lack of required declarations in >>Python is a huge weakness given any thought to the impact that adding >>them would have on the rest of the language? I can

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Brian Quinlan
Paul Rubin wrote: >>Which is evaluated at runtime, does not require that the actual global >>variable be pre-existing, and does not create the global variable if >>not actually assigned. I think that is pretty different than your >>proposal semantics. > > > Different how? Aren't you looking for

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Brian Quinlan
Paul Rubin wrote: > You'd have to declare any variable global, or declare it local, or it > could be a function name (defined with def) or a function arg (in the > function scope), or maybe you could also declare things like loop > indices. If it wasn't one of the above, the compiler would flag it

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Brian Quinlan
Paul Rubin wrote: > Brian Quinlan <[EMAIL PROTECTED]> writes: > >>OK. The Python compiler would check that the name is declared but it >>would not check that it is defined before use? So this would be >>acceptable: >> >>def foo(): >> local x

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Brian Quinlan
Paul Rubin wrote: >> Right now, the compiler DOES NOT examine the contents of the other >> modules. All it does is generate an IMPORT_NAME instruction which is >> evaluation during runtime. > > > > In that case the other module gets compiled when the IMPORT_NAME > instruction is executed.

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Brian Quinlan
Paul Rubin wrote: > Brian Quinlan <[EMAIL PROTECTED]> writes: > >>Without a clear idea of the nature of the proposal, it is impossible >>to assess it's costs and benefits. So could a proponent of optional >>declarations please provide a more clear proposal?

Python Programming Contest

2005-07-15 Thread Brian Quinlan
I've decided that it would be be fun to host a weekly Python programming contest. The focus will be on algorithms that require a bit of thought to design but not much code to implement. I'm doing to judge the solutions based on execution speed. It sucks but that is the easiest important considerat

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
James wrote: > I am not sure if it is a good idea to use a LiveCD for OS when you are > testing for speed. CD access speeds fluctuate and may even impact > performance even if you start measuring after the module loading is > complete. It didn't seem to matter in my testing. Module loading is done

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Brian> I've decided that it would be be fun to host a weekly Python > Brian> programming contest. The focus will be on algorithms that require > Brian> a bit of thought to design but not much code to implement. > > For some of us that's what we do day-in, day

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
Bill Mill wrote: > On 7/15/05, Brian Quinlan <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Brian> I've decided that it would be be fun to host a weekly Python >>>Brian> programming contest. The focus will be on algo

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Brian> This contest is for people who like thinking about algorithms. > > Surely you must have missed the smiley... No, I saw it but it just confused me as I have no sense of humor. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest

2005-07-18 Thread Brian Quinlan
John Hazen wrote: > I have one question about the problem. Is the cost we are to minimize > the cost of arriving in the target city at all, or the cost of arriving > at the target city at the end of the final day of the schedule? Minimize the arrival cost. The arrival day is not relevant. > (If

Re: Python Programming Contest

2005-07-19 Thread Brian Quinlan
ThanhNam Nguyen wrote: > Since my NNTP server doesnt allow posting, I'll ask you directly > instead. > > Must I start from the first day? No. > For example: > > 1st day: A --> B 100 bucks > 2nd day: A --> B 60 bucks > 3rd day: A --> B 40 bucks > > What would the solution be? And for how much i

Re: Python Programming Contest

2005-07-19 Thread Brian Quinlan
ThanhNam Nguyen wrote: >>>1st day: A --> B 100 bucks >>>2nd day: A --> B 60 bucks >>>3rd day: A --> B 40 bucks >>>What would the solution be? And for how much in total? >>> >> >>There are two correct solutions: >> >>["A", "B"] # spend one night in A, then fly to B on day two (cost 80) >>["A", "A",

Re: Python Programming Contest

2005-07-20 Thread Brian Quinlan
Raymond Hettinger wrote: > I'm curious about the stability of your timing setup. If you run your > own version of fly.py several times with the same starting seed, how > much variation do you see between runs? There is very little variation (about 0.1%) but my solution is over an order of magnit

REMINDER: Python Contest

2005-07-22 Thread Brian Quinlan
This is just a reminder that the deadline for my little programming competition is Monday. Original E-mail --- I've decided that it would be be fun to host a weekly Python programming contest. The focus will be on algorithms that require a bit of thought to design but not much code to

Python Programming Contest: First results

2005-08-01 Thread Brian Quinlan
Here are the results for the first problem in the Python Programming Contest. I haven't been able to find as much time as I excepted, so my analysis is not very in depth. You can find the results here: http://www.sweetapp.com/pycontest/contest1/results.html And the problem definition here: htt

Re: Python Programming Contest: First results

2005-08-02 Thread Brian Quinlan
Tomi Kyöstilä wrote: > Why don't I see my solution (__author__ = "dOb") in the results? I'm > sure that you got it as you replied to my mail. Ahhh...sorry. I have your solution and I timed it but I don't have the results here so I can't add it to the website. I'll do it tomorrow. > Where do the

Re: Python Programming Contest: First results

2005-08-03 Thread Brian Quinlan
Brian Quinlan wrote: > Tomi Kyöstilä wrote: > >Why don't I see my solution (__author__ = "dOb") in the results? I'm >sure that you got it as you replied to my mail. Your solution is now included. See: http://www.sweetapp.com/pycontest/contest1/results.html G

Re: Python Programming Contest: First results

2005-08-03 Thread Brian Quinlan
Tomi Kyöstilä wrote: > Any idea when the next competition is coming? (it hasn't been quite > weekly as you hoped, eh? ;) Uh no. It turns out that I have less time than I thought, though a big chunk of it should be freed-up after this weekend. I do have an idea... :-) Cheers, Brian -- http://ma

Re: What are modules really for?

2005-08-11 Thread Brian Quinlan
N.Davis wrote: > Functions existing in a module? Surely if "everything is an object" > (OK thats Java-talk but supposedly Python will eventually follow this > too) There is a difference between everything being an object and everything being an instance of a class. In Python, every runtime ent

Re: Writing a small battleship game server in Python

2005-08-11 Thread Brian Quinlan
Michael Goettsche wrote: > What would be a good, but still easy way to write such a server? You could use SimpleXMLRPCServer. A client call sequence could like this: >>> s = xmlrpclib.Server('http://...') >>> token = s.join_game() # blocks until another player joins >>> s.send_board( ... ['.

Re: xmlrcp register classes

2005-09-05 Thread Brian Quinlan
Sergio Rua wrote: > Server = SimpleXMLRPCServer (('127.0.0.1',8080)) > > Server.register_instance(MyClass1()) > Server.register_instance(MyClass2()) > Server.register_instance(MyClass3()) > > What is seems to happen is that only the last class I register it is the > only one being exported. How c

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-12 Thread Brian Quinlan
Mark Dufour wrote: > The latter is certainly my goal. I just haven't looked into supporting > exceptions yet, because I personally never use them. I feel they > should only occur in very bad situations, or they become goto-like > constructs that intuitively feel very ugly. In the 5500 lines of the

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-13 Thread Brian Quinlan
Mark Dufour wrote: > You're right, I don't feel safe about that. It's a bad example. I just > prefer error codes, because the code usually becomes cleaner (at least > to me). I would really like it if I could do something like this: > > f = file(name) > if not f: > print 'error opening file

Re: Is this a bug? BOM decoded with UTF8

2005-02-11 Thread Brian Quinlan
Diez B. Roggisch wrote: I know its easy (string.replace()) but why does UTF-16 do it on its own then? Is that according to Unicode standard or just Python convention? BOM is microsoft-proprietary crap. UTF-16 is defined in the unicode standard. What are you talking about? The BOM and UTF-16 go han

Re: Is this a bug? BOM decoded with UTF8

2005-02-11 Thread Brian Quinlan
Diez B. Roggisch wrote: I'm well aware of the need of a bom for fixed-size multibyte-characters like utf16. But I don't see the need for that on an utf-8 byte sequence, and I first encountered that in MS tool output - can't remember when and what exactly that was. And I have to confess that I attri

Re: best XSLT processor?

2005-02-28 Thread Brian Quinlan
fanbanlo wrote: Which XSLT processor is the most reliable? requirement: + must support Python 2.4 + must run w/ Windows (and Linux) + not super slow My python project needs a XSLT processor + Docbook's XSLT to translate from docbook-xml -> HTML. PyXML? is it reliable? Slow? 4Suite? some said it i

Re: Small but significant memory leak in Pyana XSLT processor

2005-03-08 Thread Brian Quinlan
Ola Natvig wrote: My problem: When serving my content without the XSLT processor the process size remains the same size. (about 18MB in the windows task manager). But when I use the XSLT processor the process will slowly gain size. About 1MB for each 10k requests, and this memory are not freed.

Re: Small but significant memory leak in Pyana XSLT processor

2005-03-09 Thread Brian Quinlan
Ola Natvig wrote: I've isolated the problem a bit more. The script will not leak if line 25: transformer.transform2String(transformer.parseSource(xml), xslt) is changed to: transformer.transform2String(xml, xslt) Looks like the DOM tree or at least parts of it are not freed. But there are no need t

Re: IMAP UTF-7, any codec for that anywhere?

2004-12-01 Thread Brian Quinlan
Max M wrote: Is there any codec available for handling The special UTF-7 codec for IMAP? I have searched the web for info, but there only seem to be discussions about it. Not actual implementations. Is there something special do you need or is recipe OK? >>> u"\u00ff".encode('utf-7') '+AP8-' Cheer

Re: mapping function to vars

2004-12-09 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: I need to map a function to several variables. I'm trying to use map and lambda to do this. Here's my attempt... #!/usr/bin/env python from random import * [fee, fye, foe, fum] = map(lambda n: random(), range(4)) from random import random fee = random() fye = random() foe

Re: Python documentation moronicities (continued)

2005-04-26 Thread Brian Quinlan
I think that there are some nice ideas in the new version e.g. "Regex functions" is a nicer title than "Module contents", examples, caveats. But there are some organizational problems and the actual writting is a bit weak. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Drawing a grid on a picture

2006-08-13 Thread Brian Quinlan
Jive Dadson wrote: > I also found a reference to something called PIL. Maybe that's the > ticket. If so, where can I find it (with documentation)? Thanks. The will likely do what you want. And you can find it the same way that you would find anything online i.e. with google. But here is the l

Re: Python Syntax Highlighting Module

2006-08-21 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Hello, > I have an idea for a project which involves an editor that supports > syntax highlighting. This would be for any language, particularly php, > html, css, etc. I would like to write this program using python. It > would only make sense to base this upon existin

Re: Convert StringIO to string

2006-10-16 Thread Brian Quinlan
Jonathan Bowlas wrote: > Ahh thanks, I'll give that a try. > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > [EMAIL PROTECTED] > Sent: 16 October 2006 14:00 > To: python-list@python.org > Subject: Re: Convert StringIO to string > > Jonathan Bowlas

Re: New to Python: Do we have the concept of Hash in Python?

2006-06-01 Thread Brian Quinlan
A.M wrote: > Is there any built-in Hash implementation in Python? I am looking for a > container that I can access to it's items by name. Something like this: > > Print container["memeberName"] d = {"memberName" : "some value"} print d["memberName"] > I am asking this because I learned that DB-

Sampling a population

2006-06-02 Thread Brian Quinlan
This is less a Python question and more a optimization/probability question. Imaging that you have a list of objects and there frequency in a population e.g. lst = [(a, 0.01), (b, 0.05), (c, 0.50), (d, 0.30), (e, 0.04), (f, 0.10)] and you want to drawn n items from that list (duplicates allowed

Re: Sampling a population

2006-06-02 Thread Brian Quinlan
Robert Kern wrote: > [numpy implementation snipped] > Ed Schofield has an implementation of an algorithm by Marsaglia[1] which turns > sampling into a fast table lookup. If your probabilities have limited > precision > (2**-30 or so rather than the full double precision 2**-52 or so), then this

Vancouver Python Workshop: New Keynoter

2006-06-06 Thread Brian Quinlan
orials for beginning programmers * advanced lectures for Python experts * case studies of Python in action * after-hours social events * informative keynote speakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or con

Vancouver Python Workshop - Talk submission reminder

2006-06-13 Thread Brian Quinlan
, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportuni

Possible inaccuracy in Python 2.4 when using profiler calibration

2006-06-15 Thread Brian Quinlan
I have a misinformed theory that I'd like to share with the list. I believe that profiler calibration no longer makes sense in Python 2.4 because C functions are tracked and they have a different call overhead than Python functions (and calibration is done only using Python functions). Here is

Vancouver Python Workshop - Talk submission deadline

2006-06-15 Thread Brian Quinlan
ction * after-hours social events * informative keynote speakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to lear

Vancouver Python Conference: T-Shirt design contest

2006-06-21 Thread Brian Quinlan
The Vancouver Python Workshop organizers are having problems coming up with text for our T-Shirts (don't worry: we already have the graphics figured out). We want something that matches Python's simplicity and elegance. So we're asking for your help. If you submit the text that we end up using

Re: VPW: T-Shirt design contest

2006-06-22 Thread Brian Quinlan
Bruno Desthuilliers submitted this really cool rant/essay/something from Tim Lesher that I hadn't seen before. I think that the original source is: http://apipes.blogspot.com/2005/01/choose-python.html Choose Python. Choose readability. Choose the simple over the complex and the complex over the

VPW: Talk schedule available

2006-06-26 Thread Brian Quinlan
, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportuni

VPW: early registration deadline

2006-06-28 Thread Brian Quinlan
vents * informative keynote speakers More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportunity to

VPW: early registration deadline today!

2006-06-30 Thread Brian Quinlan
ynote speakers More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop also gives visitors the opportunity to visit one of the

Re: Behaviour of classes (tired of writing too much)

2006-09-11 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > How do I catch any reference to an instance of a class, i.e., I want to > run some code as soon as an instance of a class is used in any way. > (and I don't want to define all of __add__, __ge__ etc etc etc etc etc) What do you mean by "used in any way"? Which of these a

Re: A critique of cgi.escape

2006-09-25 Thread Brian Quinlan
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >>> It's up to me to decide whether or not an argument is good enough to >>> convince me, thank you very much. >> not if you expect anyone to take anything you say seriously. > > Now you're just being ridiculous. In this thr

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Paul Rubin wrote: > Brian Quinlan <[EMAIL PROTECTED]> writes: >> o cgi.escape is not meant for serious web application development, > > What is it meant for then? Why should the library ever implement > anything in a half-assed way unsuitable for serious application

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: >> A summary of this pointless argument: > > Your summary seems pretty reasonable, but please note that later on, > the thread was not about cgi.escape escaping (or not) quote > characters (a

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
A summary of this pointless argument: Why cgi.escape should be changed to escape double quote (and maybe single quote) characters by default: o escaping should be very aggressive by default to avoid subtle bugs o over-escaping is not likely to harm most program significantly o people who do no

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
u how you do it. Some of our web applications contain 100s of script generated pages. Testing each one by hand after making a change would be completely impossible. So we use HTTP scripting for testing purposes i.e. send this request, grab the results, verify that the test in the element with id

Re: A critique of cgi.escape

2006-09-26 Thread Brian Quinlan
Jon Ribbens wrote: > In article <[EMAIL PROTECTED]>, Brian Quinlan wrote: >> Well, there are dozens (hundreds?) of templating systems for Python. > > I know, I wrote one of them ;-) > >> t = Template("test.html") >> t['foo'] = 'Bri

Re: A critique of cgi.escape

2006-09-27 Thread Brian Quinlan
John Bokma wrote: >> Why cgi.escape should NOT be changed: >> o it is current used in lots of code and changing it will almost >>certainly break some of it, test suites at minimum e.g. >>assert my_template_system("{foo}", foo='"') == '"' > > You must be kidding. Nope. How do you write you

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Brian Quinlan
Fredrik Lundh wrote: > 4) [] and {} always create a new object every time they're evaluated. Not quite. The empty tuple is cached: >>> a = () >>> b = () >>> a is b True Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Brian Quinlan
Fredrik Lundh wrote: > Brian Quinlan wrote: > >>> 4) [] and {} always create a new object every time they're evaluated. >> Not quite. The empty tuple is cached: >> >> >>> a = () >> >>> b = () >> >>> a is b >&g

Re: Advice needed on __del__

2005-05-10 Thread Brian Quinlan
phil wrote: > I'm probably dense and don't quite get the point, even though I > have coded about 200,000 lines of Python and coded .5 million lines of > C before there was a C++ > > A class instance based language doesn't have to BE C++ to have a > destructor method. Very true. But meaningful fin

Interactive shell for demonstration purposes

2005-05-11 Thread Brian Quinlan
Can anyone recommend a Python interactive shell for use in presentations? Ideal characteristics (priority order): o configurable font size o full screen mode o readline support o syntax coloring I've tried ipython but, since it runs inside a console window, and the console window has a limited n

Re: Interactive shell for demonstration purposes

2005-05-11 Thread Brian Quinlan
Ville Vainio wrote: > Hmm, do you consider the fonts in a console window unreadable? In fullscreen mode, yes (you get no choice of font size in Windows XP). In Windowed mode you still only get a limited font selection (only two fonts and only a few type sizes [most of which are small]). > I've

Re: Interactive shell for demonstration purposes

2005-05-12 Thread Brian Quinlan
Bengt Richter wrote: > If you make your console 96 wide and set the font to Lucida Console Bold > 24point, > it will probably expand to near full screen on 1024x768. You can set the > scroll buffer > to a couple hundred lines and adjust console widow height to suit. Use the > properties > from t

Re: Building a Python app with Mozilla

2007-06-30 Thread Brian Quinlan
Kevin Walzer wrote: > Komodo is not a Python application. It is a Mozilla application that > supports Python development. Komodo is more akin to Thunderbird and > Firefox than anything else; it uses the XUL framework for rendering > widgets, if I'm not mistaken. If you want to build an applicati

Re: XMLRPC Server

2007-02-06 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Hi, I'm trying to create an XMLRPC server using apache + python (cgi). > It's not too difficult to configure everything, but I would like to > tune it in order to receive up to 2000 calls per minute without any > problems. That doesn't seem like excessive volume. Why no

Re: XMLRPC Server

2007-02-06 Thread Brian Quinlan
Fredrik Lundh wrote: > well, if you're talking pure CGI, you need to start the interpreter, > import the required modules, connect to the database, unmarshal the > xml-rpc request, talk to the database, marshal the response, and shut > down, in less than 30 milliseconds. > > just importing the

Importing modules through directory shortcuts on Windows

2006-04-26 Thread Brian Quinlan
Recently, I became responsible for maintaining some Python code, which was organized as follows: user/pylib ui ... project2/pylib ui ... project3/pylib ui ... python-packages/user => /user/pylib project2 => /project2/pylib

ANN: Vancouver Python Workshop

2006-05-15 Thread Brian Quinlan
* case studies of Python in action * after-hours social events * informative keynote speakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition

Re: Tabs versus Spaces in Source Code

2006-05-15 Thread Brian Quinlan
Edward Elliott wrote: > Tab is not 4 spaces. Tab is 1 level of indentation. The confusion that > tabs equals some fixed width, or can/should be set to some fixed width, is > the entire problem hampering their use. It implies that conversion between > tabs and spaces is straightforward when it is

ANN: Vancouver Python Workshop - keynote speakers announced

2006-05-18 Thread Brian Quinlan
eakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver Python Workshop

Vancouver Python Workshop - registration open

2006-05-22 Thread Brian Quinlan
ative keynote speakers * tracks on multimedia, Web development, education and more More information see: http://www.vanpyz.org/conference/ or contact Brian Quinlan at: [EMAIL PROTECTED] Vancouver = In addition to the opportunity to learn and socialize with fellow Pythonistas, the Vancouver P

Re: python3 - the hardest hello world ever ?

2008-10-14 Thread Brian Quinlan
Hey Helmut, Did you try just: print("Hallo, Süßes Python") Cheers, Brian Helmut Jarausch wrote: Hi, do I miss something (I do hope so) or is switching to Python3 really hard for Latin1-users? My simplest hello world script - which uses a few German umlaut characters - doesn't look very intu

Re: XMLRPC - persistent object state on server

2009-04-10 Thread Brian Quinlan
Demidov Andrey wrote: class MyClass: def __init__(self, a): self.a = a # and some heavy works which I would like to do once def say(self): return a Change: def say(self): return a to: def say(self): return self.a Cheers, Brian -

Java-style futures in Python - only better

2009-05-10 Thread Brian Quinlan
Hey all, I've been working on an Java-style futures implementation in Python. Futures are a way of representing asynchronous operations e.g. operations that are run in another thread or process. The are are a easy but powerful way of parallelizing sequential operations. The also provide a con

Re: Java-style futures in Python - only better

2009-05-10 Thread Brian Quinlan
named the module "futures" (plural) to try to reduce the potential confusion with the "__futures__" module. The concept of a future is fairly well known in CS [http://en.wikipedia.org/wiki/Future_(programming)] so giving it a completely different name would be a bit annoying. C

Odd closure issue for generators

2009-06-04 Thread Brian Quinlan
This is from Python built from the py3k branch: >>> c = (lambda : i for i in range(11, 16)) >>> for q in c: ... print(q()) ... 11 12 13 14 15 >>> # This is expected >>> c = (lambda : i for i in range(11, 16)) >>> d = list(c) >>> for q in d: ... print(q()) ... 15 15 15 15 15 >>> # I was ver

Re: Odd closure issue for generators

2009-06-04 Thread Brian Quinlan
Gabriel Genellina wrote: En Thu, 04 Jun 2009 18:40:07 -0300, Brian Quinlan escribió: This is from Python built from the py3k branch: It's not new; same thing happens with 2.x A closure captures (part of) the enclosing namespace, so names are resolved in that environment even afte

Re: Odd closure issue for generators

2009-06-04 Thread Brian Quinlan
Scott David Daniels wrote: [snipped] When you evaluate a lambda expression, the default args are evaluated, but the expression inside the lambda body is not. When you apply that evaluated lambda expression, the expression inside the lambda body is is evaluated and returned. But that's not real

Re: Python and Flaming Thunder

2008-05-22 Thread Brian Quinlan
Dave Parker wrote: Or just: If command is "quit" ... Hmmm. In Flaming Thunder, I'm using "is" (and "is an", "is a", etc) for assigning and checking types. For example, to read data from a file and check for errors: Read data from "input.txt". If data is an error then go to ... H

Using an DTD not specified in XML file for validation

2008-08-06 Thread Brian Quinlan
Hey, I'm trying to figure out how I can validate an XML file using a DTD that isn't specified in the XML file. My code so far is: from xml import sax from xml.sax import sax2exts parser = sax2exts.XMLValParserFactory.make_parser() parser.setContentHandler(handler) parser.setErrorHandler(han

New Python logo in high resolution format

2006-03-24 Thread Brian Quinlan
Is the new Python logo (i.e. http://python.org/images/python-logo.gif) available someone in a high-resolution format? That would be nice to integrate into websites, T-shirts, etc. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: XMLRPCServer issues

2006-03-27 Thread Brian Quinlan
1. Is there on option to get cx_Oracle to return string data as unicode rather than strings objects? XML-RPC aside, dealing with unicode objects might be better than dealing with encoded strings. 2. You might want to transmit integers as strings rather than use the XML-RPC integer type (which i

Re: New Python logo in high resolution format

2006-03-28 Thread Brian Quinlan
The new Python logo is available in high-resolution format here: http://tinyurl.com/n4rge Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: tips for this exercise?

2006-03-28 Thread Brian Quinlan
John Salerno wrote: > I'm working on another exercise now about generating random numbers for > the lottery. What I want to do is write a function that picks 5 random > numbers from 1-53 and returns them. Here's what I have so far: > > numbers = range(1, 54) > > def genNumbers(): > for x i

Re: Working with files in a SimpleXMLRPCServver

2006-03-31 Thread Brian Quinlan
Jose Carlos Balderas Alberico wrote: > I'm setting up a server accepting XML-RPC calls using the > SimpleXMLRPCServer class. Basically, what I have to do is send a > zip-compressed file to the server, have the server unzip it and process > it, after processing it the server is supposed to zip th

Re: download for official Python logo artwork?

2006-04-08 Thread Brian Quinlan
has wrote: > Anyone know where I can find source artwork, preferably vector-based, > for python.org's new 'ying-yang' snake icon? I think it's hiding. > Thanks. > I don't know how office it is, but you can get the artwork here: http://tinyurl.com/n4rge Cheers, Brian -- http://mail.python.org/mai

Re: XML-RPC server via xinetd

2006-04-17 Thread Brian Quinlan
Jos Vos wrote: > The problem is that I do not see how to let an SimpleXMLRPCServer > instance *not* bind to a port or what other class I can use to just > build a XML-RPC request handler reading/writing from stdin/stdout, > i.s.o. carrying all the server class stuff with it. I think that the prob

Re: XML-RPC server via xinetd

2006-04-17 Thread Brian Quinlan
Jos Vos wrote: > On Mon, Apr 17, 2006 at 03:30:04AM -0500, Nick Craig-Wood wrote: > >> UTSL ;-) >> >> Look at /usr/lib/python2.4/SimpleXMLRPCServer.py (adjust as per your >> distro) and in particular the definition of the CGIXMLRPCRequestHandler >> class. > > I did this before posting my questio

Re: SimpleXMLRPCServer clobbering sys.stderr? (2.5.2)

2009-10-21 Thread Brian Quinlan
Do you have some code that we could see that provokes the problem? Cheers, Brian Joseph Turian wrote: I was having a mysterious problem with SimpleXMLRPCServer. (I am using Python 2.5.2) The request handlers were sometimes failing without any error message to the log output. What I discovered

multiprocessing deadlock

2009-10-22 Thread Brian Quinlan
My test reduction: import multiprocessing import queue def _process_worker(q): while True: try: something = q.get(block=True, timeout=0.1) except queue.Empty: return else: print('Grabbed item from queue:', something) def _make_som

Re: multiprocessing deadlock

2009-10-23 Thread Brian Quinlan
On 24 Oct 2009, at 00:02, paulC wrote: On Oct 23, 3:18 am, Brian Quinlan wrote: My test reduction: import multiprocessing import queue def _process_worker(q): while True: try: something = q.get(block=True, timeout=0.1) except queue.Empty

Re: multiprocessing deadlock

2009-10-23 Thread Brian Quinlan
On 24 Oct 2009, at 06:01, paulC wrote: Hey Paul, I guess I was unclear in my explanation - the deadlock only happens when I *don't* call join. Cheers, Brian Whoops, my bad. Have you tried replacing prints with writing a another output Queue? I'm wondering if sys.stdout has a problem. Re

Re: multiprocessing deadlock

2009-10-23 Thread Brian Quinlan
On 24 Oct 2009, at 14:10, Gabriel Genellina wrote: En Thu, 22 Oct 2009 23:18:32 -0300, Brian Quinlan escribió: I don't like a few things in the code: def _do(i): print('Run:', i) q = multiprocessing.Queue() for j in range(30): q.put(i*30+j

Re: multiprocessing deadlock

2009-10-24 Thread Brian Quinlan
On 24 Oct 2009, at 19:49, Gabriel Genellina wrote: En Sat, 24 Oct 2009 02:48:38 -0300, Brian Quinlan escribió: On 24 Oct 2009, at 14:10, Gabriel Genellina wrote: En Thu, 22 Oct 2009 23:18:32 -0300, Brian Quinlan > escribió: I don't like a few things in the code: I'm actuall

Re: multiprocessing deadlock

2009-10-24 Thread Brian Quinlan
On 24 Oct 2009, at 21:37, larudwer wrote: "Brian Quinlan" schrieb im Newsbeitrag news:mailman.1895.1256264717.2807.python-l...@python.org... Any ideas why this is happening? Cheers, Brian IMHO your code is buggy. You run in an typical race condition. consider following pa

futures - a new package for asynchronous execution

2009-11-05 Thread Brian Quinlan
Hey all, I recently implemented a package that I'd like to have include in the Python 3.x standard library (and maybe Python 2.x) and I'd love to have the feedback of this list. The basic idea is to implement an asynchronous execution method patterned heavily on java.util.concurrent (but

Re: why does "help(import)" not work?

2009-11-06 Thread Brian Quinlan
Hi Robert, help() is just a regular function that must be called with correct Python syntax and the import keyword is not allowed in an argument list. The correct syntax is: help('import') Cheers, Brian On 6 Nov 2009, at 20:56, Robert P. J. Day wrote: i'm sure there's a painfully obviou

  1   2   >