[issue38490] statistics: add covariance and Pearson's correlation

2019-10-17 Thread Tim Peters


Tim Peters  added the comment:

I'm in favor of adding all of this (covariance, coefficient, linear 
regression).  It's still at the level of elementary statistics, and even taught 
in watered down "business statistics" classes.  It's about the minimum that can 
be done beyond single-variable stats.

But I also think this defines the limit of what the core "should" include in 
this area.

--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2019-10-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

See:

commit fd97d1f1af910a6222ea12aec42c456b64f9aee4
Author: David Cuthbert 
Date:   Fri Sep 21 18:31:15 2018

bpo-32117: Allow tuple unpacking in return and yield statements (gh-4509)

Iterable unpacking is now allowed without parentheses in yield and return
statements, e.g. ``yield 1, 2, 3, *rest``. Thanks to David Cuthbert for the
change and jChapman for added tests.

--
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2019-10-17 Thread Guido van Rossum


Guido van Rossum  added the comment:

Why is this still open? That feature appears already implemented.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33604] HMAC default to MD5 marked as to be removed in 3.6

2019-10-17 Thread miss-islington


miss-islington  added the comment:


New changeset c615db608dbb36a5d10188f7d265dcec7bfcc3cf by Miss Islington (bot) 
in branch '3.8':
bpo-33604: Raise TypeError on missing hmac arg. (GH-16805)
https://github.com/python/cpython/commit/c615db608dbb36a5d10188f7d265dcec7bfcc3cf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33604] HMAC default to MD5 marked as to be removed in 3.6

2019-10-17 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset f33c57d5c780da1500619f548585792bb5b750ee by Gregory P. Smith in 
branch 'master':
bpo-33604: Raise TypeError on missing hmac arg. (GH-16805)
https://github.com/python/cpython/commit/f33c57d5c780da1500619f548585792bb5b750ee


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33604] HMAC default to MD5 marked as to be removed in 3.6

2019-10-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16380
pull_request: https://github.com/python/cpython/pull/16833

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2019-10-17 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34977] Release Windows Store app containing Python

2019-10-17 Thread Alexey Izbyshev


Change by Alexey Izbyshev :


--
pull_requests: +16379
pull_request: https://github.com/python/cpython/pull/5812

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-10-17 Thread PyScripter


PyScripter  added the comment:

To Steve:

I want the embedded venv to have the same sys.path as if you were running the 
venv python interpreter.  So my method takes into account for instance the 
include-system-site-packages option in pyvenv.cfg.  Also my method sets 
sys.prefix in the same way as the venv python interpreter.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-10-17 Thread Steve Dower


Steve Dower  added the comment:

If you just want to be able to import modules from the venv, and you know the 
path to it, it's simpler to just do:

import sys
sys.path.append(r"path to venv\Lib\site-packages")

Updating sys.executable is only necessary if you're going to use libraries that 
try to re-launch itself, but any embedding application is going to have to do 
that anyway.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22213] Make pyvenv style virtual environments easier to configure when embedding Python

2019-10-17 Thread PyScripter


PyScripter  added the comment:

Just in case this will be of help to anyone, I found a way to use venvs in 
embedded python.

- You first need to Initialize python that is referred as home in pyvenv.cfg.
- Then you execute the following script:

import sys
sys.executable = r"Path to the python executable inside the venv"
path = sys.path
for i in range(len(path)-1, -1, -1):
if path[i].find("site-packages") > 0:
path.pop(i)
import site
site.main()
del sys, path, i, site

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37195] test_utime fails on MacOS Mojave (Kernel Version 18.6.0:)

2019-10-17 Thread Ned Deily


Ned Deily  added the comment:

@pablogsal, Is this still an issue for you?  AFAIK, there have been no other 
reports of this behavior.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38510] build python with --enable-shared with static linked python against libpython*.a

2019-10-17 Thread Chiu Speq


