Re: [Python-Dev] Draft PEP for time zone support.

2012-12-11 Thread Robert Brewer
> Why is it True by default? Do we have statistics showing that Python > > gets more use in summer? > > My question exactly. "Summer" in the USA, at least, is 238 days in 2012, while "Winter" into 2013 is only 126 days: >>> import datetime >>&g

Re: [Python-Dev] Maintenance burden of str.swapcase

2011-09-12 Thread Robert Brewer
d as well. Not to mention it doesn't work for WWW-Authenticate or TE, to give just a couple of examples. Robert Brewer fuman...@aminus.org ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-07 Thread Robert Brewer
Paul Moore wrote: > Robert Brewer wrote: > > P.J. Eby wrote: > > > Also, it should be mentioned that none of this would be > > > necessary if we could've gotten a "bytes of a known encoding" > > > type. > > > > Still looking forward

Re: [Python-Dev] PEP 3333: wsgi_string() function

2011-01-07 Thread Robert Brewer
P.J. Eby wrote: > At 09:43 AM 1/7/2011 -0500, James Y Knight wrote: > >On Jan 7, 2011, at 6:51 AM, Victor Stinner wrote: > > > I don't understand why you are attached to this horrible hack > > > (bytes-in-unicode). It introduces more work and more confusing than > > > using raw bytes unchanged. > >

Re: [Python-Dev] Proposal: make float.__str__ identical tofloat__repr__ in Python 3.2

2010-07-29 Thread Robert Brewer
sion that floats needed 17 decimal digits to avoid losing precision. How does one do that efficiently if neither str nor repr return 17 digits? Robert Brewer fuman...@aminus.org ___ 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] web apps in python 3

2009-08-31 Thread Robert Brewer
Chris Withers wrote: > Robert Brewer wrote: >>>> you could switch to Python 3.1, >>> I would love to, once Python 3 has a viable web app story... >> >> CherryPy 3.2 is now in beta, and mod_wsgi is nearly ready as well. Both >> support Python 3. :) >

Re: [Python-Dev] deleting setdefaultencoding iin site.py is evil

2009-08-31 Thread Robert Brewer
the > reload(sys) hack ends up causing problems... > > > Or > > you could switch to Python 3.1, > > I would love to, once Python 3 has a viable web app story... CherryPy 3.2 is now in beta, and mod_wsgi is nearly ready as well. Both support Python 3. :) Robert Brewer fu

Re: [Python-Dev] [Web-SIG] py3k, cgi, email, and form-data

2009-05-12 Thread Robert Brewer
Graham Dumpleton wrote: > 2009/5/12 Robert Brewer : > > There's a major change in functionality in the cgi module between > Python > > 2 and Python 3 which I've just run across: the behavior of > > FieldStorage.read_multi, specifically when an HTTP app accepts a

[Python-Dev] py3k, cgi, and form-data

2009-05-11 Thread Robert Brewer
s designed to accept incremental writes, but I haven't yet found a way to do any kind of incremental reads from it in order to shunt the fp.read out to a tempfile again. I'm secretly hoping Barry has a one-liner fix for this. ;) Robert Brewer fuman...@aminus.org

[Python-Dev] py3k, cgi, email, and form-data

2009-05-11 Thread Robert Brewer
s designed to accept incremental writes, but I haven't yet found a way to do any kind of incremental reads from it in order to shunt the fp.read out to a tempfile again. I'm secretly hoping Barry has a one-liner fix for this. ;) Robert Brewer fuman...@aminus.org

Re: [Python-Dev] RFC: Threading-Aware Profiler for Python

2009-05-04 Thread Robert Brewer
e uses for a profiling module is to compare runs on various platforms. And please, stop perpetuating the myth that only end-users use anything but Linux. Robert Brewer fuman...@aminus.org ___ Python-Dev mailing list Python-Dev@python.org http://m

Re: [Python-Dev] Dropping bytes "support" in json

2009-04-10 Thread Robert Brewer
#x27;, 'Some text'.encode('utf-16')) The only interesting case is if you provided a *default* encoding, so that: Message.default_header_encoding = 'utf-16' Message.set_header('Subject', 'Some text') ...has the same effect. But it woul

