[issue36464] Python 2.7 build install fails intermittently with -j on MacOS

2021-05-16 Thread Carol Willing


Carol Willing  added the comment:

@iritkatriel Thanks for the follow up. I'm going to close this as I haven't 
seen any issues with -j on MacOS.

--
resolution:  -> not a bug
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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Miki Tebeka


Miki Tebeka  added the comment:

I'm +1 on the changes proposed by Raymond.

In my teaching experience most developers who will use the built-in statistics 
package will have highschool level math experience.

On the other hand, they'll probably to Wikipedia and the entry there uses 
dependent variable and regressor 
(https://en.wikipedia.org/wiki/Linear_regression#Introduction)

On the third hand :) scipy 
(https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html)
 uses slope and intercept.

I thin "Line" is a good name for the result.

--
nosy: +tebeka

___
Python tracker 

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



[issue44154] Optimize Fraction pickling

2021-05-16 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Yes, this looks reasonable.  Go ahead with a PR.

--
assignee:  -> rhettinger
nosy: +rhettinger
type:  -> performance

___
Python tracker 

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



[issue44154] Optimize Fraction pickling

2021-05-16 Thread Sergey B Kirpichev


New submission from Sergey B Kirpichev :

The current version of the Fraction.__reduce__() method uses str(), which 
produces bigger dumps, esp. for large components.

C.f.:
>>> import random, pickle
>>> from fractions import Fraction as F
>>> random.seed(1); a = F(*random.random().as_integer_ratio())
>>> for proto in range(pickle.HIGHEST_PROTOCOL + 1):
... print(len(pickle.dumps(a, proto)))
... 
71
70
71
71
77
77
>>> b = a**13
>>> for proto in range(pickle.HIGHEST_PROTOCOL + 1):
... print(len(pickle.dumps(b, proto)))
... 
444
443
444
444
453
453

vs the attached patch:
>>> for proto in range(pickle.HIGHEST_PROTOCOL + 1):
... print(len(pickle.dumps(a, proto)))
... 
71
68
49
49
59
59
>>> for proto in range(pickle.HIGHEST_PROTOCOL + 1):
... print(len(pickle.dumps(b, proto)))
... 
444
441
204
204
214
214

Testing for non-default protocols was also added.  Let me know if all this does 
make sense as a PR.

--
components: Library (Lib)
files: fractions-pickle.diff
keywords: patch
messages: 393781
nosy: Sergey.Kirpichev
priority: normal
severity: normal
status: open
title: Optimize Fraction pickling
versions: Python 3.11
Added file: https://bugs.python.org/file50047/fractions-pickle.diff

___
Python tracker 

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



[issue44154] Optimize Fraction pickling

2021-05-16 Thread Tim Peters


Tim Peters  added the comment:

Oh yes - please do. It's not just pickle size - going through str() makes 
(un)pickling quadratic time in both directions if components are large. Pickle 
the component ints instead, and the more recent pickle protocol(s) can do both 
directions in linear time instead.

--
nosy: +tim.peters

___
Python tracker 

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



[issue38671] pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist

2021-05-16 Thread Barney Gale


Change by Barney Gale :


--
nosy: +barneygale
nosy_count: 8.0 -> 9.0
pull_requests: +24802
pull_request: https://github.com/python/cpython/pull/26184

___
Python tracker 

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



[issue42234] pathlib relative_to behaviour change

2021-05-16 Thread Barney Gale


Barney Gale  added the comment:

That does sound pretty useful! I'd be happy to review a PR though I'm not a 
core dev.

--
nosy: +barneygale

___
Python tracker 

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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Matt Harrison


Matt Harrison  added the comment:

The ML world has collapsed on the terms X and y. (With that capitalization). 
Moreover, most (Python libraries) follow the interface of scikit-learn [0].

Training a model looks like this:

model = LinearRegression()
model.fit(X, y)

After that, the model instance has attribute that end in "_" that were learned 
from fitting. For linear regression[1] you get:

model.coef_# slope
model.intercept_   # intercept

To make predictions you call .predict:

y_hat = model.predict(X)

One bonus of leveraging the .fit/.predict interface (which other libraries such 
as XGBoost have also adopted) is that if your model is in the correct layout, 
you can trivially try different models.


