[issue27800] Regular expressions with multiple repeat codes

2016-10-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> martin.panter stage: patch review -> commit review versions: +Python 3.7 ___ Python tracker

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Zachary Ware
On Oct 1, 2016 06:25, "Steve D'Aprano" wrote: > > Long story short: I have no working systems capable of compiling the latest > Python 3.6, and no time to upgrade my usual machines to something which > will work. Since you're working on a pure-Python module

[issue25732] functools.total_ordering does not correctly implement not equal behaviour

2016-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

Re: unintuitive for-loop behavior

2016-10-01 Thread Jussi Piitulainen
I'm not sure any more to what message this should be a followup, but here is a demonstration of two different semantics of the for-loop variable scope/update, this time with nested loops using the same loop variable name. The first function, tabulate, uses Python semantics ("t" for true, if you

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Michael Torrie
On 10/01/2016 05:21 AM, Steve D'Aprano wrote: > Long story short: I have no working systems capable of compiling the > latest Python 3.6, and no time to upgrade my usual machines to > something which will work. > > However I do have access to another machine (actually a VM) which > can compile

Re: generator no iter - how do I call it from another function

2016-10-01 Thread Sayth Renshaw
> Steve > “Cheer up,” they said, “things could be worse.” So I cheered up, and sure > enough, things got worse. Loving life. I first started with a simple with open on a file, which allowed me to use code that "iter"'s. for example: for meet in root.iter("meeting"): for race in

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Grant Edwards
On 2016-10-01, Steve D'Aprano wrote: > Does gcc support static linking? Yes, but the real question is the CPython makefile includes recipes for a statically-linked target. > Even if I end up with a much bigger binary, at least I know it will > have everything it

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Grant Edwards
On 2016-10-01, Steve D'Aprano wrote: > Long story short: I have no working systems capable of compiling the > latest Python 3.6, and no time to upgrade my usual machines to > something which will work. > > However I do have access to another machine (actually a VM)

[issue28330] Use simpler and faster sched.Event definition

2016-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue5830. -- nosy: +rhettinger, serhiy.storchaka ___ Python tracker ___

Re: rocket simulation game with just using tkinter

2016-10-01 Thread Christian Gollwitzer
Am 01.10.16 um 00:59 schrieb Irmen de Jong: Hi, I've made a very simple rocket simulation game, inspired by the recent success of SpaceX You can get the code here if you want to give it a try: https://github.com/irmen/rocketsimulator Nice! I'll have to rebind the keys before I can

announcing fython

2016-10-01 Thread nicolasessisbreton
Hi All, I would like to announce a new project call Fython. In short, Fython is Fortran with a Python syntax. Fython permits to write numerical code with the same syntax then Python. Under the hood, the code is transpiled to Fortran and run at top speed. Fython primary goal is to facilitate

Re: unintuitive for-loop behavior

2016-10-01 Thread Jussi Piitulainen
Rustom Mody writes: > And then define comprehensions not as now done in terms of for loops > that mutatingly extend the list being built up but as recursive > functions that get (re)called for every new value of the comprehension > variable passed and therefore fresh-bound as parameter You'd get

[issue28331] "CPython implementation detail:" is removed when contents is translated

2016-10-01 Thread INADA Naoki
New submission from INADA Naoki: "CPython implementation detail:" label is removed when contents of impl-detail directive is translated. This is very bad for people reading translated documents. Attached patch fixes this, with enabling translating the label, like versionchanged directive.

[issue28330] Use simpler and faster sched.Event definition

2016-10-01 Thread Satoru Logic
New submission from Satoru Logic: By removing the rich comparison dunder methods, the sorting of events will use the faster default implementation. -- components: Library (Lib) files: simple_def.patch keywords: patch messages: 277816 nosy: Satoru Logic priority: normal severity: normal

[issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs

2016-10-01 Thread Mark Dickinson
Mark Dickinson added the comment: New patch, with a (very slightly) cleaner implementation of `_frexp_gen`. -- Added file: http://bugs.python.org/file44908/geometric_mean_int_float_v2.patch ___ Python tracker

[issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs

2016-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Looks good for me. Thanks for catching this: I knew it was a bug, but then I ran into the issue that I could no longer build 3.6 before I could fix it, and between that and various issues in the real world I never got back to this. --

Re: unintuitive for-loop behavior

2016-10-01 Thread Steve D'Aprano
On Sat, 1 Oct 2016 09:33 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: > >> # create a new binding >> x: address 1234 > [ box contains 999 ] >> x: address 5678 > [ a different box, containing 888 ] > > In the context of CPython and nested functions, replace > "box" with "cell".

[issue28329] Add support for customizing scheduler's timefunc and delayfunc using subclassing

2016-10-01 Thread Satoru Logic
Changes by Satoru Logic : -- components: Library (Lib) files: overridable_time_delay.patch keywords: patch nosy: Satoru Logic priority: normal severity: normal status: open title: Add support for customizing scheduler's timefunc and delayfunc using subclassing

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Steve D'Aprano
On Sat, 1 Oct 2016 10:01 pm, Chris Angelico wrote: >> [...] I thought I could >> compile 3.6 on this VM, then copy the python binary to my usual desktop >> machine. >> >> What sort of challenges am I likely to find? Both machines are Linux, but >> different distros. > > First off, are they the

[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-10-01 Thread R. David Murray
R. David Murray added the comment: That would be my answer if we aren't switching to logging. I would consider that an enhancement, but are there reasons to not do that? -- ___ Python tracker

[issue28328] statistics.geometric_mean has no tests. Defer to 3.7?

2016-10-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Unfortunately I'm in a pickle at the moment, I cannot build 3.6 on any of the machines I have available (three), and no time to upgrade them to something that will build 3.6. But I can provide some tests, if somebody is willing to review and check them in to

[issue28328] statistics.geometric_mean has no tests. Defer to 3.7?

2016-10-01 Thread Mark Dickinson
New submission from Mark Dickinson: The newly-added statistics.geometric_mean function appears to have no tests at all, with the exception of a single doctest: >>> geometric_mean([1.10, 0.95, 1.12]) 1.0538483123382172 Steve, Ned: what do you think about taking geometric_mean out of

Re: unintuitive for-loop behavior

2016-10-01 Thread Rustom Mody
On Saturday, October 1, 2016 at 5:02:30 PM UTC+5:30, Steve D'Aprano wrote: > On Sat, 1 Oct 2016 01:44 pm, Rustom Mody wrote: > > > Yes one basic problem with comprehensions in python is that they are > > defined by assignment not binding to the comprehension variable > > ¿Que Mr Fawlty? > > I'm

[issue28258] Broken python-config generated with Estonian locale

2016-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Victor! -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs

2016-10-01 Thread Mark Dickinson
Mark Dickinson added the comment: Here's a fix. I was planning to add tests, but as far as I can tell geometric_mean currently has no tests at all. Steve, is that correct? That seems like something that should be fixed before the 3.6 release. -- keywords: +patch Added file:

[issue28327] statistics.geometric_mean gives incorrect results for mixed int/float inputs

2016-10-01 Thread Mark Dickinson
New submission from Mark Dickinson: The following calculations should all be giving the same result: >>> import statistics >>> statistics.geometric_mean([2, 3, 5, 7]) 3.80675409583932 >>> statistics.geometric_mean([2, 3, 5, 7.0]) 1.6265765616977859 >>> statistics.geometric_mean([2, 3, 5.0,

Re: Copying a compiled Python from one system to another

2016-10-01 Thread Chris Angelico
On Sat, Oct 1, 2016 at 9:21 PM, Steve D'Aprano wrote: > Long story short: I have no working systems capable of compiling the latest > Python 3.6, and no time to upgrade my usual machines to something which > will work. > > However I do have access to another machine

[issue28326] multiprocessing.Process depends on sys.stdout being open

2016-10-01 Thread ProgVal
New submission from ProgVal: Hello, The following code: import sys import multiprocessing sys.stdout.close() def foo(): pass p = multiprocessing.Process(target=foo) p.start() Crashes with: Traceback (most recent call last): File "foo.py", line 10, in p.start() File

Re: unintuitive for-loop behavior

2016-10-01 Thread Gregory Ewing
Steve D'Aprano wrote: # create a new binding x: address 1234 > [ box contains 999 ] x: address 5678 > [ a different box, containing 888 ] In the context of CPython and nested functions, replace "box" with "cell". When I said "creating a new binding" I meant that the name x refers

Re: unintuitive for-loop behavior

2016-10-01 Thread Steve D'Aprano
On Sat, 1 Oct 2016 01:44 pm, Rustom Mody wrote: > Yes one basic problem with comprehensions in python is that they are > defined by assignment not binding to the comprehension variable ¿Que Mr Fawlty? I'm sorry, I don't understand you. In Python, all assignments are name bindings. So you seem

Copying a compiled Python from one system to another

2016-10-01 Thread Steve D'Aprano
Long story short: I have no working systems capable of compiling the latest Python 3.6, and no time to upgrade my usual machines to something which will work. However I do have access to another machine (actually a VM) which can compile Python 3.6. It's not practical for me to use it as a my main

Re: generator no iter - how do I call it from another function

2016-10-01 Thread Steve D'Aprano
On Sat, 1 Oct 2016 06:52 pm, Sayth Renshaw wrote: > Evening > > My file list handler I have created a generator. > > Before I created it as a generator I was able to use iter on my lxml root > objects, now I cannot iter. lxml root objects have an iter method. Other objects do not. Thank you

Re: unintuitive for-loop behavior

2016-10-01 Thread Gregory Ewing
Random832 wrote: > for a in collection: > b = some_calculation_of(a) > final b: do_something_with(lambda: ... b ...) I would prefer something like for a in collection: let b = some_calculation_of(a): do_something_with(lambda: ... b ...) -- Greg --

[issue28259] Ctypes bug windows

2016-10-01 Thread Aristotel
Aristotel added the comment: Oh it's ctypes bug on windows only -- ___ Python tracker ___ ___

[issue28259] Ctypes bug windows

2016-10-01 Thread Aristotel
Changes by Aristotel : -- components: +Windows -ctypes ___ Python tracker ___ ___

[issue9850] obsolete macpath module dangerously broken and should be removed

2016-10-01 Thread Chi Hsuan Yen
Changes by Chi Hsuan Yen : -- nosy: +Chi Hsuan Yen ___ Python tracker ___ ___

Re: generator no iter - how do I call it from another function

2016-10-01 Thread Vlastimil Brom
2016-10-01 12:09 GMT+02:00 Sayth Renshaw : > My main issue is that usually its just x in ,,, for a generator. > > But if I change the code > for meet in roots.iter("meeting"): > > to > for meet in roots("meeting"): > > Well its invalid but I need to be able to reference the

[issue28325] Remove MacOS 9-specific module macurl2path.py

2016-10-01 Thread Chi Hsuan Yen
New submission from Chi Hsuan Yen: As per PEP 11, MacOS 9 support is removed in Python 2.4. There are some leftovers in CPython code base, among which the macurl2path module is an example. I propose to remove it for cleaner codes. In f6785bce54b5 (issue7908), reference to macurl2path was

Re: generator no iter - how do I call it from another function

2016-10-01 Thread Sayth Renshaw
My main issue is that usually its just x in ,,, for a generator. But if I change the code for meet in roots.iter("meeting"): to for meet in roots("meeting"): Well its invalid but I need to be able to reference the node, how do I achieve this? Sayth --

[issue28322] chain.__setstate__ Type Confusion

2016-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is similar issue with itertools.cycle(). And leaking SystemError to user code should be considered as a bug. Proposed patch fixes these issues. -- type: security -> crash Added file: http://bugs.python.org/file44905/itertools_setstate.patch

[issue28324] Clean up MacOS 9-specific description in the docstring of os.py

2016-10-01 Thread Chi Hsuan Yen
New submission from Chi Hsuan Yen: As per PEP 11, MacOS 9 support is removed in Python 2.4. There are some leftovers in CPython code base, among which comments about os.py are examples. I propose to clean them up for cleaner codes. Added Mac experts as well as Guido, the author of these

[issue28323] Remove MacOS 9-specific codes from exit() and quit()

2016-10-01 Thread Chi Hsuan Yen
New submission from Chi Hsuan Yen: As per PEP 11, MacOS 9 support is removed in Python 2.4. There are some leftovers in CPython code base, among which site.setquit is an example. I propose to remove it for cleaner codes. Added Mac experts as well as Guido, the author of this code in the

Re: How to make a foreign function run as fast as possible in Windows?

2016-10-01 Thread jfong
Chris Angelico at 2016/10/1 11:25:03AM wrote: > What's it doing? Not every task can saturate the CPU - sometimes they > need the disk or network more. > This function has no I/O or similar activity, just pure data processing, and it takes less than 200 bytes of data area to work with. My CPU is

Re: unintuitive for-loop behavior

2016-10-01 Thread Chris Angelico
On Sat, Oct 1, 2016 at 6:35 PM, Steve D'Aprano wrote: > On Sat, 1 Oct 2016 02:39 am, Chris Angelico wrote: > >> On Sat, Oct 1, 2016 at 12:36 AM, Grant Edwards >> wrote: > >>> In C99 a for loop has its own namespac: > [...] > >> I believe

Re: rocket simulation game with just using tkinter

2016-10-01 Thread Sayth Renshaw
On Saturday, 1 October 2016 08:59:28 UTC+10, Irmen de Jong wrote: > Hi, > > I've made a very simple rocket simulation game, inspired by the recent > success of SpaceX > where they managed to land the Falcon-9 rocket back on a platform. > > I was curious if you can make a simple graphics

generator no iter - how do I call it from another function

2016-10-01 Thread Sayth Renshaw
Evening My file list handler I have created a generator. Before I created it as a generator I was able to use iter on my lxml root objects, now I cannot iter. ± |master U:2 ?:1 ✗| → python3 race.py data/ -e *.xml Traceback (most recent call last): File "race.py", line 83, in

Re: unintuitive for-loop behavior

2016-10-01 Thread Jussi Piitulainen
Steve D'Aprano writes: > In a language like Python, the only distinction we can make between > name bindings is, which namespace is the binding in? In other words, > what is the current block of code's scope? Python already has nested scopes. A local scope for just those variables introduced in

Re: unintuitive for-loop behavior

2016-10-01 Thread Steve D'Aprano
On Sat, 1 Oct 2016 02:39 am, Chris Angelico wrote: > On Sat, Oct 1, 2016 at 12:36 AM, Grant Edwards > wrote: >> In C99 a for loop has its own namespac: [...] > I believe that's the same semantics as C++ uses, and I agree, it's > very convenient. Among other things,

[issue24274] erroneous comments in dictobject.c

2016-10-01 Thread INADA Naoki
Changes by INADA Naoki : -- assignee: -> inada.naoki stage: needs patch -> patch review ___ Python tracker ___

[issue28201] dict: perturb shift should be done when first conflict

2016-10-01 Thread INADA Naoki
Changes by INADA Naoki : -- stage: -> patch review type: -> performance ___ Python tracker ___

Re: unintuitive for-loop behavior

2016-10-01 Thread Chris Angelico
On Sat, Oct 1, 2016 at 5:06 PM, Steve D'Aprano wrote: > Earlier, I wrote: > >> On Sat, 1 Oct 2016 10:46 am, Gregory Ewing wrote: > [...] >>> Whenever there's binding going on, it's necessary to decide >>> whether it should be creating a new binding or updating an >>>

Re: unintuitive for-loop behavior

2016-10-01 Thread Steve D'Aprano
Earlier, I wrote: > On Sat, 1 Oct 2016 10:46 am, Gregory Ewing wrote: [...] >> Whenever there's binding going on, it's necessary to decide >> whether it should be creating a new binding or updating an >> existing one. > > Right. I changed my mind -- I don't think that's correct. I think Greg's

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-10-01 Thread Martin Panter
Martin Panter added the comment: Hi Michael, I have done some cleanup and modifications to your patch. The result is in aix-library.161001.patch, which has all the changes, i.e. it is not based on another patch. More significant changes I made: * Change getExecLibPath_aix() and find_parts()

[issue28322] chain.__setstate__ Type Confusion

2016-10-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +rhettinger, serhiy.storchaka stage: -> patch review versions: +Python 2.7, Python 3.6, Python 3.7 ___ Python tracker

[issue28321] Plistlib: Half of the double width characters are missing when writing binary plist

2016-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The simplest reproducer: >>> import plistlib >>> plistlib.loads(plistlib.dumps('\U0001f40d', fmt=plistlib.FMT_BINARY)) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/plistlib.py", line 1006, in loads fp, fmt=fmt,

Re: Lawrence D'Oliveiro

2016-10-01 Thread Paul Rubin
Chris Angelico writes: >> Why can't you block "PEDOFILO"? > I've no idea who you're talking about That's the weird Italian spam that the newsgroup has been getting for a while. I've been wondering for a while if anyone knows what the story is, i.e. why it's on comp.lang.python

[issue28322] chain.__setstate__ Type Confusion

2016-10-01 Thread John Leitch
Changes by John Leitch : Added file: http://bugs.python.org/file44900/Py35_itertools.py ___ Python tracker ___

[issue28322] chain.__setstate__ Type Confusion

2016-10-01 Thread John Leitch
New submission from John Leitch: Python 3.5.2 suffers from a type confusion vulnerability in the chain.__setstate__ method of the itertools module. The issue exists due to lack of argument validation in the chain_setstate() function: static PyObject * chain_setstate(chainobject *lz, PyObject

Re: Lawrence D'Oliveiro

2016-10-01 Thread Chris Angelico
On Sat, Oct 1, 2016 at 3:19 PM, Bob Martin wrote: > in 765690 20160930 181552 Ethan Furman wrote: >>Lawrence D'Oliveiro is banned from Python List until the new year. >> >>If his posts show up somewhere else (e.g. Usenet), please ignore them. If >>you

Re: Lawrence D'Oliveiro

2016-10-01 Thread Bob Martin
in 765690 20160930 181552 Ethan Furman wrote: >Lawrence D'Oliveiro is banned from Python List until the new year. > >If his posts show up somewhere else (e.g. Usenet), please ignore them. If you >must respond to him p >lease trim out his text so the rest of us don't have to

Re: how to append to list in list comprehension

2016-10-01 Thread Sayth Renshaw
On Saturday, 1 October 2016 14:17:06 UTC+10, Rustom Mody wrote: > On Saturday, October 1, 2016 at 9:08:09 AM UTC+5:30, Sayth Renshaw wrote: > > I do like [(f + ['0'] if len(f) < 5 else f) for f in fups ] Rustom, if > > there are better non list comprehension options I would like to know as > >

[issue21085] Cygwin does not provide siginfo_t.si_band

2016-10-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5673cf852daa by Zachary Ware in branch 'default': Issue #21085: Fix accidental leading +'s in configure.ac https://hg.python.org/cpython/rev/5673cf852daa -- ___ Python tracker

<    1   2