New submission from Chiu Speq :

Build python with --enable-shared will create python binary linked against the 
shared library. You have LD_LIBRARY_PATH before using python binary if it is 
installed non-system wide. (ex. using gnu modules load).
Changing BLDLIBRARY in configuration could make program work as usual (without 
setting LD_LIBRARY_PATH) and generating shared-object as well.

--
components: Build
files: configure.patch
keywords: patch
messages: 354854
nosy: Chiu Speq
priority: normal
severity: normal
status: open
title: build python with --enable-shared with static linked python against 
libpython*.a
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48666/configure.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38504] Reduce the size of deb package

2019-10-17 Thread Ned Deily


Ned Deily  added the comment:

You might also want to try on StackOverflow or on an Ubuntu or Debian forum. We 
don't produce deb packages ourselves.

--
nosy: +ned.deily
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37839] makesetup Doesn't Handle Defines with Equal Sign

2019-10-17 Thread John Muth


John Muth  added the comment:

I ran into the same issue. This patch fixed it for me.

diff --git a/Modules/makesetup b/Modules/makesetup
index eac97ad134..0fbac03833 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -133,6 +133,7 @@ sed -e 's/[ ]*#.*//' -e '/^[]*$/d' |
 
# Output DEFS in reverse order so first definition overrides
case $line in
+   *-D*) ;;
*=*)DEFS="$line$NL$DEFS"; continue;;
'include '*)DEFS="$line$NL$DEFS"; continue;;
'*noobjects*')

--
nosy: +John Muth

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38509] Insufficient description of relative imports in docs.python.org

2019-10-17 Thread Aniruddha Bhattacharjee


New submission from Aniruddha Bhattacharjee :

In the section "relative imports" of the documentation for "import system", the 
use of relative imports is explained with the use of an example, however if you 
try the exact same thing it gives an error. This is nicely explained in 
https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time
 and https://www.python.org/dev/peps/pep-0395/. This has also been added as an 
open issue in the documentation . Is this still under consideration, then I 
would be happy to update the docs. Thanks

--
assignee: docs@python
components: Documentation
messages: 354851
nosy: Aniruddha Bhattacharjee, docs@python
priority: normal
severity: normal
status: open
title: Insufficient description of relative imports in docs.python.org
type: behavior
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38508] Tracing events anomaly when creating a multi-line list

2019-10-17 Thread Fabio Zadrozny


Fabio Zadrozny  added the comment:

If it's a feature and not a bug, seems ok to me (I reported mainly because I 
thought the behavior was odd, but I guess it makes sense).

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38507] Improve the documentation of the nested list initialization

2019-10-17 Thread JUN-WEI SONG


JUN-WEI SONG  added the comment:

sorry that I did not notice it already documented

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38507] Improve the documentation of the nested list initialization

2019-10-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is already documented. See note 2 at 
https://docs.python.org/3/library/stdtypes.html#common-sequence-operations.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38508] Tracing events anomaly when creating a multi-line list

2019-10-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Considering the code as:

x = {
1,
2
}

It first gets constant 1.
Then gets constant 2.
Then build a set.
Then assign it to the variable.

Obviously that the variable is assigned at line 1, so you would get a backward 
line in any case. The set display is multiline, it occupies lines 1 to 4. What 
line should be reported? In many cases it is more convenient to take a first 
line of the multiline expression. If the building a set failed (for example if 
items are not hashable) you will a line "x = {" in the traceback instead of 
just "}".

This is not a bug, but a feature. In future perhaps tracing and traceback will 
get a range instead of a single line for multiline expressions, but it requires 
significant changes in the code.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2019-10-17 Thread Steve Dower


Steve Dower  added the comment:

You're right that this will need fixing. But we don't really have to fix it any 
earlier than 3.10 - the launcher is backwards-compatible but not necessarily 
forwards-compatible. Still, we can take a fix whenever.

