[Python-Dev] Re: Merging PRs without CLA signed

2020-02-24 Thread Chris Angelico
On Tue, Feb 25, 2020 at 2:25 AM Antoine Pitrou wrote: > > On Mon, 24 Feb 2020 00:30:41 -0500 > Kyle Stanley wrote: > > > In that case I'm not sure the author ought to get credit for the PR. They > > can file a bug pointing out the typo and someone else can submit a fix. > > > > That sounds like a

[Python-Dev] Re: Accepting PEP 584: Add Union Operators To dict

2020-02-27 Thread Chris Angelico
On Thu, Feb 27, 2020 at 7:41 PM Serhiy Storchaka wrote: > sympy/utilities/runtests.py > > Sorry, but the current code > > globs = globs.copy() > if extraglobs is not None: > globs.update(extraglobs) > > looks much clearer to me than the proposed > > globs = globs | (extraglobs if extraglobs i

[Python-Dev] Re: Accepting PEP 584: Add Union Operators To dict

2020-02-27 Thread Chris Angelico
On Thu, Feb 27, 2020 at 8:15 PM Serhiy Storchaka wrote: > > 27.02.20 10:46, Chris Angelico пише: > > On Thu, Feb 27, 2020 at 7:41 PM Serhiy Storchaka > > wrote: > >> sympy/utilities/runtests.py > >> > >> Sorry, but the current code > >> &g

[Python-Dev] Re: new syntax

2020-03-02 Thread Chris Angelico
On Tue, Mar 3, 2020 at 8:06 AM Luca Wolf wrote: > > Dear Python Team, > > I have a good idea for a new comand in Python. > > It’s „intput()“ for numbers. So you don’t have to write „int(Input())“. > > It’s much easier to write and it’s faster too. > > You can use the same for „floatput()“, so don’

[Python-Dev] Re: Proliferation of tstate arguments.

2020-03-17 Thread Chris Angelico
On Wed, Mar 18, 2020 at 3:50 AM Mark Shannon wrote: > The accessibility of a thread-local variable is a strict superset of > that of a function-local variable. > > Therefore storing the thread state in a thread-local variable is at > least as capable as passing thread-state as a parameter. > And

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Chris Angelico
On Sun, Mar 22, 2020 at 5:41 AM Steven D'Aprano wrote: > > On Fri, Mar 20, 2020 at 06:18:20PM -0700, Nathaniel Smith wrote: > > On Fri, Mar 20, 2020 at 11:54 AM Dennis Sweeney > > wrote: > > > This is a proposal to add two new methods, ``cutprefix`` and > > > ``cutsuffix``, to the APIs of Python'

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Chris Angelico
On Sun, Mar 22, 2020 at 1:02 PM Nathaniel Smith wrote: > > On Sat, Mar 21, 2020 at 11:35 AM Steven D'Aprano wrote: > > > > On Fri, Mar 20, 2020 at 06:18:20PM -0700, Nathaniel Smith wrote: > > > On Fri, Mar 20, 2020 at 11:54 AM Dennis Sweeney > > > wrote: > > > > This is a proposal to add two new

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-25 Thread Chris Angelico
On Thu, Mar 26, 2020 at 10:38 AM Ivan Pozdeev via Python-Dev wrote: > > I'm skeptical about anything that hides an object's "true nature": this is a > major landmine in diagnostics because it lies to you about what > you are looking at and where to look for its implementation. > > E. g. in this c

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-25 Thread Chris Angelico
On Thu, Mar 26, 2020 at 12:08 PM Ivan Pozdeev via Python-Dev wrote: > > > On 26.03.2020 2:41, Chris Angelico wrote: > > On Thu, Mar 26, 2020 at 10:38 AM Ivan Pozdeev via Python-Dev > > wrote: > >> I'm skeptical about anything that hides an object's "

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-27 Thread Chris Angelico
On Sat, Mar 28, 2020 at 11:28 AM Ivan Pozdeev via Python-Dev wrote: > > On 26.03.2020 19:24, Ethan Furman wrote: > > Before Enum, the repr for socket.AF_UNIX was: > > > > 1 > > > > Not very useful for debugging. > > On the contrary, it's perfect. I know everything I need: it's an integer > consta

[Python-Dev] Re: Question about bytecode stability

2020-04-05 Thread Chris Angelico
On Mon, Apr 6, 2020 at 1:53 PM Jonathan Goble wrote: > > I'm getting ready to get back into an old personal project with some new > ideas. Before I do, I need to ask a question regarding the stability of > CPython bytecode. Before you say it, I am well aware and fully understand > that the opco

[Python-Dev] Re: PEP 617: New PEG parser for CPython

2020-04-06 Thread Chris Angelico
On Tue, Apr 7, 2020 at 5:03 AM Guido van Rossum wrote: > > On Mon, Apr 6, 2020 at 11:36 AM Steven D'Aprano wrote: >> Personally, I would not like to have to explain to newcomers why `match` >> is a keyword but you can still use it as a function or variable, but not >> other keywords like `raise`,

[Python-Dev] Re: Improvement to SimpleNamespace

2020-04-14 Thread Chris Angelico
On Wed, Apr 15, 2020 at 2:09 PM Raymond Hettinger wrote: > > [GvR] > > We should not try to import JavaScript's object model into Python. > > Yes, I get that. Just want to point-out that working with heavily nested > dictionaries (typical for JSON) is no fun with square brackets and quotation >

[Python-Dev] Re: Further PEP 615 Discussion: Equality and hash of ZoneInfo

2020-04-18 Thread Chris Angelico
On Sun, Apr 19, 2020 at 3:39 AM Paul Ganssle wrote: > > A few weeks ago, I submitted PEP 615 to the steering council for a decision. > There's been a decent amount of discussion there with some very good > questions. I think they are mostly resolved (though I'm happy to have other > people look

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-12 Thread Chris Angelico
On Tue, May 12, 2020 at 5:20 PM Paul Moore wrote: > > On Tue, 12 May 2020 at 07:53, Brandt Bucher wrote: > > > > Another proposed idiom, per-module shadowing of the built-in zip with > > > > some subtly different variant from itertools, is an anti-pattern that > > > > shouldn't be encouraged. >

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-12 Thread Chris Angelico
On Wed, May 13, 2020 at 4:38 AM Ethan Furman wrote: > > > - > > https://github.com/python/cpython/blob/27c0d9b54abaa4112d5a317b8aa78b39ad60a808/Lib/os.py#L510 > > Wow -- I don't even know how to parse that! > Wow, that's quite an example. Of something, I'm not sure what, but definitely an exampl

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-15 Thread Chris Angelico
On Sat, May 16, 2020 at 1:54 AM Antoine Pitrou wrote: > > On Fri, 15 May 2020 10:46:25 -0400 > David Mertz wrote: > > > > > 1. +1 itertools.zip_strict function > > > 2. +1 zip.strict(*args) > > > 3. +1 zip(*args, mode='strict') # mode='shortest' by default > > > 4. +0 zip(*args, strict=True) > >

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-06-02 Thread Chris Angelico
On Tue, Jun 2, 2020 at 8:55 PM Nick Coghlan wrote: > > > > On Tue., 2 Jun. 2020, 11:23 am Steven D'Aprano, wrote: >> >> >> >> > The conceptual idea here is that the "truncate" flag name would technically >> > be a shorter mnemonic for "truncate_silently", so clearing it gives you an >> > exceptio

[Python-Dev] Re: My take on multiple interpreters (Was: Should we be making so many changes in pursuit of PEP 554?)

2020-06-12 Thread Chris Angelico
On Sat, Jun 13, 2020 at 3:50 AM Edwin Zimmerman wrote: > > My previous timings were slightly inaccurate, as they compared spawning > processes on Windows to forking on Linux. Also, I changed my timing code to > run all process synchronously, to avoid hitting resource limits. > > Updated Windows

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread Chris Angelico
On Wed, Jun 24, 2020 at 5:30 AM Rob Cliffe via Python-Dev wrote: > > The PEP is great, but this strikes me as horribly confusing, given that > 401|403|404 is already legal syntax. > IIUC any legal expression can come between `case` and `:`, but expressions > that contain `|` at their outermost l

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread Chris Angelico
On Wed, Jun 24, 2020 at 2:04 AM Guido van Rossum wrote: > def http_error(status): > match status: > case 404: > return "Not found" > case 418: > return "I'm a teapot" > case _: > return "Something else" > > Note the last block: the "v

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread Chris Angelico
On Wed, Jun 24, 2020 at 10:11 AM Guido van Rossum wrote: > > On Tue, Jun 23, 2020 at 4:41 PM MRAB wrote: >> >> On 2020-06-23 22:50, Barry Warsaw wrote: >> > On Jun 23, 2020, at 14:31, Chris Angelico wrote: >> > >> >> I can't find it a

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread Chris Angelico
On Wed, Jun 24, 2020 at 3:21 PM Ethan Furman wrote: > > On 06/23/2020 09:01 AM, PEP 622 wrote: > > > from enum import Enum > > > > class Color(Enum): > > BLACK = 1 > > RED = 2 > > > > BLACK = 1 > > RED = 2 > > > > match color: > > case .BLACK | Color.BLACK: > > print("Black sui

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-06-23 Thread Chris Angelico
On Wed, Jun 24, 2020 at 3:49 PM Ethan Furman wrote: > > On 06/23/2020 10:31 PM, Chris Angelico wrote: > > On Wed, Jun 24, 2020 at 3:21 PM Ethan Furman wrote: > >> On 06/23/2020 09:01 AM, PEP 622 wrote: > >> > >>> from enum import Enum > >

[Python-Dev] Re: PEP 622: Structural Pattern Matching -- followup

2020-06-25 Thread Chris Angelico
On Thu, Jun 25, 2020 at 6:53 PM Antoine Pitrou wrote: > > On Wed, 24 Jun 2020 12:38:52 -0700 > Guido van Rossum wrote: > > Everyone, > > > > If you've commented and you're worried you haven't been heard, please add > > your issue *concisely* to this new thread. Note that the following issues > >

[Python-Dev] Re: The Anti-PEP

2020-06-28 Thread Chris Angelico
On Mon, Jun 29, 2020 at 12:53 AM wrote: > > In my humble opinion, this doesn't warrant the creation of a new structure, > but rather a restructuring of PEPs. > > As mentioned by others, we have a "Rejected Ideas" section already, but that > seems to somewhat miss the point. It captures only the

[Python-Dev] Re: Recent PEP-8 change

2020-07-02 Thread Chris Angelico
On Thu, Jul 2, 2020 at 7:27 PM Antoine Pitrou wrote: > Otherwise why stop at English? I could just as well write my comments > in French if it's all about individual freedom. Requiring English is > not inclusive, it forced people like me to painfully adapt to a > language I wasn't used to. And t

[Python-Dev] Re: Recent PEP-8 change (Antoine Pitrou)

2020-07-02 Thread Chris Angelico
On Fri, Jul 3, 2020 at 4:09 AM David Mertz wrote: >> An issue is that commit messages are uneditable after merge, so something >> written somewhere suggesting consideration of this would be a good idea, >> with authors/mergers bearing this in mind, however unusual a change on this >> basis woul

[Python-Dev] Re: Recent PEP-8 change (Antoine Pitrou)

2020-07-02 Thread Chris Angelico
On Fri, Jul 3, 2020 at 5:17 AM Ivan Pozdeev via Python-Dev wrote: > > > On 02.07.2020 21:20, Chris Angelico wrote: > > On Fri, Jul 3, 2020 at 4:09 AM David Mertz wrote: > >>> An issue is that commit messages are uneditable after merge, so something > &g

[Python-Dev] Re: Recent PEP-8 change (Antoine Pitrou)

2020-07-02 Thread Chris Angelico
On Fri, Jul 3, 2020 at 10:10 AM Łukasz Langa wrote: > Commit messages aren't usually scrutinized to this extent. If you looked at > the last 1000 commits in cpython, you'd find quite a few with messages that > could be seriously improved. We don't though because commits are immutable. > You can

[Python-Dev] Re: Recent PEP-8 change (Antoine Pitrou)

2020-07-03 Thread Chris Angelico
On Fri, Jul 3, 2020 at 11:03 PM Ivan Pozdeev via Python-Dev wrote: > > > On 03.07.2020 15:26, Henk-Jaap Wagenaar wrote: > > On Fri, 3 Jul 2020 at 13:10, Ivan Pozdeev wrote: >> >> So what? > > Unnecessary >> >> They'll have to synchronise their history to ours to be able to make a PR. >> And if t

[Python-Dev] Re: PEP 622 railroaded through?

2020-07-03 Thread Chris Angelico
On Sat, Jul 4, 2020 at 12:48 AM Rob Cliffe via Python-Dev wrote: > > Whoa! > > I have an uneasy feeling about this PEP. > > AFAIK the usual procedure for adding a new feature to Python is: > An idea is raised and attracts some support. > Someone sufficiently motivated writes a PEP. >

[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020-07-04 Thread Chris Angelico
On Sun, Jul 5, 2020 at 12:03 PM Shantanu Jain wrote: > - Finally, I did mention increasing the scope of constant value patterns to > accommodate expressions (as opposed to just dotted names). If we were to do > this, it’s a reason to prefer some syntaxes for constant value patterns over > other

[Python-Dev] Re: PEP 622 railroaded through?

2020-07-07 Thread Chris Angelico
On Wed, Jul 8, 2020 at 10:45 AM Greg Ewing wrote: > > On 8/07/20 12:24 pm, Daniel Moisset wrote: > > Many people in this thread have argued that the double meaning in the > > PEP might be confusing, but Python already has a double meaning in other > > places. > > But assignment targets have always

[Python-Dev] Re: PEP 622: Structural Pattern Matching -- followup

2020-07-08 Thread Chris Angelico
On Wed, Jul 8, 2020 at 6:17 PM Inada Naoki wrote: > > Since this is very new system, can we have some restriction > to allow aggressive optimization than regular Python code? > > # Class Pattern > > Example: > > match val: > case Point(0, y): ... > case Point(x, 0): ... >

[Python-Dev] Re: PEP 622: Structural Pattern Matching -- followup

2020-07-08 Thread Chris Angelico
On Wed, Jul 8, 2020 at 8:56 PM Inada Naoki wrote: > > On Wed, Jul 8, 2020 at 6:14 PM Chris Angelico wrote: > > > > > > These two I would be less averse to, but the trouble is that they make > > the semantics a bit harder to explain. "Dotted names are loo

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-11 Thread Chris Angelico
On Sun, Jul 12, 2020 at 10:30 AM Greg Ewing wrote: > > Just had another thought about marking assignment targets. > > The PEP currently forbids repeating bound names in a pattern > to avoid raising expectations that > > case Point(x, x): > > would match only if the two arguments were equal. >

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-11 Thread Chris Angelico
On Sun, Jul 12, 2020 at 11:04 AM Guido van Rossum wrote: > > On Sat, Jul 11, 2020 at 5:58 PM Chris Angelico wrote: >> >> On Sun, Jul 12, 2020 at 10:30 AM Greg Ewing >> wrote: >> > >> > Just had another thought about marking assignment targets. >

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread Chris Angelico
On Fri, Jul 17, 2020 at 3:25 AM Federico Salerno wrote: > Tools should adapt to the language, not the other way around. If things had > to be done the way they had always been done, without any change, for fear of > people not being used to it, we wouldn't even have Python at all. People > lear

[Python-Dev] Re: Function suggestion: itertools.one()

2020-07-27 Thread Chris Angelico
On Tue, Jul 28, 2020 at 5:24 AM Steven Barker wrote: > > A single-name unpacking assignment can do exactly what you want, albeit with > slightly less helpful exception messages: > > jack, = (p for p in people if p.id == '1234') # note comma after the name > jack > Agreed. As a minor readabi

[Python-Dev] Re: Critique of PEP 622 (Structural Pattern Matching)

2020-08-14 Thread Chris Angelico
On Sat, Aug 15, 2020 at 12:32 AM Mark Shannon wrote: > > Hi all, > > I've written up a critique of PEP 622. > Rather than dump a 2000 line email on you all, I've made a git repo. > > https://github.com/markshannon/pep622-critique > I started reading it. You're saying the same things that everyone

[Python-Dev] Re: Hygenic macros PEP.

2020-09-15 Thread Chris Angelico
On Wed, Sep 16, 2020 at 5:31 AM Chris Angelico wrote: > Users would be encouraged to try it but > NOT to publish code using it. Clarification: by "publish" I mean in production, or as libraries that people will be depending on. It'd be on par with playing around in a fork o

[Python-Dev] Re: Hygenic macros PEP.

2020-09-15 Thread Chris Angelico
On Wed, Sep 16, 2020 at 5:23 AM Mark Shannon wrote: > In general, I would except macros to be used within libraries, so that > those libraries gain the power of their custom macros without making > Python ever larger and more complex. > > However, there is no reason why they cannot be made more wi

[Python-Dev] Re: Enum and the Standard Library

2020-09-19 Thread Chris Angelico
On Sat, Sep 19, 2020 at 11:44 AM Guido van Rossum wrote: > Another brainstorm (or brainfart): maybe repr() should show the module/class > and the name, and str() should only show the name. We'd then get > ``` > >>> # Mock-up! > >>> print(str(re.i)) > IGNORE > >>> print(repr(re.i)) > re.IGNORE > >

[Python-Dev] Re: Changing Python's string search algorithms

2020-10-14 Thread Chris Angelico
On Thu, Oct 15, 2020 at 11:38 AM Tim Peters wrote: > I think this is premature. There is almost never an optimization > that's a pure win in all cases. For example, on some platforms > `timsort` will never be as fast as the old samplesort in cases with a > very large number of equal elements, and

Re: [Python-Dev] requirements for moving __import__ over to importlib?

2012-02-10 Thread Chris Angelico
cur most annoyingly when a single process changes a file, then attempts to import it. If you open a file, write to it, explicitly close it, and then load it, you would expect to read back what you wrote, not the version that was there previously. Chris Angelico

Re: [Python-Dev] cpython (3.2): Issue #14123: Explicitly mention that old style % string formatting has caveats

2012-02-26 Thread Chris Angelico
HP's vsprintf takes an array, not some weird and mythical varargs token), but in their basics they will be similar. The name is worth keeping. Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/p

Re: [Python-Dev] Add a frozendict builtin type

2012-02-29 Thread Chris Angelico
ize and partly drive our code). But features enabling that needn't be core; I wouldn't object to having to get some third-party add-ons to make it all work. Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

Re: [Python-Dev] Playing with a new theme for the docs

2012-03-22 Thread Chris Angelico
On Fri, Mar 23, 2012 at 6:50 AM, Glenn Linderman wrote: > 3. Make the sidebar separately scrollable, so that it stays visible when > scrolling down in the text.  This would make it much easier to jump from > section to section, if the TOC didn't get lost in the process. -1. The downside of separa

Re: [Python-Dev] .{git,bzr}ignore in cpython HG repo

2012-04-02 Thread Chris Angelico
t generates .gitignore and .bzrignore from .hgignore? That ought to solve the problem - take the former two out of the repository, and everyone who wants to use git or bzr can simply generate them on requirement. Chris Angelico ___ Python-Dev mailing list

Re: [Python-Dev] an alternative to embedding policy in PEP 418

2012-04-04 Thread Chris Angelico
hat matters is whether the argument compares-as-true or not. So get_clock(monotonic="yes") would be the same as =True, and =False wouldn't be. And get_clock(monotonic="No, you idiot, I want one that ISN'T") would... be stupid. But it'd still function :) Chris A

Re: [Python-Dev] PEP 418 glossary

2012-04-11 Thread Chris Angelico
On Wed, Apr 11, 2012 at 4:49 PM, Jim Jewett wrote: > Clock: >    An instrument for measuring time.  Different clocks have different > characteristics; for example, a clock with Small typo. Otherwise, excellent reference document - thank you! Well worth gathering all those terms. ChrisA "There'

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-15 Thread Chris Angelico
# do a transaction I agree that it wants a name. If explicitness is the goal, would this be more suitable? db = sqlite3.connect(filename) with db.begin_transaction() as trans: # do a transaction This way, if a database engine supports multiple simultaneous transactions, the same syntax c

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-17 Thread Chris Angelico
On Tue, Apr 17, 2012 at 2:48 PM, Cameron Simpson wrote: > On 16Apr2012 01:25, Victor Stinner wrote: > | I suppose that most people don't care that "resolution" and > | "precision" are different things. > > If we're using the same definitions we discussed offline, where > >  - resolution is the un

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Chris Angelico
On Thu, Apr 19, 2012 at 12:47 AM, Guido van Rossum wrote: > I don't believe PEP 8 requires whitespace around all binary operators. > Where do you read that? Quoting from http://www.python.org/dev/peps/pep-0008/#other-recommendations (with elision): Use spaces around arithmetic operators: No:

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Chris Angelico
gt; uncomfortable with. Tiny nitpick: I'd just replace the comma following > "however" with a period or semicolon. Following or preceding? Either works, but there's a slight shift of meaning depending on which punctuation gets the upgrade. What was the original intent of t

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-19 Thread Chris Angelico
On Fri, Apr 20, 2012 at 1:00 AM, Éric Araujo wrote: > Hi, > >> +- If operators with different priorities are used, consider adding >> +  whitespace around the operators with the lowest priority(ies). This >> +  is very much to taste; however, never use more than one space, and >> +  always have th

Re: [Python-Dev] netiquette on py-dev

2012-04-24 Thread Chris Angelico
On Wed, Apr 25, 2012 at 1:44 PM, Stephen J. Turnbull wrote: > I don't know of any webmail implementations that provide > reply-to-list, so a lot of us end up using reply-to-all.  Cleaning up > the headers requires at least deleting the To (which is where the > author ends up), and perhaps moving t

Re: [Python-Dev] Another buildslave - Ubuntu again

2012-05-01 Thread Chris Angelico
On Wed, May 2, 2012 at 1:09 PM, Senthil Kumaran wrote: > Also, I think the instructions in the wiki could be improved. I was > not able to su - buildbot after installing through package manager. I > shall edit it once I have set it up and running. The page does say: """... create a new user "buil

Re: [Python-Dev] CRLF line endings

2012-05-03 Thread Chris Angelico
run into one, I open it in Wordpad (or, if I have one, a dedicated programming editor like SciTE or the Open Watcom editor). AFAIK only Notepad (of standard Windows utilities) has trouble. Not sure if that makes a difference or not. Chris Angelico __

Re: [Python-Dev] CRLF line endings

2012-05-03 Thread Chris Angelico
On Fri, May 4, 2012 at 1:28 AM, Vinay Sajip wrote: > It's only really an issue for new / inexperienced users, I agree. Since these > files are installed only on Windows systems, there's no reason for them not to > have the native line endings. Then sure, doesn't make a lot of difference that it's

Re: [Python-Dev] Debian wheezy, amd64: make not finding files for bz2 and other packages

2012-05-04 Thread Chris Angelico
On Sat, May 5, 2012 at 4:07 AM, Edward C. Jones wrote: > /usr/include/bzlib.h > /usr/lib/x86_64-linux-gnu/libbz2.a > /usr/lib/x86_64-linux-gnu/libbz2.so > /lib/x86_64-linux-gnu/libbz2.so.1 > /lib/x86_64-linux-gnu/libbz2.so.1.0 > /lib/x86_64-linux-gnu/libbz2.so.1.0.4 I have an Ubuntu Maverick 64-b

Re: [Python-Dev] PEP 405 (pyvenv) and system Python upgrades

2012-05-05 Thread Chris Angelico
On Sat, May 5, 2012 at 6:49 AM, Carl Meyer wrote: > 2) In addition to the above, introduce a versioning marker in the standard > library (is there one already?) and have some code somewhere (insert > hand-waving here) check sys.version_info against the stdlib version, and > fail fast with an unamb

Re: [Python-Dev] docs.python.org pointing to Python 3 by default?

2012-05-19 Thread Chris Angelico
On Sun, May 20, 2012 at 4:43 AM, Glyph wrote: > Right now, e.g. directly renders > a page.  I suggest that this be changed to a redirect to > .  The fact that > people can bookmark the "default"

Re: [Python-Dev] Restricted API versioning

2012-06-23 Thread Chris Angelico
On Sun, Jun 24, 2012 at 9:40 AM, Christian Heimes wrote: > +1 for the general idea and for using Py_LIMITED_API. I still like my > idea of a simple macro based on Include/patchlevel.h, for example: > > #define Py_API_VERSION(major, minor, micro) \ >   (((major) << 24) | ((minor) << 16) | ((micro)

Re: [Python-Dev] Restricted API versioning

2012-06-24 Thread Chris Angelico
On Sun, Jun 24, 2012 at 5:08 PM, Nick Coghlan wrote: > On Sun, Jun 24, 2012 at 5:00 PM, "Martin v. Löwis" wrote: >>> This strikes me as in opposition to the Python-level policy of duck >>> typing. Would it be more appropriate to, instead of asking if it's >>> Python 3.3.0, ask if it's a Python th

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-15 Thread Chris Angelico
On Mon, Jul 16, 2012 at 1:55 AM, Steven D'Aprano wrote: > (I expect the difference in behaviour is due to the default ulimit under > Debian/Mint and RedHat/Fedora systems.) Possibly also virtual memory settings. Allocating gobs of memory with a huge page file slows everything down without raising

Re: [Python-Dev] Question

2012-08-03 Thread Chris Angelico
hon.org instead. But I would say that yes, it IS worth moving from Java to Python. If nothing else, learning more languages is always advantageous! Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] AST optimizer implemented in Python

2012-08-11 Thread Chris Angelico
On Sun, Aug 12, 2012 at 4:30 AM, Victor Stinner wrote: > I started to implement an AST optimizer in Python. It's easy to create > a new AST tree, so I'm surprised that I didn't find any existing > project. Very nice idea! > Other idea to improve this optimizer: > - move invariant out of loops.

Re: [Python-Dev] AST optimizer implemented in Python

2012-08-11 Thread Chris Angelico
On Sun, Aug 12, 2012 at 11:17 AM, Victor Stinner wrote: > The idea would be to allow the developer to specify explicitly what he > wants to optimize. I'm using a configuration class with a list of what > can be optimized (ex: len(int)), but it can be changed to something > different later. > > It

Re: [Python-Dev] Should urlencode() sort the query parameters (if they come from a dict)?

2012-08-17 Thread Chris Angelico
ity on the unit test above the functionality of actual usage. Although on the other hand, sorting parameters on a URL is nothing compared to the cost of network traffic, so it's unlikely to be significant. Chris Angelico ___ Python-Dev mailing list Python-De

[Python-Dev] Copyediting PEPs

2012-08-28 Thread Chris Angelico
What's the procedure for making trivial edits to a PEP? I was (re)reading PEP 393 and found a couple of typos (PyCompactObject s/be PyCompactUnicodeObject and "differs form length" s/be "from"). Can I edit them directly in the web site's SVN repo, or should a patch be submitted? Apologies for the

Re: [Python-Dev] Copyediting PEPs

2012-08-28 Thread Chris Angelico
On Wed, Aug 29, 2012 at 2:36 PM, Nick Coghlan wrote: > Sending a patch to the PEP editors (p...@python.org) or posting it to > the tracker is likely the best option. However, in the general case, > we don't worry too much about minor errors in accepted and final PEPs > - once the PEP is implemente

Re: [Python-Dev] Copyediting PEPs

2012-08-29 Thread Chris Angelico
On Wed, Aug 29, 2012 at 2:45 PM, Guido van Rossum wrote: > Hm. I would be fine with the edits proposed, no need to bother others. But > please do use the Hg repo. :-) What? It's in Hg and I've been using Subversion all this time? Oh, you had my hopes up for a while there. Alas, the problem is th

Re: [Python-Dev] [RELEASED] Python 3.3.0 release candidate 3

2012-09-29 Thread Chris Angelico
On Sun, Sep 30, 2012 at 4:26 AM, Brett Cannon wrote: > Does this mean we want to re-open the discussion about decimal constants? > Last time this came up I think we decided that we wanted to wait for > cdecimal (which is obviously here) and work out how to handle contexts, the > syntax, etc. Just

Re: [Python-Dev] Stdlib and timezones, again

2012-09-30 Thread Chris Angelico
On Sun, Sep 30, 2012 at 11:15 PM, Antoine Pitrou wrote: > On Sun, 30 Sep 2012 15:10:06 +0200 > Dirkjan Ochtman wrote: >> On Sun, Sep 30, 2012 at 3:03 PM, Antoine Pitrou wrote: >> > Can't we simply include the Olson database in Windows installers? >> >> We probably can, but the problem is that it

Re: [Python-Dev] Stdlib and timezones, again

2012-09-30 Thread Chris Angelico
On Mon, Oct 1, 2012 at 8:17 AM, Matthias Klose wrote: > On 30.09.2012 20:18, Gregory P. Smith wrote: >> priority: >> 1) api call supplying tz data to the process. >> 2) pytzdata module if it exists >> 3) tz data from the underlying operating system >> 4) error. > > I disagree on this order

Re: [Python-Dev] Python Bug Day in October

2012-10-02 Thread Chris Angelico
On Wed, Oct 3, 2012 at 4:47 AM, Éric Araujo wrote: > Hello, > > We confirm October 27! User groups and devs on IRC, join us if you can. > I’ll send an announcement to the mentoring list to let subscribers know > about the event. Apologies if this is a stupid question (or just completely misdire

Re: [Python-Dev] Python Bug Day in October

2012-10-02 Thread Chris Angelico
On Wed, Oct 3, 2012 at 8:19 AM, Éric Araujo wrote: > Hi Chris, > > Le 02/10/2012 18:14, Chris Angelico a écrit : >> Apologies if this is a stupid question (or just completely >> misdirected), but does this mean that if I'm interested in >> participating in the bug

Re: [Python-Dev] Split unicodeobject.c into subfiles?

2012-10-07 Thread Chris Angelico
On Mon, Oct 8, 2012 at 8:17 AM, Victor Stinner wrote: > Another problem with huge files is to handle "dependencies" with > static functions. If the function A calls the function B which calls > the function C, you have to order A, B and C "correctly" if these > functions are private and not declar

Re: [Python-Dev] [BUG] Trailing spaces in pretty-printed JSON

2012-10-13 Thread Chris Angelico
On Sat, Oct 13, 2012 at 5:40 PM, Leo wrote: > Use this script on a json file and observe all the trailing spaces > generated. (screenshot attached.) Confirmed as still the case in Python 3 (specifically, with an early alpha of 3.3 and with 3.2 for Windows). It's because the item separator is '; '

Re: [Python-Dev] return type of __complex__

2012-10-20 Thread Chris Angelico
On Sun, Oct 21, 2012 at 12:53 PM, Steven D'Aprano wrote: > Python 2.x legitimately distinguished between floats and complex, e.g.: > > py> (-100.0)**0.5 > > Traceback (most recent call last): > File "", line 1, in > ValueError: negative number cannot be raised to a fractional power > > If you w

Re: [Python-Dev] return type of __complex__

2012-10-20 Thread Chris Angelico
On Sun, Oct 21, 2012 at 1:38 PM, Chris Angelico wrote: > Python 2 (future directives aside) also required you to explicitly ask > for floating point. That was also changed in Python 3. Er, should have said that I was referring to division here... incomplete information. Anyway. Py3 says th

Re: [Python-Dev] return type of __complex__

2012-10-20 Thread Chris Angelico
On Sun, Oct 21, 2012 at 5:11 PM, Greg Ewing wrote: > Devin Jeanpierre wrote: >> >> (Complex >> numbers get a free pass because "complex numbers with rational real >> and imaginary parts" is not a memorable name for a type.) > > Complexional? "Oh is there not one maiden here Whose homely face and

Re: [Python-Dev] return type of __complex__

2012-10-21 Thread Chris Angelico
On Sun, Oct 21, 2012 at 10:08 PM, Antoine Pitrou wrote: > On Sun, 21 Oct 2012 22:02:17 +1100 > Steven D'Aprano wrote: >> >> In Python 3.3, math.pow is the builtin pow. Presumably for backwards >> compatibility reasons when they were different? If so, it was a LONG >> time ago: >> >> [steve@ando ~

Re: [Python-Dev] return type of __complex__

2012-10-21 Thread Chris Angelico
On Mon, Oct 22, 2012 at 11:10 AM, Greg Ewing wrote: > Steven D'Aprano wrote: > >> When you're dealing with numbers that represent real quantities, getting >> a complex result is nearly always an error condition. Better to get an >> exception at the point that occurs, than somewhere distant when th

Re: [Python-Dev] Improve error message "UnboundLocalError: local variable referenced before assignment"

2012-10-31 Thread Chris Angelico
On Thu, Nov 1, 2012 at 12:20 PM, Terry Reedy wrote: > The current wording is an exact, concise, description of the problem. Rather > than tinkering with the wording, I think a more general solution might be a > new HOWTO: Understanding exception messages. It could have alphabetically > sorted entr

Re: [Python-Dev] chained assignment weirdity

2012-11-07 Thread Chris Angelico
On Thu, Nov 8, 2012 at 1:11 AM, Nick Coghlan wrote: > "The implementation is right, the docs are wrong" sounds good to me, > as it's easy to justify the out of order evaluation in terms of the > equivalent item assignment statements: What do other Pythons than CPython do currently? Or is it "The

Re: [Python-Dev] chained assignment weirdity

2012-11-07 Thread Chris Angelico
On Thu, Nov 8, 2012 at 1:54 AM, Guido van Rossum wrote: > On Wed, Nov 7, 2012 at 4:13 AM, Ned Batchelder wrote: >> We've gone out of our way to >> maintain backward compatibility with the implemented behavior before >> (ordering of dict keys, for example). > > Not sure what you're referencing her

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Chris Angelico
On Wed, Nov 14, 2012 at 8:12 PM, Chris Withers wrote: > I suspect I'm not the only one who finds: > > a_dict = dict( > x = 1, > y = 2, > z = 3, > ... > ) > > ...easier to read than: > > a_dict = { > 'x':1, > 'y':2, > 'z':3, > ... > } > > What can we do to sp

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 10:36 AM, Steven D'Aprano wrote: > On 15/11/12 05:54, Mark Adam wrote: > >> Merging of two dicts is done with dict.update. How do you do it on >> initialization? This doesn't make sense. > > > Frequently. > > my_prefs = dict(default_prefs, setting=True, another_setting=F

Re: [Python-Dev] performance of {} versus dict()

2012-11-14 Thread Chris Angelico
On Thu, Nov 15, 2012 at 1:28 PM, Stephen J. Turnbull wrote: > Chris Angelico writes: > > > >>> {"a":1}+{"b":2} > > > It would make sense for this to result in {"a":1,"b":2}. > > The test is not "does this sometim

Re: [Python-Dev] Split unicodeobject.c into subfiles?

2012-11-17 Thread Chris Angelico
On Sun, Nov 18, 2012 at 5:47 AM, Chris Jerdonek wrote: > On Thu, Oct 4, 2012 at 2:46 PM, wrote: >> I really fail to see what problem people have with large source files. >> What is it that you want to do that can be done easier if it's multiple >> files? > > One thing is browse or link to such c

Re: [Python-Dev] Proposing "Argument Clinic", a new way of specifying arguments to builtins for CPython

2012-12-04 Thread Chris Angelico
On Tue, Dec 4, 2012 at 9:29 AM, Larry Hastings wrote: > To save you a little time, here's a preview of using Clinic for > dbm.open(). The stuff at the same indent as a declaration are > options; see the "clinic.txt" in the repo above for full documentation. > > /*[clinic] >... hand-written cont

Re: [Python-Dev] Proposing "Argument Clinic", a new way of specifying arguments to builtins for CPython

2012-12-04 Thread Chris Angelico
On Wed, Dec 5, 2012 at 9:17 AM, Larry Hastings wrote: > Here's my blue-sky probably-overengineered proposal: we (and when I say "we" > I mean "I") write a cross-platform C program that could be harmlessly but > usefully integrated into the build process. First, we add a checksum for > the *input*

Re: [Python-Dev] Conflicts [was Re: Keyword meanings [was: Accept just PEP-0426]]

2012-12-08 Thread Chris Angelico
On Sun, Dec 9, 2012 at 12:15 PM, Steven D'Aprano wrote: > Assuming that two software packages Spam and Ham install into directories > Spam and Ham, how can merely having them installed side-by-side lead to a > conflict? > > I can see how running or importing Spam and Ham together might lead to > p

Re: [Python-Dev] Conflicts [was Re: Keyword meanings [was: Accept just PEP-0426]]

2012-12-08 Thread Chris Angelico
On Sun, Dec 9, 2012 at 1:11 PM, Steven D'Aprano wrote: > On 09/12/12 12:32, Chris Angelico wrote: >> >> On Sun, Dec 9, 2012 at 12:15 PM, Steven D'Aprano >> wrote: >>> >>> Assuming that two software packages Spam and Ham install into directo

[Python-Dev] Downloads page: Which version of Python should be listed first?

2012-12-13 Thread Chris Angelico
The default version shown on http://docs.python.org/ is now 3.3.0, which I think is a Good Thing. However, http://python.org/download/ puts 2.7 first, and says: """If you don't know which version to use, start with Python 2.7; more existing third party software is compatible with Python 2 than Pyt

Re: [Python-Dev] Downloads page: Which version of Python should be listed first?

2012-12-14 Thread Chris Angelico
On Sat, Dec 15, 2012 at 12:31 PM, Devin Jeanpierre wrote: > On Thu, Dec 13, 2012 at 9:38 PM, Eric Snow > wrote: >>> """If you don't know which version to use, start with Python 2.7; more >>> existing third party software is compatible with Python 2 than Python >>> 3 right now.""" >>> >>> Firstly

Re: [Python-Dev] why do we allow this syntax?

2013-02-08 Thread Chris Angelico
On Sat, Feb 9, 2013 at 2:39 AM, Chris Withers wrote: > Hi All, > > Just had a bit of an embarrassing incident in some code where I did: > > sometotal =+ somevalue > > I'm curious why this syntax is allowed? I'm sure there are good reasons, but > thought I'd ask... For the same reason that you can

<    5   6   7   8   9   10   11   >