Re: [Python-Dev] http://bugs.python.org/issue3628

2009-01-09 Thread Robert Brewer
= True but it didn't seem to help. Fixed in http://www.cherrypy.org/changeset/2096. Robert Brewer fuman...@aminus.org ___ 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] subprocess insufficiently platform-independent?

2008-08-25 Thread Robert Brewer
e checked sys.platform and set shell=True for Windows. Robert Brewer [EMAIL PROTECTED] ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-de

Re: [Python-Dev] A proposed solution for Issue 502236: Asyncrhonousexceptions between threads

2008-07-12 Thread Robert Brewer
gt; > 3. The Python engine has (or can easily obtain) a list of all > > threads it created. > > 4. It is possible to raise exceptions as the byte code is executing. Replace 'Python interpreter' with 'your application' and those become relatively s

Re: [Python-Dev] sock.close() not closing?

2008-05-07 Thread Robert Brewer
ken to doing: self.socket._sock.close() self.socket.close() ...in order to send the FIN I wanted ASAP. Robert Brewer [EMAIL PROTECTED] ___ 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] urllib unicode handling

2008-05-07 Thread Robert Brewer
buted yet. But if someone wanted to do so, it's pretty simple: >>> u'www.\u212bngstr\xf6m.com'.encode("idna") 'www.xn--ngstrm-hua5l.com' Robert Brewer [EMAIL PROTECTED] ___ Python-Dev mailing list Python-

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-03 Thread Robert Brewer
it were named 'expr' instead of 'lambda' we wouldn't be having this discussion. Robert Brewer [EMAIL PROTECTED] ___ 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] PEP 365 (Adding the pkg_resources module)

2008-03-20 Thread Robert Brewer
ise all flexible apps do (but especially CLI apps it seems): frequent users love the power and high volume of options, infrequent users despise it. If you're installing apps all day, you probably use it a lot more often than library devs like me who use it once every other month (if we're fo

Re: [Python-Dev] PEP 365 (Adding the pkg_resources module)

2008-03-20 Thread Robert Brewer
year, I'd say 80%+ are never installed or even built--I just want to grep the source code, and using my preferred tools, not some lame Find command in a ZIP browser menu. Robert Brewer [EMAIL PROTECTED] ___ Python-Dev mailing list Pytho

Re: [Python-Dev] Wow, I think I actually *get* it now!

2008-03-20 Thread Robert Brewer
t and suggesting any topics I miss? I'd be glad to help critique such a doc. Robert Brewer [EMAIL PROTECTED] ___ 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] The Breaking of distutils and PyPI for Python 3000?

2008-03-19 Thread Robert Brewer
se work on 2.x and 3.x means I have to keep all of the details of both Python 2 and 3 in my head all the time as I code? not to mention litter my codebase with "# the following ugly hack lets us work with Python 2 and 3" comments so someone else doesn't undo all my hard work w

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Robert Brewer
Eric Smith wrote: > Robert Brewer wrote: > > Raymond Hettinger wrote: > >> I thought the whole point of 3.0 was a recognition that all that > >> doubling-up was a bad thing and to be rid of it. Why make the > >> situation worse? ISTM that we need two versions

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-22 Thread Robert Brewer
case to be > made that we don't need oct() at all. IIRC, unix permissions like > 0666 were the only use case that surfaced. Postgres bytea coercion is a frequent use case for oct() in my world. But I agree we don't need two versions.

Re: [Python-Dev] Monkeypatching idioms -- elegant or ugly?

2008-01-15 Thread Robert Brewer
e, func) return func return decorator I chose a renaming scheme somewhat at random. The list allows you (or someone else ;) to call monkeypatch repeatedly on the same cls.method (but it's not thread-safe). And although it

Re: [Python-Dev] object capability; func_closure; __subclasses__

2007-06-28 Thread Robert Brewer
n also be removed from the FunctionType constructor arg list? If so, would I be expected to create a function object and then use the "new" module to supply its func_closure? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] ___ Pyt

Re: [Python-Dev] context manager - generator interaction?

2007-04-05 Thread Robert Brewer
n down in developer's heads. Can we get that into the Language Ref somewhere? Maybe on the http://docs.python.org/ref/try.html page? Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] I vote to reject: Adding timeout tosocket.pyand httplib.py.