Probably it should just change to using CompareStringEx with (at least) the 
SORT_DIGITSASNUMBERS flag.

https://docs.microsoft.com/windows/win32/api/stringapiset/nf-stringapiset-comparestringex

--
stage:  -> test needed
versions:  -Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38508] Tracing events anomaly when creating a multi-line list

2019-10-17 Thread Fabio Zadrozny


New submission from Fabio Zadrozny :

When creating a multi-line list it seems that there's an additional line event 
that goes back to the start of the list.

i.e.: considering the code as:

[
1,
2
]

when stepping through the list, a debugger would get a line event at the `1` 
then at `2` and then at `['.

I'm attaching a sample code which prints the traced lines, where it's possible 
to see that there's a line event that goes backward to the list creation there 
(note that on Python 3.7 there's no line event for the list creation).

--
components: Interpreter Core
files: snippet33.py
messages: 354845
nosy: fabioz
priority: normal
severity: normal
status: open
title: Tracing events anomaly when creating a multi-line list
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48665/snippet33.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38507] Improve the documentation of the nested list initialization

2019-10-17 Thread JUN-WEI SONG


New submission from JUN-WEI SONG :

When I used the nested list, I need to initialize the nested list, so I used 
this expression:

>>> nested_list = [[]] * 5

see also: 
https://stackoverflow.com/questions/12791501/python-initializing-a-list-of-lists

So I later learned that such an expression would make the list inside the list 
have the same reference, which would cause the problem that you modified one 
element would lead to all elements changed in the nested list.

For example:

>>> nested_list[0].append(1)
>>> nested_list
[[1], [1], [1], [1], [1]]

Therefore, maybe we could tell users how to initialize the list on the 
documentation like below:

If you need to initialize the nested list, you could follow the below example, 
also, be aware of the expression like ``[[]] * 5``, this will cause the five 
lists in the nested list to have the same reference.

   >>> nested_list = [[] for _ in range(5)]

--
assignee: docs@python
components: Documentation
messages: 354844
nosy: docs@python, krnick
priority: normal
severity: normal
status: open
title: Improve the documentation of the nested list initialization
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38506] Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 3.x

2019-10-17 Thread ynyyn


New submission from ynyyn :

I, for interest, read some of source code of Python launcher, and found it used 
string comparison function (`wcscmp()`, in function `compare_pythons()`) to 
sort Python version in descending order.

It works well currently. But if Python 3.10 or Python 3.xx comes up in the 
future, Python 3.xx will be ranked after 3.x.

I modified the Registry and made a fake version Python 3.10, to check the 
launcher's behaviour.

```
PS > py -0p
Installed Pythons found by C:\Windows\py.exe Launcher for Windows
 -3.8-64D:\Program Files\Python38\python.exe *
 -3.7-64D:\Program Files\Python37\python.exe
 -3.7-32D:\Program Files (x86)\Python37-32\python.exe
 -3.6-32C:\Program Files (x86)\Python36-32\python.exe
 -3.10-64   D:\Program Files\Python37\python.exe
 -2.7-64C:\python27-x64\python.exe
```

The result turned out that Python 3.10 was really ranked after 3.x.

And it seems that Python 3.xx should be a valid (or supported) version 
according to the comment from function `validate_version()`.


```
static BOOL
validate_version(wchar_t * p)
{
/*
Version information should start with the major version,
Optionally followed by a period and a minor version,
Optionally followed by a minus and one of 32 or 64.
Valid examples:
  ...
  2.7-32
  The intent is to add to the valid patterns:
  3.10
  3-32
  ...
*/

I am not sure whether this is a potential defect that had been confirmed 
before... But I do not see some relevant comments in the source code.

--
components: Windows
messages: 354843
nosy: paul.moore, steve.dower, tim.golden, ynyyn, zach.ware
priority: normal
severity: normal
status: open
title: Launcher for Windows (py.exe) may rank Python 3.xx (in the future) after 
3.x
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38490] statistics: add covariance and Pearson's correlation