0 - 
https://scikit-learn.org/stable/tutorial/basic/tutorial.html#learning-and-predicting

1 - 
https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html#sklearn.linear_model.LinearRegression

--
nosy: +matthewharrison

___
Python tracker 

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



[issue36876] [subinterpreters] Global C variables are a problem

2021-05-16 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I'm getting the following FutureWarning on a certain regular expression. I 
think it just needs "[]" to become "\[\]".

0:05:36 load avg: 0.00 [ 53/427] test_check_c_globals
...\Tools\c-analyzer\c_common\tables.py:236: FutureWarning: Possible nested set 
at position 12
  _COLSPEC_RE = re.compile(textwrap.dedent(r'''

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Matt Harrison


Matt Harrison  added the comment:

And by "if your model is in the correct layout", I meant "if your data is in 
the correct layout"

--

___
Python tracker 

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



[issue44154] Optimize Fraction pickling

2021-05-16 Thread Sergey B Kirpichev


Change by Sergey B Kirpichev :


--
pull_requests: +24803
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26186

___
Python tracker 

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



[issue42234] pathlib relative_to behaviour change

2021-05-16 Thread Barney Gale


Barney Gale  added the comment:

In fact, I think this is a duplicate of issue40358, which has an open PR 
against it.

--

___
Python tracker 

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



[issue40358] pathlib's relative_to should behave like os.path.relpath

2021-05-16 Thread Barney Gale


Barney Gale  added the comment:

Also requested in #42234.

--
nosy: +barneygale

___
Python tracker 

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



[issue44154] Optimize Fraction pickling

2021-05-16 Thread Sergey B Kirpichev


Sergey B Kirpichev  added the comment:

> Oh yes - please do.

Ok, I did.

> It's not just pickle size - going through str() makes (un)pickling quadratic 
> time in both directions if components are large.

Yeah, I noticed speedup too, but size was much more important for may 
application.

BTW, the same issue affects some other stdlib modules, ex. in the Decimal() it 
will be more efficient to use the tuple (sign, digit_tuple, exponent) instead 
of dumping strings.  Maybe more, simple fgrep suggests me also the ipaddress 
module, but I think here it's ok;-)

--

___
Python tracker 

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



[issue44145] hmac.update is not releasing the GIL when openssl's hmac is used

2021-05-16 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +patch
pull_requests: +24791
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26157

___
Python tracker 

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



[issue44145] hmac.update is not releasing the GIL when openssl's hmac is used

2021-05-16 Thread Gregory P. Smith


New submission from Gregory P. Smith :

This prevents parallel hmac computations.

see michaelforney's comment left on https://github.com/python/cpython/pull/20129
where the problem was introduced when adding support for using OpenSSL's HMAC 
implementations.

easy fix.  PR coming.

We don't really have a way to unittest for regressions on things like this.

--
assignee: gregory.p.smith
components: Extension Modules
keywords: 3.9regression
messages: 393733
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: hmac.update is not releasing the GIL when openssl's hmac is used
type: performance
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue39950] Add pathlib.Path.hardlink_to()

2021-05-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24792
pull_request: https://github.com/python/cpython/pull/26158

___
Python tracker 

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



[issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found."

2021-05-16 Thread Christian Heimes


Christian Heimes  added the comment:

Python 3.7 is in security fix-only mode and will not get support for OpenSSL 
3.0.0. Only Python 3.8, 3.9, 3.10 beta, and main branch contain OpenSSL 3.0.0 
compatibility patches.

--

___
Python tracker 

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



[issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found."

2021-05-16 Thread Tarnum


Tarnum  added the comment:

Got it but this is a sad news for me...

--

___
Python tracker 

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



[issue44134] lzma: stream padding in xz files

2021-05-16 Thread rogdham


rogdham  added the comment:

It must be decided what to do in the following cases, which are not valid per 
the XZ file specification, but supported by the lzma module (and tested):
 1. different format concatenated together (e.g. a .xz and a .lzma); this 
somehow includes tailing null bytes (12 null bytes is a valid .lzma)
 2. trailing junk (i.e. non-null bytes after the stream)

The answer may be different depending on the format arg (e.g. FORMAT_AUTO vs 
FORMAT_XZ).

--

___
Python tracker 

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



[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2021-05-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 26160 adds support of %d, %i, %u, %o, %x, %X, %f, %e, %g, %F, %E, %G.

What is not supported:

* Formatting with a single value not wrapped into a 1-tuple (like in "%d bytes" 
% size). The behavior is non-trivial, it needs checking whether the value is a 
tuple or a mapping. It would require adding more opcodes and AST nodes and 
generating complex bytecode.
* Mapping keys (like in "%(name)s"). They are rarely used, and if used, it is 
not performance critical.
* Precision for integer formatting. Precision is not supported in new-style 
formatting of integers, and it is not trivial to reproduce this behavior.
* Variable width and precision (like in "%*.*s"). It is possible to support 
them, but the code would be pretty complex, and the benefit is small, because 
this feature is rarely used and is not performance critical.
* Format code %c. It is relatively rarely used.
* Length modifiers "h", "l" and "L" (like in "%ld"). They ignored in Python and 
I did not see them in real code. While supporting them is easy, it would 
requires adding more than one line of code, it is not worth it.

--
priority: low -> normal

___
Python tracker 

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



[issue42834] [subinterpreters] Make static caches in various places subinterpreter compatible

2021-05-16 Thread Ken Jin


Ken Jin  added the comment:

Hi Victor, I'm re-using this issue as I'm doing a similar change to compile.c. 
I hope you're alright with that.

--
resolution: fixed -> 
status: closed -> open
title: [subinterpreters] Convert "global" static variable caches in _json to 
heap variables -> [subinterpreters] Make static caches in various places 
subinterpreter compatible
versions: +Python 3.11

___
Python tracker 

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



[issue44141] Getting error while importing ssl "import _ssl ImportError: DLL load failed: The specified procedure could not be found."

2021-05-16 Thread Christian Heimes


Christian Heimes  added the comment:

OpenSSL 3.0.0 is in alpha phase, which means it is unstable, experimental, and 
not designed for end-users or production use. I recommend that you stick to 
OpenSSL 1.1.1. It will be supported until September 2023.

--
resolution:  -> wont fix
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



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-16 Thread Bassel


New submission from Bassel :

I'm trying to import these libraries in python using this code:

import matplotlib as plt
from matplotlib import style
import pandas as pd
import pandas_datareader.data as web
I get unresolved import for each line. I installed them using the terminal of 
Visual Studio using the following commands

pip install matplotlib
pip install pandas
pip install numpy
pip install sklearn
pip install pandas-datareader
pip install beautifulsoup4
What should I do to solve this problem? Please consider that I'm kind of a 
beginner so make your answer detailed. Thanks!

--
components: Windows
messages: 393739
nosy: bassel27, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [WinError 193] %1 is not a valid Win32 application
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



[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2021-05-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +24794
pull_request: https://github.com/python/cpython/pull/26160

___
Python tracker 

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



[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2021-05-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +Mark.Shannon
versions: +Python 3.11 -Python 3.7

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2021-05-16 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +24793
pull_request: https://github.com/python/cpython/pull/26159

___
Python tracker 

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



[issue44146] Format string fill not handling brace char

2021-05-16 Thread svs


New submission from svs :

Format strings and f-strings don't seem to handle brace characters as a fill 
character.

E.g.

'{::>10d'.format(5) => ':5"  (as expected)

'{:{>10d'.format(5) => error. Expect: '{5"

trying {{ escape does not work either.
'{:{{>10d'.format(5) => error.

The same goes for '}'. f-strings have a similar issue.

--
components: Interpreter Core
messages: 393735
nosy: snegavs
priority: normal
severity: normal
status: open
title: Format string fill not handling brace char
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue42834] [subinterpreters] Make static caches in various places subinterpreter compatible

2021-05-16 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +24795
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/26161

___
Python tracker 

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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Related links:

* 
https://support.microsoft.com/en-us/office/linest-function-84d7d0d9-6e50-4101-977a-fa7abf772b6d

* 
https://www.khanacademy.org/math/statistics-probability/describing-relationships-quantitative-data/introduction-to-trend-lines/a/linear-regression-review

* TI-84:  LinReg(ax + b)See attached screen shot

--
Added file: https://bugs.python.org/file50046/Screen Shot 2021-05-16 at 1.46.45 
PM.png

___
Python tracker 

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



[issue44152] .isupper() does not support Polytonic Greek (but .islower() does)

2021-05-16 Thread E G

New submission from E G :

Δημοϲθενικοί starts with an upper-case delta. 'Δημοϲθενικοί'.isupper() should 
yield "True".

Ἀεὶ also fails this test: it begins with a capital Alpha with a breathing.

εἰϲ is properly parsed: isupper() is False and islower() is True. 

Despite the problem with .isupper(), .capitalize() does seem to work properly: 
'ὦ' --> 'Ὦ' and 'ἂν' --> 'Ἂν'


a transcript follows



Python 3.9.5 (default, May  4 2021, 03:36:27)

Greek vs .isupper(): seems like .islower() is properly implemented but 
that .isupper() is not

>>> 'ζῳώδηϲ'.islower()
True
>>> 'Δημοϲθενικοί'.islower()
False
>>> 'Δημοϲθενικοί'.isupper()
False
>>> x = 'Ἀεὶ'
>>> x.islower()
False
>>> x.isupper()
False
>>> x = 'εἰϲ'
>>> x.isupper()
False
>>> x.islower()
True
>>> x = 'ἂν'
>>> x.islower()
True
>>> x.isupper()
False
>>> x= 'ὦ'
>>> x.isupper()
False
>>> x.islower()
True

>>> x.capitalize()
'Ὦ'
>>> 'ἂν'.capitalize()
'Ἂν'

--
messages: 393759
nosy: egun
priority: normal
severity: normal
status: open
title: .isupper() does not support Polytonic Greek (but .islower() does)
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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-05-16 Thread Irit Katriel


Change by Irit Katriel :


--
Removed message: https://bugs.python.org/msg393489

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-05-16 Thread Irit Katriel


Change by Irit Katriel :


--
Removed message: https://bugs.python.org/msg384971

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-05-16 Thread Irit Katriel


Irit Katriel  added the comment:

I agree with Iman that this looks like a bug because the code updates the 
result object with skip info but then doesn't return it.

The patch needs a unit test covering this, as well as probably a doc update.

--

___
Python tracker 

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



[issue44148] Raise a SystemError if frame is NULL in PyEval_GetGlobals

2021-05-16 Thread Shreyan Avigyan


Change by Shreyan Avigyan :


--
keywords: +patch
pull_requests: +24797
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26166

___
Python tracker 

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



[issue44149] difflib.get_close_matches: Add `key` argument

2021-05-16 Thread Mustafa Quraish


New submission from Mustafa Quraish :

Add a `key` argument to difflib.get_close_matches(), so that it is possible to 
say find the closest objects where an attribute matches the given string.

--
components: Library (Lib)
messages: 393747
nosy: mustafaquraish
priority: normal
severity: normal
status: open
title: difflib.get_close_matches: Add `key` argument
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue44148] Raise a SystemError if frame is NULL in PyEval_GetGlobals

2021-05-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I don't know much about ceval.c functions, so is there a reason 
PyEval_GetGlobals doesn't raise an error? I'm sorry for creating noise about it 
if the current behavior is intended. I'll close the issue and the PR then.

--

___
Python tracker 

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



[issue44149] difflib.get_close_matches: Add `key` argument

2021-05-16 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +24798
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26170

___
Python tracker 

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



[issue44144] Python window not opening

2021-05-16 Thread Christian Heimes


Change by Christian Heimes :


--
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



[issue44149] difflib.get_close_matches: Add `key` argument

2021-05-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses

2021-05-16 Thread Pete Wicken


Change by Pete Wicken :


--
keywords: +patch
pull_requests: +24799
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26172

___
Python tracker 

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



[issue33433] ipaddress is_private misleading for IPv4 mapped IPv6 addresses

2021-05-16 Thread Pete Wicken


Pete Wicken  added the comment:

I've opened a PR that should hopefully address this issue.

--

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Serhiy: what do you know of tcl finalization?

Tal: why does your patch only expose the option that you said crashes ubuntu.

Spacekiwigames: if you have a cpython fork and local repository, you could try 
the patch on your linux mint.

--
nosy: +Spacekiwigames, serhiy.storchaka

___
Python tracker 

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



[issue44150] Add optional weights parameter to statistics.fmean()

2021-05-16 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Weighted averages are another basic that we should support.

A professor assigns a grade for a course by weighting quizzes at 20%, homework 
at 20%, a midterm exam at 30%, and a final exam at 30%:

>>> grades = [85, 92, 83, 91]
>>> weights = [0.20, 0.20, 0.30, 0.30]
>>> fmean(grades, weights)
87.6

The API here matches that for harmonic_mean() and random.choices(), the other 
places where we support optional weights.

--
components: Library (Lib)
messages: 393751
nosy: rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Add optional weights parameter to statistics.fmean()
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Can you provide the full traceback log of at least one of the import failures. 
Try importing matplotlib, for example, and extract the traceback log. Usually 
this error occurs due to PATH conflicts. This issue is thoroughly discussed in 
https://github.com/pytorch/pytorch/issues/27693. You may find a answer there. 
If your problem still persists then please provide the full traceback here to 
help everyone further debug your issue.

--
nosy: +shreyanavigyan

___
Python tracker 

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



[issue44150] Add optional weights parameter to statistics.fmean()

2021-05-16 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +24800
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26175

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Tal Einat


Change by Tal Einat :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Tal: cancel comment above.  I was confused because FinalizeThread is exposed as 
just finalize.

On Windows, PR fixes issue whether Shell or editor is closed last.

--

___
Python tracker 

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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Raymond Hettinger


New submission from Raymond Hettinger :

The current signature is:

linear_regression(regressor, dependent_variable)

While the term "regressor" is used in some problem domains, it isn't well known 
outside of those domains.   The term "independent_variable" would be better 
because it is common to all domains and because it is the natural counterpart 
to "dependent_variable".

Another issue is that the return value is a named tuple in the form:

LinearRegression(intercept, slope)

While that order is seen in multiple linear regression, most people first learn 
it in algebra as the slope/intercept form:  y = mx + b.   That will be the 
natural order for a majority of users, especially given that we aren't 
supporting multiple linear regression.

The named tuple is called LinearRegression which describes how the result was 
obtained rather than the result itself.  The output of any process that fits 
data to a line is a line.  The named tuple should be called Line because that 
is what it describes.  Also, a Line class would be reusuable for other purposes 
that linear regression.

Proposed signature:

  linear_regression(independent_variable, dependent_variable) -> Line(slope, 
intercept)

--
components: Library (Lib)
messages: 393754
nosy: pablogsal, rhettinger, steven.daprano
priority: normal
severity: normal
status: open
title: Improve parameter names and return value ordering for linear_regression
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Can we backport?  The change to _tkinter, not directly exposed in tkinter, 
could be considered an enhancement, but is necessary to fix what I consider a 
real bug in tkinter, and hence in IDLE.

Pablo, would you allow the _tkinter change in .0b2?

If we cannot backport the _tkinter change, can the tcl function be accessed 
through root.tk.call('')?  I am guessing that 'exit' exits the process from 
tcl, which is probably not what we want.
https://www.tcl.tk/man/tcl8.6/TclLib/Exit.htm
suggests that when tcl is loaded as an extention, Tcl_Finalize should be called 
instead of Tcl_Exit to *not* exit the process.

--
nosy: +pablogsal

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

As Tal notes on the PR, the _tkinter patch is the minimum needed to fix the 
problem for IDLE, not the undetermined patch to tkinter that should be done to 
properly expose the fix to all tkinter users.

If the tcl function were exposed with a presumably temporary private name, 
'_finalize_tcl', rather than a public name, 'finalize_tcl', then I presume we 
should be able to backport without question.

--

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Tal Einat


Tal Einat  added the comment:

> Can we backport?  The change to _tkinter, not directly exposed in tkinter, 
> could be considered an enhancement, but is necessary to fix what I consider a 
> real bug in tkinter, and hence in IDLE.

I'm +1 for backporting the latest PR.  It only adds the clearly internal and 
undocumented _tkinter.finalize_tcl(), which is only used by IDLE.

--

___
Python tracker 

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



[issue44148] Raise a RuntimeError if frame is NULL in PyEval_GetGlobals

2021-05-16 Thread Shreyan Avigyan


New submission from Shreyan Avigyan :

Currently, PyEval_GetGlobals just returns NULL if frame is NULL while 
PyEval_GetLocals raises a runtime error and then returns NULL if frame is NULL. 
Raising a RuntimeError and then returning NULL from PyEval_GetGlobals if frame 
is NULL would be a better idea.

--
components: C API
messages: 393745
nosy: shreyanavigyan
priority: normal
severity: normal
status: open
title: Raise a RuntimeError if frame is NULL in PyEval_GetGlobals
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Tal Einat


Tal Einat  added the comment:

Okay, so it appears that a generic solution for tkinter is non-trivial, as it 
is not clear when to call Tcl_Finalize() or Tcl_FinalizeThread().

However, giving tkinter apps the ability to call those when appropriate is 
possible.  Exposing a thin wrapper around Tcl_Finalize in _tkinter, and making 
IDLE call that when exiting, resolves the clipboard preservation issue.

For some reason, calling Tcl_Finalize causes a memory segmentation issue for me 
on Ubuntu 20.04.  However, calling Tcl_FinalizeThread also resolves the 
clipboard issue without causing problems.  On Windows 10, calling either 
function works.

--

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Tal Einat


Tal Einat  added the comment:

See PR GH-26163.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +24796
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26163

___
Python tracker 

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



[issue44114] Incorrect function signatures in dictobject.c

2021-05-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 925cb85e9e28d69be53db669527c0a1292f0fbfb by Miss Islington (bot) 
in branch '3.9':
bpo-44114: Fix dictkeys_reversed and dictvalues_reversed function signatures 
(GH-26062) (GH-26093)
https://github.com/python/cpython/commit/925cb85e9e28d69be53db669527c0a1292f0fbfb


--

___
Python tracker 

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



[issue44148] Raise a SystemError if frame is NULL in PyEval_GetGlobals

2021-05-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Sorry, it's SystemError not RuntimeError

--
title: Raise a RuntimeError if frame is NULL in PyEval_GetGlobals -> Raise a 
SystemError if frame is NULL in PyEval_GetGlobals

___
Python tracker 

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



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-16 Thread Eryk Sun


Eryk Sun  added the comment:

The issue tracker is not a general support forum for software development. 
Please ask first on python-list or the users group on discuss.python.org. For 
now, I'm changing the status of this issue to pending. If the discussion 
determines that there's a bug in Python that needs to be fixed, please return 
with the relevant information and example code to reproduce the problem.

> Usually this error occurs due to PATH conflicts. 

Python 3.8 and above does not use PATH when importing extension modules, nor by 
default with ctypes CDLL and WinDLL. See os.add_dll_directory(). Note that 
commonly the latter isn't needed because the directory of the loaded PYD/DLL is 
implicitly searched.

--
nosy: +eryksun
status: open -> pending

___
Python tracker 

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



[issue44152] .isupper() does not support Polytonic Greek (but .islower() does)

2021-05-16 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Are you sure that all characters in Δημοϲθενικοί are upper-case letters? 
Because this is what the isupper() method tests.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44152] [not a bug] .isupper() does not support Polytonic Greek (but .islower() does)

2021-05-16 Thread E G


E G  added the comment:

Oops: this is not a bug. The isupper() method tests ALL chars.

Only the first char in the examples was a capital. All of the logic/tests 
succeed.

Sorry for the error. Thanks to Serhiy S. for swift attention on this.

--
resolution:  -> not a bug
title: .isupper() does not support Polytonic Greek (but .islower() does) -> 
[not a bug] .isupper() does not support Polytonic Greek (but .islower() does)

___
Python tracker 

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



[issue44152] [not a bug] .isupper() does not support Polytonic Greek (but .islower() does)

2021-05-16 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
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



[issue39950] Add pathlib.Path.hardlink_to()

2021-05-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24801
pull_request: https://github.com/python/cpython/pull/26178

___
Python tracker 

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



[issue44153] Signaling an asyncio subprocess raises ProcessLookupError, depending on timing

2021-05-16 Thread Max Marrone


New submission from Max Marrone :

# Summary

Basic use of `asyncio.subprocess.Process.terminate()` can raise a 
`ProcessLookupError`, depending on the timing of the subprocess's exit.

I assume (but haven't checked) that this problem extends to `.kill()` and 
`.send_signal()`.

This breaks the expected POSIX semantics of signaling and waiting on a process. 
See the "Expected behavior" section.


# Test case

I've tested this on macOS 11.2.3 with Python 3.7.9 and Python 3.10.0a7, both 
installed via pyenv.

```
import asyncio
import sys

# Tested with:
# asyncio.ThreadedChildWatcher (3.10.0a7  only)
# asyncio.MultiLoopChildWatcher (3.10.0a7 only)
# asyncio.SafeChildWatcher (3.7.9 and 3.10.0a7)
# asyncio.FastChildWatcher (3.7.9 and 3.10.0a7)
# Not tested with asyncio.PidfdChildWatcher because I'm not on Linux.
WATCHER_CLASS = asyncio.FastChildWatcher

async def main():
# Dummy command that should be executable cross-platform.
process = await asyncio.subprocess.create_subprocess_exec(
sys.executable, "--version"
)

for i in range(20):
# I think the problem is that the event loop opportunistically wait()s
# all outstanding subprocesses on its own. Do a bunch of separate
# sleep() calls to give it a bunch of chances to do this, for reliable
# reproduction.
#
# I'm not sure if this is strictly necessary for the problem to happen.
# On my machine, the problem also happens with a single sleep(2.0).
await asyncio.sleep(0.1)

process.terminate() # This unexpectedly errors with ProcessLookupError.

print(await process.wait())

asyncio.set_child_watcher(WATCHER_CLASS())
asyncio.run(main())
```

The `process.terminate()` call raises a `ProcessLookupError`:

```
Traceback (most recent call last):
  File "kill_is_broken.py", line 29, in 
asyncio.run(main())
  File "/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/runners.py", 
line 43, in run
return loop.run_until_complete(main)
  File 
"/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/base_events.py", line 
587, in run_until_complete
return future.result()
  File "kill_is_broken.py", line 24, in main
process.terminate() # This errors with ProcessLookupError.
  File 
"/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/subprocess.py", line 
131, in terminate
self._transport.terminate()
  File 
"/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/base_subprocess.py", 
line 150, in terminate
self._check_proc()
  File 
"/Users/maxpm/.pyenv/versions/3.7.9/lib/python3.7/asyncio/base_subprocess.py", 
line 143, in _check_proc
raise ProcessLookupError()
ProcessLookupError
```


# Expected behavior and discussion

Normally, with POSIX semantics, the `wait()` syscall tells the operating system 
that we won't send any more signals to that process, and that it's safe for the 
operating system to recycle that process's PID. This comment from Jack O'Connor 
on another issue explains it well: https://bugs.python.org/issue40550#msg382427

So, I expect that on any given `asyncio.subprocess.Process`, if I call 
`.terminate()`, `.kill()`, or `.send_signal()` before I call `.wait()`, then:

* It should not raise a `ProcessLookupError`.
* The asyncio internals shouldn't do anything with a stale PID. (A stale PID is 
one that used to belong to our subprocess, but that we've since consumed 
through a `wait()` syscall, allowing the operating system to recycle it).

asyncio internals are mostly over my head. But I *think* the problem is that 
the event loop opportunistically calls the `wait()` syscall on our child 
processes. So, as implemented, there's a race condition. If the event loop's 
`wait()` syscall happens to come before my `.terminate()` call, my 
`.terminate()` call will raise a `ProcessLookupError`.

So, as a corollary to the expectations listed above, I think the implementation 
details should be either:

* Ideally, the asyncio internals should not call syscall `wait()` on a process 
until *I* call `wait()` on that process. 
* Failing that, `.terminate()`, `.kill()` and `.send_signal()` should should 
no-op if the asyncio internals have already called `.wait()` on that process.

--
components: asyncio
messages: 393764
nosy: asvetlov, syntaxcoloring, yselivanov
priority: normal
severity: normal
status: open
title: Signaling an asyncio subprocess raises ProcessLookupError, depending on 
timing
type: behavior
versions: Python 3.10, Python 3.7

___
Python tracker 

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



[issue44153] Signaling an asyncio subprocess might raise ProcessLookupError, even if you haven't called .wait() yet

2021-05-16 Thread Max Marrone


Change by Max Marrone :


--
title: Signaling an asyncio subprocess raises ProcessLookupError, depending on 
timing -> Signaling an asyncio subprocess might raise ProcessLookupError, even 
if you haven't called .wait() yet

___
Python tracker 

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



[issue39950] Add pathlib.Path.hardlink_to()

2021-05-16 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset b913f47e87f788e705716ae037ee9f68b4265e69 by Miss Islington (bot) 
in branch '3.10':
bpo-39950: Fix deprecation warning in test for `pathlib.Path.link_to()` 
(GH-26155) (GH-26178)
https://github.com/python/cpython/commit/b913f47e87f788e705716ae037ee9f68b4265e69


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue40172] ZipInfo corrupts file names in some old zip archives

2021-05-16 Thread Irit Katriel


Irit Katriel  added the comment:

Can you suggest a unit test for this?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44146] Format string fill not handling brace char

2021-05-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

In the future, if you get an error, please tell us what the error is. It makes 
responding to bugs easier.

'{::>10d'.format(5)
Gives me an error with 3.10:

>>> '{::>10d'.format(5)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: unmatched '{' in format spec

And your second example:

>>> '{:{>10d'.format(5)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: unmatched '{' in format spec

This root cause of treating left braces as special is because braces can nest. 
I don't think there's any way of doing what you want, just like you can't use a 
closing brace as part of a format spec while using str.format() or f-strings.

width=10
>>> f'{5:{width}}'
' 5'
>>> '{0:{1}}'.format(5, width)
' 5'


If you really want to use braces in the format spec, you should use format, 
which does not parse braces:

>>> format(5, '{>10d')
'{5'

--
nosy: +eric.smith

___
Python tracker 

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



[issue40172] ZipInfo corrupts file names in some old zip archives

2021-05-16 Thread Yudilevi


Yudilevi  added the comment:

Hey :)

Sorry that I'm not responsive, just busy.
I'll add one soon.

Yudi

On Mon, May 17, 2021 at 12:08 AM Irit Katriel 
wrote:

>
> Irit Katriel  added the comment:
>
> Can you suggest a unit test for this?
>
> --
> nosy: +iritkatriel
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-05-16 Thread Iman Tabrizian


Iman Tabrizian  added the comment:

I'll add a documentation and unit test and update the PR.

--

___
Python tracker 

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



[issue40452] Tkinter/IDLE: preserve clipboard on closure

2021-05-16 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Pablo, would you allow the _tkinter change in .0b2?

I checked the change and I think is scoped enough and doesn't change the public 
API (and it solves a bug). Is fine with me, but please make sure of the 
following:

* At least a core dev reviews and approves the change.
* You run with the buildbots before merging.

Thanks for checking!

--

___
Python tracker 

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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I agree with you that "regressor" is too obscure and should be changed.

I disagree about the "y = mx + c". Haven't we already discussed this? That form 
is used in linear algebra, but not used in statistics. Quoting from Yale:

"A linear regression line has an equation of the form Y = a + bX, where X is 
the explanatory variable and Y is the dependent variable. The slope of the line 
is b, and a is the intercept (the value of y when x = 0)."

http://www.stat.yale.edu/Courses/1997-98/101/linreg.htm

This function is being used for statistics, not linear algebra. The users of 
the module are not people doing linear algebra, and most users of statistics 
will be familiar with the Y = a + bX form (or possibly reversed order bX + a).

The TI-84 offers two linear regression functions, ax+b and a+bx. So does the 
Casio Classpad. The Nspire calls them a+bx and mx+b.

https://www.statology.org/linear-regression-ti-84-calculator/

I've seen:

a + bx
ax + b
bx + a
mx + c
mx + b

among others. I don't think that there is any justification for claiming that a 
majority of users will be most familiar with mx+b.

--

___
Python tracker 

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



[issue44151] Improve parameter names and return value ordering for linear_regression

2021-05-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> The named tuple should be called Line because that is what it describes.  
> Also, a Line class would be reusuable for other purposes that linear 
> regression.

I think that most people would expect that a Line class would represent a 
straight line widget in a GUI, not the coefficients of a linear equation.

The result tuple represents an equation (or at least the coefficients of such), 
not the line itself. If it doesn't have a .draw() method, I don't think we 
should call it "Line".

--

___
Python tracker 

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



[issue36464] Python 2.7 build install fails intermittently with -j on MacOS

2021-05-16 Thread Irit Katriel


Irit Katriel  added the comment:

I closed PR 13186 because the change in it was already committed under 
issue36464. Can this issue be closed now as well or is there anything left to 
look into?

--
nosy: +iritkatriel

___
Python tracker 

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