2007-03-21 Thread Robert Brewer
th __str__ instead of object, but > what would one print in that case? I've found "missing" to be the most common (and the most understandable) thing to print in that case. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] __

Re: [Python-Dev] datetime module enhancements

2007-03-11 Thread Robert Brewer
Jon Ribbens wrote: > > Robert Brewer <[EMAIL PROTECTED]> wrote: > > > One solution that just occurred to me -- and that > > > skirts the issue of choosing an interpretation -- > > > is that, when comparing date and datetime objects, > > >

Re: [Python-Dev] datetime module enhancements

2007-03-10 Thread Robert Brewer
date_obj > > is implicitly equivalent to > > datetime_obj.date() < date_obj > > Seems a ready-made use case for that method. +1 ...and it's a decision that can be made independently of how to add or subtract dates. Robert Brewer System Architect Amor Ministries [EMAIL PR

Re: [Python-Dev] datetime module enhancements

2007-03-09 Thread Robert Brewer
ate: That's at least one too many "must remembers" for dumb (and busy!) ol' me. EIBTI until it's a PITA. Is an implicit time of 0 really so surprising? It doesn't seem to be surprising for the datetime constructor: >>> datetime.datetime(2007, 3, 9) datetime.dat

Re: [Python-Dev] pysqlite for 2.5?

2006-03-29 Thread Robert Brewer
ase; likewise, > choice of specific SQL library might inhibit addition of different > libraries later. More Against?: Explaining "database is locked" errors (due to SQLite's exposed multiple-readers/one-writer design) on a daily basis (FAQ entries notwithstanding). Robert Brewer

Re: [Python-Dev] [Python-3000] Iterators for dict keys, values, and items == annoying :)

2006-03-29 Thread Robert Brewer
nvenient to work with. I'm still wondering what "far less convenient" means. Is it simply the 4 extra key presses? I find the iter* variants to be a great solution. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] ___ Python-D

Re: [Python-Dev] conditional expressions - add parens?

2006-03-07 Thread Robert Brewer
ource projects I contribute to, because I find it *far* easier to read and write 'unnecessary' parens than remember precedence rules. But I can understand why some people would balk at it, so +0.5 from me. ;) Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED]

Re: [Python-Dev] Unifying trace and profile

2006-02-22 Thread Robert Brewer
ebuggers > which poke into the process from the outside, rather > than be supported natively through events).  This isn't > impossible, but it's difficult because of the large > variety of platforms.  I have access to most of the

[Python-Dev] Unifying trace and profile

2006-02-21 Thread Robert Brewer
te struct to boot. 7. As if the above isn't enough of a dream, it would be nice to have a bytecode tracer, which didn't bother with the f_lineno logic in maybe_call_line_trace, but just called the hook on every instruction. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] [1

Re: [Python-Dev] Let's just *keep* lambda

2006-02-08 Thread Robert Brewer
n only if a community consensus > emerges from the thousands of random variants? I'd like to suggest this be moved to comp.lang.python and never return. Community consensus on syntax is a pipe dream. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] _

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-08 Thread Robert Brewer
Barry Warsaw wrote: > On Tue, 2006-02-07 at 16:01 -0800, Robert Brewer wrote: > > > Perhaps, but please keep in mind that the smtpd module uses > > both, currently, and would have to be rewritten if either is > > "removed". > > Would that really be a

Re: [Python-Dev] threadsafe patch for asynchat

2006-02-07 Thread Robert Brewer
-- basically most of > asyncore's guts were replaced with more advanced Zope code, but the > API was maintained for compatibility reasons. A nightmare. Perhaps, but please keep in mind that the smtpd module uses both, currently, and would have to be rewritten if either is "remo

Re: [Python-Dev] any support for a methodcaller HOF?

2006-02-03 Thread Robert Brewer
= expr(x: x + 1) ...where expr() does early binding like dejavu.logic does. [Looking back over my logic module, I'm noticing it requires boolean return values, but it would not be difficult to extend to return abitrary values--even easier if it were rewritten as builtin functionality. Guess I need to

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-28 Thread Robert Brewer
t;if" statements will raise TypeError if start or end are dates? That would be a sad day for Python. Perhaps you're saying that there is a "meaningful comparison" between None and anything else, but please clarify if so. Robert Brewer Sy

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-09 Thread Robert Brewer
n is not an error (like the aforementioned HTTPRedirect). ;) Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail

Re: [Python-Dev] Pythonic concurrency

2005-10-11 Thread Robert Brewer
ey could just stick a reference to it into a threading.local object and instantly have safe, concurrent access to it. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyth

Re: [Python-Dev] Adding a conditional expression in Py3.0

2005-09-30 Thread Robert Brewer
've done everyone a favour. Sometimes no > decision is worse than the wrong decision ;-). Exactly how I felt about bringing the decorator decision to a close. ;) Congratulations to you both! Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] __

Re: [Python-Dev] PEP 8: exception style

2005-08-06 Thread Robert Brewer
like the second form better, because even intermediate Pythonistas sometimes make a mistake between: raise ValueError, A and raise (ValueError, A) I'd like to see the first form removed in Python 3k, to help reduce the ambiguity. But PEP 8 taking a stand on it would be a good

Re: [Python-Dev] Pre-PEP: Exception Reorganization for Python 3.0

2005-07-29 Thread Robert Brewer
oing for it are Dictionary.com (which aggregates lots of questionable sources), Rhymezone, and LookWAYup. I think "raisable" is the clear winner. Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] ___ Python-Dev mailing list Pyt