2019-10-17 Thread Tymek Wołodźko

Tymek Wołodźko  added the comment:

I expanded my PR to add simple linear regression. I also created
documentation for the new functionalities.

As about covariance, we can simply not expose it to the users, but I'm not
convinced that there is any gain in keeping it hidden from the users.

Tim

On Wed, Oct 16, 2019 at 11:25 AM Tymek Wołodźko 
wrote:

>
> Tymek Wołodźko  added the comment:
>
> In case there is agreement with Steven, I will add simple linear regression
> ( https://en.wikipedia.org/wiki/Simple_linear_regression ) in the same PR,
> since it is just:
>
> slope = correlation(x, y) * ( stdev(y) / stdev(x) )
> intercept = mean(y) - slope * mean(x)
>
> As about covariance, I see your points, but why not keeping it "because we
> can"? It can be useful for some users and the functionality still needs to
> be implemented to have correlation coefficient.
>
> On Wed, Oct 16, 2019 at 10:47 AM Steven D'Aprano 
> wrote:
>
> >
> > Steven D'Aprano  added the comment:
> >
> > I can't speak for other countries, but in Australia, secondary school
> > mathematics teaches correlation coefficient and linear regression from
> > Year 11 onwards (typically ages 16 or 17). Covariance is not itself
> > taught, and as far as I can tell neither the TI-83 nor NSpire
> > provides a built-in covariance command.
> >
> > On the other hand, other calculators such as the HP-48GX do.
> >
> > Oddly, Excel provides the population (not sample) covariance:
> >
> >
> >
> https://support.office.com/en-us/article/COVARIANCE-P-function-6F0E1E6D-956D-4E4B-9943-CFEF0BF9EDFC
> >
> > OpenOffice and LibreOffice also provide a covariance function.
> >
> > I think that supporting correlation coefficient `r` and linear
> > regression would be clear wins, from the perspective of secondary school
> > maths. But as far as covariance goes, it would help convince me if you
> > had either:
> >
> > - evidence that covariance is taught in secondary schools, or at
> >   least first year undergraduate statistics;
> >
> > - that it has use-cases beyond "helper for calculating r";
> >
> > - or that there is demand for it from people who want covariance
> >   but can't, or don't want to, use numpy/scipy.
> >
> > --
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38505] Mock.call_args and Mock.call_args_list not propagated to parent Mock

2019-10-17 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38505] Mock.call_args and Mock.call_args_list not propagated to parent Mock

2019-10-17 Thread Caris Moses


Change by Caris Moses :


--
title: Mock.call_args and Mock.call_args_list -> Mock.call_args and 
Mock.call_args_list not propagated to parent Mock

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38505] Mock.call_args and Mock.call_args_list

2019-10-17 Thread Caris Moses


New submission from Caris Moses :

When I use some_mock.attach_mock(...) and make calls, the resulting 
some_mock.call_args is None while the some_mock.mock_calls list is not empty.

The code below shows this in Python 3.7.5:

from unittest import TestCase
from unittest.mock import patch, Mock

def foo(value):
return value

class MyObjectTest(TestCase):

@patch(f'{__name__}.foo')
def test_do_something(self, mock_foo):
manager = Mock()
manager.attach_mock(mock_foo, 'foo_func')
foo(3)
print(manager.mock_calls)
print(manager.call_args)
print(manager.call_args_list)

if __name__ == "__main__":
unittest.main()

The print statements return:
[call.foo_func(3)]
None
[]

While the code below (without attach_mock) works fine:

from unittest import TestCase
from unittest.mock import patch, Mock

def foo(value):
return value

class MyObjectTest(TestCase):

@patch(f'{__name__}.foo')
def test_do_something(self, mock_foo):
foo(3)
print(mock_foo.mock_calls)
print(mock_foo.call_args)
print(mock_foo.call_args_list)

if __name__ == "__main__":
unittest.main()

Print statements correctly return:
[call(3)]
call(3)
[call(3)]

I also tested in Python 3.8.0 and got the same result.

--
messages: 354841
nosy: Caris Moses
priority: normal
severity: normal
status: open
title: Mock.call_args and Mock.call_args_list

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38358] ASSERTION ERROR WHILE USING TENSORFLOW

2019-10-17 Thread Puneet Bawa


New submission from Puneet Bawa :

-is. Please report this to the AutgoGraph team. When filing the bug, set the 
verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full 
output. Cause: converting >: 
AssertionError: Bad argument number for Name: 3, expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph team. When filing the bug, set the verbosity to 10 (on Linux, 
`export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: converting 
>: AssertionError: Bad argument number for Name: 3, 
expecting 4
WARNING:tensorflow:Entity > could 
not be transformed and will be executed as-is. Please report this to the 
AutgoGraph 

[issue24260] TabError behavior doesn't match documentation

2019-10-17 Thread Mikko Rantalainen


Mikko Rantalainen  added the comment:

As I wrote in duplicate issue38496 (with emphasis added):

I'd prefer python3 to require that *all whitespace* at the start of the all the 
lines is *tabs for the whole file*, or *spaces for the whole file*. And first 
indented line sets the preference for the whole file.

That way python3 would really disallow mixing spaces and tabs. And the people 
who like to use tabs for indent (e.g. me) are happy because they can adjust the 
amount of indent up to their own taste. I'm in the Allman-8 camp for all 
languages I use.

--
nosy: +Mikko Rantalainen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34953] Implement `mmap.mmap.__repr__`

2019-10-17 Thread Xiang Zhang


Xiang Zhang  added the comment:


New changeset d8ca2354ed30c12b9ce37c4535222b700a727b32 by Xiang Zhang (Taine 
Zhao) in branch 'master':
bpo-34953: Implement `mmap.mmap.__repr__` (GH-9891)
https://github.com/python/cpython/commit/d8ca2354ed30c12b9ce37c4535222b700a727b32


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38504] Reduce the size of deb package

2019-10-17 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think python-dev or other forums would be of good help than the bug tracker 
given that it involves optimizing deb package.

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34953] Implement `mmap.mmap.__repr__`

2019-10-17 Thread Xiang Zhang


Change by Xiang Zhang :


--
components: +Extension Modules -Interpreter Core
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38493] os.CLD_KILLED and os.CLD_STOPPED should be implemented

2019-10-17 Thread Dong-hee Na


Change by Dong-hee Na :


--
title: os.CLD_KILLED should be implemented -> os.CLD_KILLED and os.CLD_STOPPED 
should be implemented

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38504] Reduce the size of deb package

2019-10-17 Thread 刘家东

New submission from 刘家东 :

I am not very good at python, but now I have a need, which is how to compile 
the source code into a deb package, so that the deb is minimal. The obtained 
deb package only need to meet the function of installing modules through pip 
and no extra features are needed.

--
messages: 354837
nosy: 刘家东
priority: normal
severity: normal
status: open
title: Reduce the size of deb package
type: resource usage
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38482] BUG in codecs.BufferedIncrementalDecoder

2019-10-17 Thread Walter Dörwald

Walter Dörwald  added the comment:

codecs.iterencode()/iterdecode() are just shallow 10-line wrappers around 
incremental codecs (which are used as the basis of io streams).

Note that the doc string for iterencode() contains:

   Encodes the input strings from the iterator using an IncrementalEncoder.

i.e. "strings" (plural) should give a hint that iterator is an iterator over 
strings.

But maybe this could be made clearer.

And https://docs.python.org/3/library/codecs.html#codecs.iterencode and 
https://docs.python.org/3/library/codecs.html#codecs.iterdecode could indead be 
clearer about what iterator should be. An example might also help.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37587] JSON loads performance improvement for long strings

2019-10-17 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38503] bug: string search can find \n, but can NEVER find \r

2019-10-17 Thread Inada Naoki


Inada Naoki  added the comment:

It is "universal newline".
See
https://docs.python.org/3/library/functions.html#open
and
https://docs.python.org/3/glossary.html#term-universal-newlines

--
nosy: +inada.naoki
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38503] bug: string search can find \n, but can NEVER find \r

2019-10-17 Thread wang xuancong


New submission from wang xuancong :

If I load a file which contains "\r" and "\n", I can find "\n", but not "\r". 
This behaviour is inconsistent in Python 3, but consistent in Python 2.

>>> open('./3cjkxdnw/accessibilityLog/1570181896323.csv', 
>>> 'rb').read().count(b'\r')
88
>>> open('./3cjkxdnw/accessibilityLog/1570181896323.csv').read().count('\r')
0
>>> type(open('./3cjkxdnw/accessibilityLog/1570181896323.csv').read())

>>> type('\r')


Thanks!

--
messages: 354834
nosy: xuancong84
priority: normal
severity: normal
status: open
title: bug: string search can find \n, but can NEVER find \r
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37587] JSON loads performance improvement for long strings

2019-10-17 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 9c11029bb41caab5576f354fbf808a5e91325bb0 by Inada Naoki in branch 
'master':
bpo-37587: json: Use _PyUnicodeWriter when scanning string. (GH-15591)
https://github.com/python/cpython/commit/9c11029bb41caab5576f354fbf808a5e91325bb0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-17 Thread Louis Huemiller


Louis Huemiller  added the comment:

Reinstalled the server I'd been using for this issue, with Ubuntu 18.04.3 LTS 
Server amd64. This installation already came with Python3.6.8.  Downloaded and 
installed Python3.7.3 and 3.8.0 from:

  https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
  https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz

The installation process was somewhat complicated, with several to be 
discovered prerequisites.  Used "apt install" to install the following needed 
dependencies:

  build-essential checkinstall libreadline-gplv2-dev libncursesw5-dev 
libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev zlib1g-dev 
libffi-dev

Then was able to do the following to build and install the downloaded 
Python3.7.3 and 3.8.0:

  $ sudo ./configure --enable-optimizations
  $ sudo -H make altinstall

Then downloaded a clone of my magiccube2x2 repository and obtained the 
following results:

  $ python3.6 ./permutations2x2 --max_depth 6 | egrep "^# Total_Time:"
  # Total_Time: 69.02
  $ python3.7 ./permutations2x2 --max_depth 6 | egrep "^# Total_Time:"
  # Total_Time: 84.52
  $ python3.8 ./permutations2x2 --max_depth 6 | egrep "^# Total_Time:"
  # Total_Time: 83.14

In this case the runtimes under both of the Python versions that I downloaded 
the source for and built are significantly slower than the run with python3.6, 
which came already as part of Ubuntu 18.04.3.

Instead of using the version of python3.7.3 that I built, was able to do:

  $ sudo apt install python3.7

to get one that had already been built for Ubuntu.  Doing this allowed the 
following result:

  $ /usr/bin/python3.7 ./permutations2x2 --max_depth 6 \
| egrep "^# Total_Time:"
  # Total_Time: 62.39

Which is better than even the Python3.6 result.  Unfortunately, there is not 
currently a pre-built Ubuntu package for Python3.8 and the one from 
ppa:deadsnakes/ppa, I already know has the performance issue.

I did some searching on wiki.python.org and I was unable to find any 
instructions for how to build python from the source.  Perhaps the instructions 
are already there but I was unable to find them.

Perhaps this issue should be re-opened as a documentation error. I could really 
use instructions on how to built a performance version of Python and I suspect 
several others could also use this. For example, I'd like to pass that 
information to the maintainers of the deadsnakes repository.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com