[issue27181] Add geometric mean to `statistics` module

2016-07-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would like to see them spelled-out: geometric_mean and harmonic_mean -- ___ Python tracker ___

Re: Quick poll: gmean or geometric_mean

2016-07-08 Thread Random832
On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote: > hmean and gmean > > harmonic_mean and geometric_mean The latter, definitely. > Remember that the arithmetic mean is just called "mean". so? (also maybe it shouldn't be?) -- https://mail.python.org/mailman/listinfo/python-list

[issue27181] Add geometric mean to `statistics` module

2016-07-08 Thread Steven D'Aprano
Steven D'Aprano added the comment: Does anyone have any strong feeling about the name for these functions? gmean and hmean; geometric_mean and harmonic_mean And "subcontrary_mean" is not an option :-) -- ___ Python tracker

Re: Quick poll: gmean or geometric_mean

2016-07-08 Thread Jussi Piitulainen
Steven D'Aprano writes: > As requested in issue 27181 on the bug tracker, I'm adding functions > to calculate the harmonic and geometric means to the statistics > module. > > I'd like to get a quick show of hands regarding the names. Which do > you prefer? > > hmean and gmean > > harmonic_mean

Quick poll: gmean or geometric_mean

2016-07-08 Thread Steven D'Aprano
As requested in issue 27181 on the bug tracker, I'm adding functions to calculate the harmonic and geometric means to the statistics module. I'd like to get a quick show of hands regarding the names. Which do you prefer? hmean and gmean harmonic_mean and geometric_mean Remember that the

[issue27471] sre_constants.error: bad escape \d

2016-07-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a deprection warning in 3.5. $ python3.5 -Wd >>> import re >>> re.sub(re.escape(r'(\d+?)'), '(?:\d+?)', r'(\d+?)') /usr/lib/python3.5/re.py:182: DeprecationWarning: bad escape \d return _compile(pattern, flags).sub(repl, string, count) '(?:\\d+?)'

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread Connor Wolf
Connor Wolf added the comment: > Python 3.5.1+ (default, Mar 30 2016, 22:46:26) Whatever the stock 3.5 on ubuntu 16.04 x64 is. I've actually been running into a whole horde of really bizarre issues related to what I /think/ is locking in stdout. Basically, I have a context where I have

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread Gregory P. Smith
Gregory P. Smith added the comment: My intent is not to block anything. I'm Just explaining why I'm not motivated to spend much time on this issue myself. Others are welcome to. subprocess is not related to this issue, it has been fixed for use with threads (in 3.2 and higher) with an

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread lesha
lesha added the comment: On a moment's reflection, a lot of my prior comment is wrong. Sorry about that. - glog does not, that I know of, sanitize locks on fork. You just shouldn't log after fork but before exec. - Using `pthread_atfork` to clean up the `logging` lock might be enough to make

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread lesha
lesha added the comment: I work on a multi-million-line C++ codebase that uses fork() from multithreaded programs all over the place. We use `glog` ubiquitously. This bug here that spans 6 years and has affected dozens of people (conservatively) simply does not exist for us. That is because

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread Connor Wolf
Connor Wolf added the comment: Arrrgh, s/threading/multiprocessing/g in my last message. -- ___ Python tracker ___

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread Connor Wolf
Connor Wolf added the comment: > IMNSHO, working on "fixes" for this issue while ignoring the larger > application design flaw elephant in the room doesn't make a lot of sense. I understand the desire for a canonically "correct" fix, but it seems the issue with fixing it "correctly" has lead

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread Gregory P. Smith
Gregory P. Smith added the comment: For me the momentum on fixing these things has stalled because I no longer work on any code that runs into this. There is a fundamental problem: You cannot safely use threading and os.fork() in the same application per POSIX rules. So even if the standard

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Eryk Sun
Eryk Sun added the comment: On second thought, it occurred to me that the problem isn't in Explorer or shell32, but in the drop handler. It turns out the problem is that the drop handler calls the ANSI API DragQueryFileA instead of DragQueryFileW. To see this I attached a debugger to Explorer

[issue6721] Locks in the standard library should be sanitized on fork

2016-07-08 Thread Connor Wolf
Connor Wolf added the comment: Is anything happening with these fixes? This is still an issue (I'm running into it now)? -- nosy: +Connor.Wolf ___ Python tracker

Re: input vs. readline

2016-07-08 Thread eryk sun
On Sat, Jul 9, 2016 at 12:20 AM, Terry Reedy wrote: > The escape key erasing input back to the beginning of the line is Command > Prompt or cmd.exe behavior. cmd.exe is just a shell that uses the console (if the standard handles are console handles). The console window is

Re: input vs. readline

2016-07-08 Thread eryk sun
On Fri, Jul 8, 2016 at 11:17 PM, John Nagle wrote: > If "readline" is imported, "input" gets "readline" capabilities. > It also loses the ability to import control characters. It doesn't > matter where "readline" is imported; an import in some library > module can trigger

Re: input vs. readline

2016-07-08 Thread cs
I was typing in a hurry. There are several unreadable items below. Let me correct myself... On 09Jul2016 09:45, Cameron Simpson wrote: Perhaps the Windows console is treating ESC specially, apparently as "line erase", discarduing any preceeding text. Hence your results.

Re: input vs. readline

2016-07-08 Thread Terry Reedy
On 7/8/2016 7:17 PM, John Nagle wrote: If "readline" is imported, "input" gets "readline" capabilities. It also loses the ability to import control characters. It doesn't matter where "readline" is imported; an import in some library module can trigger this. You can try this with a simple

Re: input vs. readline

2016-07-08 Thread cs
On 08Jul2016 16:17, John Nagle wrote: If "readline" is imported, "input" gets "readline" capabilities. It also loses the ability to import control characters. It doesn't matter where "readline" is imported; an import in some library module can trigger this. You can try

input vs. readline

2016-07-08 Thread John Nagle
If "readline" is imported, "input" gets "readline" capabilities. It also loses the ability to import control characters. It doesn't matter where "readline" is imported; an import in some library module can trigger this. You can try this with a simple test case: print(repr(input())) as a

[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2016-07-08 Thread Eryk Sun
Eryk Sun added the comment: I'm surprised it's not documented for the types module: https://docs.python.org/3.5/library/types.html#types.MethodType At least the docstring has the parameters: >>> print(types.MethodType.__doc__) method(function, instance) Create a bound

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Stefan Krah added the comment: I guess so. Our Rietveld setup apparently has some heuristics that work best when you're on the default branch and completely synced with the main repo. -- ___ Python tracker

[issue27471] sre_constants.error: bad escape \d

2016-07-08 Thread R. David Murray
R. David Murray added the comment: It's just supposed to be a warning at this point, though, so this looks like a bug. -- nosy: +r.david.murray ___ Python tracker

[issue27471] sre_constants.error: bad escape \d

2016-07-08 Thread Matthew Barnett
Matthew Barnett added the comment: There's a move to treat invalid escape sequences as an error (see issue 27364). The previous behaviour was to treat them as literals. The replacement template string contains \d, which is not a valid escape sequence (it's valid for the pattern, but not the

[issue27471] sre_constants.error: bad escape \d

2016-07-08 Thread Noah Petherbridge
New submission from Noah Petherbridge: I found a bug in Python 3.6.0a2 that wasn't present on previous versions of Python concerning the "\d" escape sequence as used in the following regular expression: import re s = "hello" s = re.sub(re.escape(r'(\d+?)'), '(?:\d+?)', s) (The purpose of

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Eryk Sun
Eryk Sun added the comment: Nothing can be done about this from Python. It's a bug in how Explorer handles the dropped filename. Note that it's not simply replacing Unicode characters with question marks. It's using a best-fit ANSI encoding. For example, codepage 1252 maps "Ā" to "A". If

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Xavier de Gaye
Xavier de Gaye added the comment: Thanks Berker and Stefan for your help on 'hg diff --git'. Yes Stefan, maybe your patch has a [review] button because Rietveld found that your patch applied cleanly against the head of the default branch at the time you have submitted it, so it could guess

Re: Clean Singleton Docstrings

2016-07-08 Thread Ethan Furman
On 07/08/2016 09:57 AM, Rob Gaddi wrote: Michael Selik wrote: On Jul 7, 2016, at 7:46 PM, Rob Gaddi wrote: I've got a package that contains a global ensmartened dict that allows all the various parts of my program to share state. The simplest solution

[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2016-07-08 Thread Daniel Holth
Daniel Holth added the comment: This bit me also. Is there other documentation for how many arguments MethodType() should take? -- nosy: +dholth ___ Python tracker

[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-07-08 Thread Oren Milman
Oren Milman added the comment: That's awesome! Thanks :) -- ___ Python tracker ___ ___ Python-bugs-list

[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-07-08 Thread Oren Milman
Oren Milman added the comment: Note that http://bugs.python.org/issue26896 is now closed (the patches proposed in it (with some minor changes) were committed). -- nosy: +Oren Milman ___ Python tracker

[issue27285] Document the deprecation of pyvenv in favor of `python3 -m venv`

2016-07-08 Thread Steve Piercy
Steve Piercy added the comment: Thank you! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26415] Excessive peak memory consumption by the Python parser

2016-07-08 Thread A. Skrobov
A. Skrobov added the comment: Fixing whitespace in the patch, and including an update for the docs -- Added file: http://bugs.python.org/file43664/patch ___ Python tracker

[issue26972] mistakes in docstrings in the import machinery

2016-07-08 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch, Oren! The only real change I made was to make sure the the one-sentence summary at the start of the docstring fit on a single line (when it spans line it can muck up editors and tools). -- resolution: -> fixed stage: patch review

[issue26415] Excessive peak memory consumption by the Python parser

2016-07-08 Thread A. Skrobov
Changes by A. Skrobov : Added file: http://bugs.python.org/file43665/devguide_patch ___ Python tracker ___

[issue26972] mistakes in docstrings in the import machinery

2016-07-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset d32517de5d8c by Brett Cannon in branch 'default': Issue #26972: Fix some mistakes in importlib-related docstrings. https://hg.python.org/cpython/rev/d32517de5d8c -- nosy: +python-dev ___ Python tracker

[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-07-08 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch, Oren! Only change I made was deleting the lines you commented out in the tests. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-07-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset c65f34dafcc1 by Brett Cannon in branch 'default': Issue #26896: Disambiguate uses of "importer" with "finder". https://hg.python.org/cpython/rev/c65f34dafcc1 -- nosy: +python-dev ___ Python tracker

[issue27285] Document the deprecation of pyvenv in favor of `python3 -m venv`

2016-07-08 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch, Steve! I went ahead and got this done now when I realized your patch touched so many files, thus waiting could lead to skew and the need to update the patch needlessly. -- resolution: -> fixed stage: needs patch -> resolved

[issue27285] Document the deprecation of pyvenv in favor of `python3 -m venv`

2016-07-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 414f67e000a7 by Brett Cannon in branch 'default': Issue #27285: Document the deprecation of the pyvenv script. https://hg.python.org/cpython/rev/414f67e000a7 -- nosy: +python-dev ___ Python tracker

Re: Clean Singleton Docstrings

2016-07-08 Thread Rob Gaddi
Michael Selik wrote: > > >> On Jul 7, 2016, at 7:46 PM, Rob Gaddi >> wrote: >> >> I've got a package that contains a global ensmartened dict that allows >> all the various parts of my program to share state. > > The simplest solution would be to use a module

Re: Clean Singleton Docstrings

2016-07-08 Thread Rob Gaddi
Steven D'Aprano wrote: > On Fri, 8 Jul 2016 05:38 pm, Peter Otten wrote: > > [...] >>> Is this a thing that can be fixed with a commensurate amount of effort? >> >> There is a test >> >> if not object: >> raise ImportError('no Python documentation found for %r' % thing) >> >> in the pydoc

[issue27468] Erroneous memory behaviour for objects created in another thread

2016-07-08 Thread Emanuel Barry
Changes by Emanuel Barry : -- resolution: -> not a bug stage: -> resolved ___ Python tracker ___

[issue27468] Erroneous memory behaviour for objects created in another thread

2016-07-08 Thread Adria Garriga
Adria Garriga added the comment: Yes, that seems to be it. Storing info in the Thread object is just for the sake of keeping the example short, but the error is the same you pointed out. Thank you very much and I hope I didn't waste too much of your time! -- status: open -> closed

[issue27468] Erroneous memory behaviour for objects created in another thread

2016-07-08 Thread Peter Otten
Peter Otten added the comment: Your code relies on the assumption that when the lambda is invoked the global t is still bound to the Thread instance you are starting. It seems that this is not always the case, and I don't see why it should be guaranteed either. I don't know whether it's a good

[issue27470] -3 commandline option documented differently via man

2016-07-08 Thread Matthew Gilson
New submission from Matthew Gilson: The man page for python says: > Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix. The official documentation (https://docs.python.org/2/using/cmdline.html#cmdoption-3) does not mention 2to3 at all: > Warn about Python 3.x possible

[issue22624] Bogus usage of floatclock in timemodule

2016-07-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1452520dfe7b by Victor Stinner in branch 'default': Issue #22624: Python 3 requires clock() to build https://hg.python.org/cpython/rev/1452520dfe7b -- nosy: +python-dev ___ Python tracker

[issue17213] ctypes loads wrong version of C runtime, leading to error message box from system

2016-07-08 Thread Keno Fischer
Keno Fischer added the comment: pyzmq has a similar issue. I believe one solution would be to call `_Py_ActivateActCtx` in ctypes' load_library, i.e. do ``` #if HAVE_SXS ULONG_PTR cookie = _Py_ActivateActCtx(); #endif hMod = LoadLibraryW(name); #if HAVE_SXS

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +ebarry ___ Python tracker ___ ___ Python-bugs-list

[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-08 Thread Adam Bartoš
New submission from Adam Bartoš: When a Python script is run by drag-and-dropping another file on it in Windows explorer, the other file's path becomes sys.argv[1]. However, when the path contains a Unicode characters (e.g. α), it gets crippled – it is replaced by ordinary question mark.

[issue22624] Bogus usage of floatclock in timemodule

2016-07-08 Thread STINNER Victor
STINNER Victor added the comment: Sorry but the Wii console is not supported. You have to maintain your fork/patch. Python 3 don't support platforms without clock(). -- resolution: -> wont fix status: open -> closed ___ Python tracker

[issue27468] Erroneous memory behaviour for objects created in another thread

2016-07-08 Thread Adria Garriga
New submission from Adria Garriga: I create several objects in the main thread, and then spawn several threads that "take ownership" of one object each. Within that thread, the objects' attributes' values are not consistent. The bug only happens sometimes. from threading import Thread import

[issue27466] [Copy from github user macartur] time2netscape missing comma

2016-07-08 Thread Robby Daigle
Robby Daigle added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue27468] Erroneous memory behaviour for objects created in another thread

2016-07-08 Thread Adria Garriga
Changes by Adria Garriga : Removed file: http://bugs.python.org/file43663/test.py ___ Python tracker ___

[issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned

2016-07-08 Thread Oren Milman
Oren Milman added the comment: I am sorry, but I can't see why micro-benchmarking is needed here, as my patches only remove code that does nothing, while they don't add any new code. The assembly the compiler generates (on my PC) for 'Py_SIZE(v) = negative ? -ndigits : ndigits;' in

[issue27441] redundant assignments to ob_size of new ints that _PyLong_New returned

2016-07-08 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file43662/patchedCPythonTestOutput_ver2.txt ___ Python tracker ___

Pylint 1.6.0 released

2016-07-08 Thread Claudiu Popa
Hi folks, I am joyful to announce the release of Pylint 1.6.0. This is the next minor release in the 1.X branch and most probably the last one, since we are preparing the taking off of Pylint 2.0. This release has a couple of small improvements, bug fixes and new checks, comparing to the last

[issue27269] ipaddress: Wrong behavior with ::ffff:1.2.3.4 style IPs

2016-07-08 Thread Марк Коренберг
Марк Коренберг added the comment: Also, it should be marked explicitly, if cross-type lookup is safe. I mean code like that: some_net = ipaddress.ip_network(some_input1) some_addr = ipaddress.ip_address(some_input2) return some_addr in some_net Is it safe to write such code? Docs

[issue27269] ipaddress: Wrong behavior with ::ffff:1.2.3.4 style IPs

2016-07-08 Thread Марк Коренберг
Марк Коренберг added the comment: see also issue20446 -- nosy: +mmarkk ___ Python tracker ___ ___

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2016-07-08 Thread Марк Коренберг
Марк Коренберг added the comment: See also issue20446 -- nosy: +mmarkk ___ Python tracker ___ ___

[issue20446] ipaddress: hash similarities for ipv4 and ipv6

2016-07-08 Thread Марк Коренберг
Марк Коренберг added the comment: Sorry. See also issue27269 -- ___ Python tracker ___ ___ Python-bugs-list

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Stefan Krah added the comment: Good point about Misc/NEWS: I just regenerated the patch mindlessly to check the "diff --git" situation :) Actually, Xavier, it's often better to leave out the NEWS section in the bug tracker patches and just add it before pushing. Perhaps Rietveld choked on the

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread STINNER Victor
STINNER Victor added the comment: issue27442-3.patch: be careful, the new item in Misc/NEWS is not at the top of its section. Moreover, I still consider that the unit test is risky and not really needed (just remove it). Good job, there is now a [review] button :-) --

Re: Clean Singleton Docstrings

2016-07-08 Thread Steven D'Aprano
On Fri, 8 Jul 2016 05:38 pm, Peter Otten wrote: [...] >> Is this a thing that can be fixed with a commensurate amount of effort? > > There is a test > > if not object: > raise ImportError('no Python documentation found for %r' % thing) > > in the pydoc module. So all you need is to ensure

Re: Clean Singleton Docstrings

2016-07-08 Thread Rustom Mody
On Friday, July 8, 2016 at 1:15:04 PM UTC+5:30, Peter Otten wrote [slightly edited] > Peter Otten wrote: > > > You might also file a bug report asking to replace > > if not object: ... > > > > with > > > >if object is None: ... > > I take that back; the problem is fixed in Python 3.5. Hoo

[issue27464] Document that SplitResult & friends are namedtuples

2016-07-08 Thread SilentGhost
Changes by SilentGhost : -- assignee: -> docs@python components: +Documentation nosy: +docs@python stage: -> needs patch versions: +Python 3.5, Python 3.6 ___ Python tracker

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Stefan Krah added the comment: I did "hg pull -u" before re-generating the diff. Other than that, sometimes newer mercurial versions behave better (I have 2.8.2). -- ___ Python tracker

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Changes by Stefan Krah : Added file: http://bugs.python.org/file43660/issue27442-3.patch ___ Python tracker ___

Re: Clean Singleton Docstrings

2016-07-08 Thread Peter Otten
Peter Otten wrote: > You might also file a bug report asking to replace I take that back; the problem is fixed in Python 3.5. -- https://mail.python.org/mailman/listinfo/python-list

Re: Clean Singleton Docstrings

2016-07-08 Thread Peter Otten
Rob Gaddi wrote: > I've got a package that contains a global ensmartened dict that allows > all the various parts of my program to share state. Things like device > handles, information about the application environment, etc. that are > inherantly global (i.e. we're not having that debate). > >

[issue27467] distutils.config API different between <=3.5.1 and 3.5.2

2016-07-08 Thread Berker Peksag
Berker Peksag added the comment: I was thinking to document issue 20120 in Misc/NEWS. It turns out I was looking at the wrong commit and it was already documented in eae59b6bf133. -- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed

CyberRoam Python Alternative for network security

2016-07-08 Thread Arshpreet Singh
This is question more about product information and less technical but Hope It will be use-able at some context, I use Cyeberoam(https://www.cyberoam.com/) Is there any Python alternative available for that? or If I have to write/implement something like

[issue27467] distutils.config API different between <=3.5.1 and 3.5.2

2016-07-08 Thread Xiang Zhang
Xiang Zhang added the comment: Berker, what doc needs to be changed? Although RawConfigParser is legacy but that does not mean it's deprecated, right? We can still use it although the doc suggests us use ConfigParser. -- ___ Python tracker

[issue11027] Implement sectionxform in configparser

2016-07-08 Thread Berker Peksag
Berker Peksag added the comment: Issue 26537 is a duplicate of this one but it has an up-to-date and more complete patch so I'm going to close this one. -- nosy: +berker.peksag resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> ConfigParser

[issue27467] distutils.config API different between <=3.5.1 and 3.5.2

2016-07-08 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. Yes, the RawConfigParser change was intentional and it was discussed in issue 20120. I'm marking this as a documentation issue. -- assignee: -> docs@python components: +Documentation nosy: +berker.peksag, docs@python stage: ->

[issue27467] distutils.config API different between <=3.5.1 and 3.5.2

2016-07-08 Thread Xiang Zhang
Xiang Zhang added the comment: I think it's intentional. You can see issue20120. -- nosy: +xiang.zhang ___ Python tracker ___

Re: the best online course

2016-07-08 Thread Rustom Mody
On Thursday, July 7, 2016 at 8:38:15 AM UTC+5:30, Michael Torrie wrote: > On 07/06/2016 06:50 PM, Lawrence D’Oliveiro wrote: > >> I want to be easy and not bored so i can learn python. > > > > There is no Royal Road, nothing is going to be handed to you on a plate. > > Seconded. If he gets