Re: [Python-Dev] PEP 443 - Single-dispatch generic functions

2013-05-24 Thread Sam Partington
On 23 May 2013 22:02, Ronan Lamy wrote: > 2013/5/23 Łukasz Langa >> Last one wins. Just like with assigning names in a scope, defining methods >> in a class or overriding them in a subclass. > > This is a serious annoyance, considering that there are several places where > a large library can rea

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

2012-11-07 Thread Sam Partington
On 7 November 2012 13:57, Ulrich Eckhardt wrote: > Am 31.10.2012 23:15, schrieb Steven D'Aprano: > I'll take a shot, since I was also bitten by this when trying to learn > Python. The important point is that some code earlier or later in that > function does an assignment, so this location should

Re: [Python-Dev] [Python-checkins] cpython (3.2): #14957: clarify splitlines docs.

2012-06-07 Thread Sam Partington
> On Jun 2, 2012 6:21 AM, "r.david.murray" wrote: >> +   For example, ``'ab c\n\nde fg\rkl\r\n'.splitlines()`` returns >> +   ``['ab c', '', 'de fg', 'kl']``, while the same call with >> ``splinelines(True)`` >> +   returns ``['ab c\n', '\n, 'de fg\r', 'kl\r\n']`` Wouldn't that be better written

Re: [Python-Dev] Highlighting reference-stealing APIs [was Re: cpython: Fix email post-commit review comments.]

2012-04-19 Thread Sam Partington
On 19 April 2012 02:20, Nick Coghlan wrote: > On Thu, Apr 19, 2012 at 12:21 AM, Antoine Pitrou wrote: >> (and here we see why reference-stealing APIs are a nuisance: because >> you never know in advance whether a function will steal a reference or >> not, and you have to read the docs for each an

Re: [Python-Dev] Use QueryPerformanceCounter() for time.monotonic() and/or time.highres()?

2012-04-02 Thread Sam Partington
On 30 March 2012 21:52, Guido van Rossum wrote: > Oh dear. I really want to say that 15 ms is good enough. Some possible > exceptions I can think of: > > - Profiling. But this really wants to measure CPU time anyways, and it > already uses a variety of hacks and heuristics to pick the best timer,

Re: [Python-Dev] PEP397 no command line options to python?

2011-10-19 Thread Sam Partington
On 19 October 2011 00:18, Mark Hammond wrote: > On 18/10/2011 8:59 PM, Sam Partington wrote: ... >> I added shebangs to >> all files as appropriate for devel/stable branch, and initially I >> changed the python build targets from "python -utt build.py" to >

Re: [Python-Dev] PEP397 no command line options to python?

2011-10-18 Thread Sam Partington
On 18 October 2011 08:10, Vinay Sajip wrote: >> Is very unexpected. And to do so silently, without warning will cause > > It's only unexpected if you don't read the PEP. From there: > > "The launcher may offer some conveniences for Python developers working > interactively - for example, starting

Re: [Python-Dev] PEP397 no command line options to python?

2011-10-17 Thread Sam Partington
On 17 October 2011 15:20, Vinay Sajip wrote: > Sam Partington gmail.com> writes: > >> That sounds like an explanation of why it hasn't been implemented >> before, not an explanation of why it should continue that way. > > From a desire to keep the launcher as sim

Re: [Python-Dev] PEP397 no command line options to python?

2011-10-17 Thread Sam Partington
On 17 October 2011 17:24, PJ Eby wrote: > What about -S (no site.py) and -E (no environment)? These are needed for > secure setuid scripts on *nix; I don't know how often they'd be used in > practice on Windows. (Basically, they let you isolate a script's effective > sys.path; there may be some

Re: [Python-Dev] PEP397 no command line options to python?

2011-10-17 Thread Sam Partington
On 17 October 2011 13:23, Mark Hammond wrote: > On 17/10/2011 9:10 PM, Sam Partington wrote: >> >>   "Only the first command-line argument will be checked for a shebang line >>    and only if that argument does not start with a '-'." >> >> But

[Python-Dev] PEP397 no command line options to python?

2011-10-17 Thread Sam Partington
Hello all, I was surprised to see that the excellent pylauncher doesn't do the magic shebang processing if you give it any python command line options. e.g. Given #!/usr/bin/env python2.6 import sys print(sys.executable) C:\>py test.py C:\Python26\python.exe C:\>py -utt test.py C:\Python27\pyth