Re: [Python-Dev] Encoding detection in the standard library?

2008-05-11 Thread Greg Wilson

Bill Janssen:
Since the site that receives the POST doesn't necessarily have access to 
the Web page that originally contained the form, that's not really 
helpful.  However, POSTs can use the MIME type "multipart/form-data" for 
non-Latin-1 content, and should.  That contains facilities for 
indicating the encoding and other things as well.


Yup, but DrProject (the target application) also serves as a relay and 
archive for email.  We have no control over the agent used for 
composition, and AFAIK there's no standard way to include encoding 
information.


Thanks,
Greg
___
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


[Python-Dev] decorators article for DDJ?

2004-12-10 Thread Greg Wilson
Hi folks.  Is anyone interested in doing an article on Python decorators
for "Doctor Dobb's Journal"?  If so, please drop me a line...

Thanks,
Greg
___
Python-Dev mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] PSF grant / contacts

2005-08-09 Thread Greg Wilson
Hi,

I'm working with support from the Python Software Foundation to develop an
open source course on basic software development skills for people with
backgrounds in science and engineering.  I have a beta version of the
course notes ready for review, and would like to pull in Python-friendly
people in sci&eng to look it over and give me feedback.  If you know
people who fit this bill (particularly people who might be interested in
following along with a trial run of the course this fall), I'd be grateful
for pointers.

Thanks,
Greg Wilson
___
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


Re: [Python-Dev] [Argon] Re: 51 Million calls to _PyUnicodeUCS2_IsLinebreak() (???)

2005-08-25 Thread Greg Wilson
Hi Martin (and everyone else); thanks for your mail.  The N*N/2
invocations would explain why we saw such a large number of invocations
--- thanks for figuring it out.  W.r.t. how we're invoking our script:

> > But if you're using CGI, you're importing your source on every
> > invocation.
>
> Well, no. Only the CGI script needs to be parsed every time; all modules
> could load off bytecode files.
>
> Which suggests that Keir Mierle doesn't use bytecode files, I think he
> should.

Yes, mod_python and .pyc's are the obviously way to go --- once the code
actually works ;-).  I just wanted students to have as few moving parts as
possible while debugging.

Thanks again,
Greg
___
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


Re: [Python-Dev] [Argon] Re: 51 Million calls to _PyUnicodeUCS2_IsLinebreak() (???)

2005-08-25 Thread Greg Wilson
> > Walter Dörwald wrote:
> >>At least it would remove the quadratic number of calls to
> >>_PyUnicodeUCS2_IsLinebreak(). For each character it would be called only
> >>once.

> Martin v. Löwis wrote:
> > Correct. However, I very much doubt that this is the cause of the
> > slowdown.

> Walter Dörwald wrote:
> Probably. We'd need a test with the original Argon source to really know.

We can do that.

> OK, so should we add this for 2.4.2 or only for 2.5?

2.4.2 please ;-)

Thanks,
Greg
___
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


[Python-Dev] syntactic support for sets

2006-02-01 Thread Greg Wilson
Hi,

I have a student who may be interested in adding syntactic support for
sets to Python, so that:

x = {1, 2, 3, 4, 5}

and:

y = {z for z in x if (z % 2)}

would be legal.  There are of course issues (what's the syntax for a
frozen set? for the empty set?), but before he even starts, I'd like to
know if this would ever be considered for inclusion into the language.

Thanks,
Greg

p.s. please Cc: me as well as the list, since I'm no longer subscribed.
___
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


Re: [Python-Dev] syntactic support for sets

2006-02-02 Thread Greg Wilson
> Generator expressions make syntactic support irrelevant:

Not when you're teaching the language to undergraduates: I haven't
actually done the study yet (though I may this summer), but I'm willing to
bet that allowing "math" notation for sets will more than double their
use.  (Imagine having to write "list(1, 2, 3, 4, 5)"...)

> Accordingly,Guido rejected the braced notation for set comprehensions.
> See:  http://www.python.org/peps/pep-0218.html

"...however, the issue could be revisited for Python 3000 (see PEP 3000)."
So I'm only 1994 years early ;-)

Thanks,
Greg
___
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


Re: [Python-Dev] syntactic support for sets

2006-02-02 Thread Greg Wilson
> The PEP records that Tim argued for leaving the extra parentheses. What
> would you do with {'title'} -- create a four element set consisting of
> letters or a single element set consisting of a string?

This is a moderately-fertile source of bugs for newcomers: judging from
the number of students who come into my office with code that they think
ought to work, but doesn't, most people believe that:

set(1, 2, 3)

is "right".  I believe curly-brace notation would eliminate this problem.

Thanks,
Greg
___
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


Re: [Python-Dev] syntactic support for sets

2006-02-02 Thread Greg Wilson
> Like many things in Python where people pre-emptively believe one thing
> or another, the interpreter's corrective feedback is immediate:

Yup, that's the theory; it's a shame practice is different.

> Once the students have progressed beyond academic finger drills and have
> started writing real code, have you observed a shift in emphasis away
> from hard-coded literals and towards something like s=set(data) where
> the data is either read-in from outside the script or generated by
> another part of the program?

The problem is that once people classify something as "hard" or "fragile",
they (consciously or unconsciously) avoid it thereafter, which of course
means that it doesn't get any easier or more robust, since they're not
practicing it.  This has been observed in many arenas, not just
programming.  I agree it's not a compelling reason to add set notation to
the language, but I'd rather eliminate the sand traps than reuqire people
to learn to recognize and avoid them.

Thanks,
Greg
___
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


Re: [Python-Dev] syntactic support for sets

2006-02-03 Thread Greg Wilson
> > > Raymond:
> > > Accordingly,Guido rejected the braced notation for set comprehensions.
> > > See:  http://www.python.org/peps/pep-0218.html

> > Greg:
> > "...however, the issue could be revisited for Python 3000 (see PEP 3000)."
> > So I'm only 1994 years early ;-)

> Alex:
> Don't be such a pessimist, it's ONLY 994 years to go!

Greg:
I was allowing for likely schedule slippage... ;-)

G
___
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