Re: [Python-Dev] Request for dev permissions

2005-05-17 Thread Robert Brewer
ade a patch for that one the next day, by the way. #1203094 Robert Brewer System Architect Amor Ministries [EMAIL PROTECTED] P.S. Do you have a valid email address, RB? I wasn't able to fix up your nospam address by hand. ___ Python-Dev mailing l

Re: [Python-Dev] PEP 343 - Abstract Block Redux

2005-05-13 Thread Robert Brewer
(*exc)". Assuming that, then "exc = (None, None, None)" makes the most sense. If exc_info() is going to be passed as a single arg, then I'd rather have the default "exc = ()", so I can simply check "if exc:" in the __exit__ method. Robert Brewer System Archi

RE: [Python-Dev] Anonymous blocks: Thunks or iterators?

2005-04-29 Thread Robert Brewer
o recompile the template function every time that it's executed with a different block. Call it a "Python _re_processor" ;). Although you could memoize the the resultant bytecode, etc., it would still be pretty slow, and you wouldn't be able to alter (rebind) the thunk

[Python-Dev] Re: scope-collapse (was: anonymous blocks)

2005-04-26 Thread Robert Brewer
g: else: continue [Guido] > Try to make sure that it can be used in a "statement context" > as well as in an "expression context". ... > I'm trying to sensitize you to potential uses like this: > > def foo(b): >

RE: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-25 Thread Robert Brewer
Shane Hathaway wrote: > Robert Brewer wrote: > > So currently, all subclasses just override __set__, which leads to a > > *lot* of duplication of code. If I could write the base > class' __set__ > > to call "macros" like this: > > > > def

RE: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-25 Thread Robert Brewer
), and is currently fragile when overriding __set__ (due to duplicated code). I'm sure there are other cases with both 1) a relatively invariant series of statements and 2) complicated extensions of that series. Of course, you can do the above with compile() and exec. Maybe I'm just ave

RE: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-25 Thread Robert Brewer
for line in f: print line[:line.find(":")] defmacro cleanup: print "file closed successfully" safe_file(filename, body, cleanup) If macros were to be evaluated at runtime, I'd certainly want to see them be first-class (mea

RE: [Python-Dev] Re: [Csv] csv module TODO list

2005-01-05 Thread Robert Brewer
client had multiple multigig csv's which needed deduplicating, but they were all from different sources and therefore in different formats. It would have cost me many more hours without the Sniffer. Please keep it. <:) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED]

RE: [Python-Dev] Re: 2.4 news reaches interesting places

2004-12-09 Thread Robert Brewer
are what PR is made of. Imagine Bush's next Executive Order being titled "Making American [Business|Military|People] Not Suck"... ;) Robert Brewer MIS Amor Ministries [EMAIL PROTECTED] ___ Python-Dev mailing list [EMAIL PROTECTED] http: