[issue41281] Wrong/missing code formats in datetime documentation

2020-07-11 Thread yyyyyyyan


Change by yyyan :


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

___
Python tracker 

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



[issue41281] Wrong/missing code formats in datetime documentation

2020-07-11 Thread yyyyyyyan


New submission from yyyan :

The datetime page in the docs is missing a lot of needed backquotes syntax for 
inline code samples. There are some wrong role links too, due to ambiguity in 
the text roles.

--
assignee: docs@python
components: Documentation
messages: 373547
nosy: docs@python, eric.araujo, ezio.melotti, mdk, willingc, yyyan
priority: normal
severity: normal
status: open
title: Wrong/missing code formats in datetime documentation
type: enhancement
versions: Python 3.10, 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



[issue41280] lru_cache on 0-arity functions should default to maxsize=None

2020-07-11 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

In 3.9, the @cache() alias is provided as a cleaner way to create an unbounded 
cache.¹  There is no need to special case a zero-arity function.  Besides as 
Rémi and Serhiy have pointed out, we can't know the arity in advance.

¹ https://docs.python.org/3.9/library/functools.html#functools.cache

--
resolution:  -> out of date
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



[issue41280] lru_cache on 0-arity functions should default to maxsize=None

2020-07-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue41280] lru_cache on 0-arity functions should default to maxsize=None

2020-07-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The number of arguments is determined when the function is called (and it may 
be different for every call). maxsize is specified when the function is created.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue41280] lru_cache on 0-arity functions should default to maxsize=None

2020-07-11 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Tom Forbes, I don't think there is a way to be sure that's the function does 
not take any argument. Are you worried about the lost memory when maxsize is 
not set?

--
nosy: +remi.lapeyre

___
Python tracker 

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



[issue41233] Missing links to errnos on Built-in Exceptions page

2020-07-11 Thread yyyyyyyan


yyyan  added the comment:

Thank you so much! :-)

--

___
Python tracker 

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



[issue41280] lru_cache on 0-arity functions should default to maxsize=None

2020-07-11 Thread Tom Forbes


New submission from Tom Forbes :

`functools.lru_cache` has a maxsize=128 default for all functions.

If a function has no arguments then this maxsize default is redundant and 
should be set to `maxsize=None`:

```
@functools.lru_cache()
def function_with_no_args():
pass
```

Currently you need to add `maxsize=None` manually, and ensure that it is also 
updated if you alter the function to add arguments.

--
components: Library (Lib)
messages: 373542
nosy: Tom Forbes
priority: normal
severity: normal
status: open
title: lru_cache on 0-arity functions should default to maxsize=None
type: performance
versions: Python 3.10

___
Python tracker 

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



[issue41274] Better way to random.seed()?

2020-07-11 Thread Juan Jimenez


Juan Jimenez  added the comment:

How would I know if my demo is good enough to be included in that repo? Is 
there a guide for this, or do I just create a pull request, throw it over the 
fence and wait until the wolves either grunt in approval or throw it back at me 
in pieces? I ask because I have never participated in a repo related to as big 
a project as Python 3. :)

--

___
Python tracker 

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



[issue41233] Missing links to errnos on Built-in Exceptions page

2020-07-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Near the bottom of the opening page: 
https://devguide.python.org/#status-of-python-branches
The meaning of 'status' is explained elsewhere.

--

___
Python tracker 

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



[issue41266] IDLE call hints and completions confused by ints and floats

2020-07-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Neither '1 .bit_length()' (space required) nor '1.3.hex()', both legal syntax, 
get either proper completions or call hints.  Neither does the erroneous syntax 
'1.bit_length'. This suggests that the backwards parsing from the final '.' 
could be improved.  The first place to look would be whatever common code there 
is in hyperparser.

(Side note: something.x tabs if no completions are found.  Should inproved 
doc on this.)

--
title: Wrong hint when class methods and builtins named same -> IDLE call hints 
and completions confused by ints and floats
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



[issue40360] Deprecate lib2to3 (and 2to3) for future removal

2020-07-11 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks for joining in! How do you do incremental parsing with LL1 currently? 
FWIW I found 
https://ohmlang.github.io/pubs/sle2017/incremental-packrat-parsing.pdf which 
may have some useful ideas.

--

___
Python tracker 

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



[issue41233] Missing links to errnos on Built-in Exceptions page

2020-07-11 Thread yyyyyyyan


yyyan  added the comment:

Thank you, @terry.reedy! Can you point me if this is defined in some written 
document I can check? Or is it an internal rule everyone kinda finds out by 
themselves?

--

___
Python tracker 

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



[issue41268] 3.9-dev regression? TypeError: exec_module() missing 1 required positional argument: 'module'

2020-07-11 Thread Ned Deily


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



[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2020-07-11 Thread Thomas Gläßle

Thomas Gläßle  added the comment:

Hi, I have rebased this on master and fixed the minor conflict. Let me know if 
there is anything else I can do.

Best, Thomas

--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue41220] add optional make_key argument to lru_cache

2020-07-11 Thread Jim Jewett


Jim Jewett  added the comment:

Going back to Raymond's analysis, this is useful when at least some of the 
parameters either do not change the result, or are not hashable.

At a minimum, you need to figure out which parameters those are, and whether to 
drop them or transform them.

Is this already sufficiently rare or tricky that a subclass is justified, 
instead of trying to shoehorn things into a single key method?

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41246] IOCP Proactor same socket overlapped callbacks

2020-07-11 Thread Tony


Tony  added the comment:

I feel like the metadata is not really a concern here. I like when there is no 
code duplication :)

--

___
Python tracker 

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



[issue41246] IOCP Proactor same socket overlapped callbacks

2020-07-11 Thread Jim Jewett


Jim Jewett  added the comment:

Looks good to me.  

I at first worried that the different function names were useful metadata that 
was getting lost -- but the names were already duplicated in several cases.  
*If* that is still a concern for the committer, then instead of repeating the 
code (as current production does), each section should just say 
newname=origname before registering the static method (as the patch does), and 
should bind a distinct name for each usage.

--
nosy: +Jim.Jewett
versions: +Python 3.10

___
Python tracker 

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



[issue41217] Obsolete note for default asyncio event loop on Windows

2020-07-11 Thread Jim Jewett


Jim Jewett  added the comment:

Looks good to me.

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue41212] Emoji Unicode failing in standard release of Python 3.8.3 / tkinter 8.6.8

2020-07-11 Thread Jim Jewett


Jim Jewett  added the comment:

@Ben Griffin -- Unicode has defined astral characters for a while, but they 
were explicitly intended for rare characters, with any living languages 
intended for the basic plane.  It is only the most recent releases of unicode 
that have broken the "most people won't need this" expectation, so it wasn't 
unreasonable for languages targeting memory-constrained devices to make astral 
support at best a compile-time operation.  

I've seen a draft for an upcoming spec update of an old but still-supported 
language (extended Gerber, for photoplotting machines) that "handles" this 
simply by clarifying that their unicode support is limited to characters < 65K. 
 Given that their use of unicode is essentially limited to comments, and there 
is plenty of hardware that can't be updated ... this is may well be correct.

Python itself does the right thing, and tcl can't do the right thing anyhow 
without font support ... so this may be fixed in less time than it would take 
to replace Tk/Tcl.  If you need a faster workaround, consider a 
private-use-area and private font.

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue39542] Cleanup object.h header

2020-07-11 Thread Jim Jewett


Jim Jewett  added the comment:

Raymond, did you replace the screenshot with a later one showing that things 
are fixed now?  The timestamp suggests it went up at the same time as your 
comment, but what I see in the .png file is that the two are identical other 
than addresses.

--
nosy: +Jim.Jewett

___
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, Pearson's correlation, and simple linear regression

2020-07-11 Thread Tymek Wołodźko

Tymek Wołodźko  added the comment:

Is there anything more I should do about the PR?

Sincerely,
Tim

On Fri, May 22, 2020 at 10:45 PM Cheryl Sabella 
wrote:

>
> Cheryl Sabella  added the comment:
>
> @steven.daprano and @tim.peters, please take a look at the PR as it is
> just waiting on your approval.  Thanks!
>
> --
> nosy: +cheryl.sabella
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue41279] Convert StreamReaderProtocol to a BufferedProtocol

2020-07-11 Thread Tony


Change by Tony :


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

___
Python tracker 

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



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-11 Thread Tony


Change by Tony :


--
pull_requests: +20593
pull_request: https://github.com/python/cpython/pull/21446

___
Python tracker 

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



[issue41266] Wrong hint when class methods and builtins named same

2020-07-11 Thread E. Paine


E. Paine  added the comment:

Both of the following cases give the correct popup help information:

float.hex(

And:

t = type("test_hex", (), {"hex": lambda nothing: None})
t.hex(

The reason your case fails is because IDLE doesn't evaluate `1.3` to a float 
and does indeed use the normal `hex` method help (as you established with your 
`list` test).

--
nosy: +epaine

___
Python tracker 

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



[issue41279] Convert StreamReaderProtocol to a BufferedProtocol

2020-07-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +asyncio
nosy: +asvetlov, yselivanov

___
Python tracker 

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



[issue38556] Walrus operator in list comprehensions [Python 3.8.0]

2020-07-11 Thread Anselm Kiefner


Anselm Kiefner  added the comment:

I just stumbled over this same restriction and when I googled for "SyntaxError: 
cannot assign to named expression", 0 actual results showed - an absolute 
unicorn for a Python error.

> "Due to design constraints in the reference implementation (the symbol table 
> analyser cannot easily detect when names are re-used between the leftmost 
> comprehension iterable expression and the rest of the comprehension), named 
> expressions are disallowed entirely as part of comprehension iterable 
> expressions (the part after each "in", and before any subsequent "if" or 
> "for" keyword):"

Might the new PEG parser maybe help alleviate this restriction, so we could 
declare this a bug instead?

--
nosy: +Anselm Kiefner

___
Python tracker 

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



[issue41279] Convert StreamReaderProtocol to a BufferedProtocol

2020-07-11 Thread Tony


New submission from Tony :

This will greatly increase performance, from my internal tests it was about 
150% on linux.

Using read_into instead of read will make it so we do not allocate a new buffer 
each time data is received.

--
messages: 373526
nosy: tontinton
priority: normal
severity: normal
status: open
title: Convert StreamReaderProtocol to a BufferedProtocol

___
Python tracker 

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



[issue41208] An exploitable segmentation fault in marshal module

2020-07-11 Thread Iman Sharafodin


Iman Sharafodin  added the comment:

Nevertheless, I have an exploitable crash for the Pickle module too right now, 
but  as you're not interested, I didn't open an issue to share it. Thanks 
anyway.

--

___
Python tracker 

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



[issue41278] Wrong Completion on Editing Mode of IDLE

2020-07-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On Windows, with 3.8.4rc1 and 3.8 repository, ^space brings up proper list.  
Give more details.

--

___
Python tracker 

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



[issue41236] "about" button in MacOS caused an error

2020-07-11 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

You're right.  "python3.9 -m tkinter" runs the tkinter widget demo.  And python 
>= About python brings up 'about tkinter' window.  I just deleted 3.7 so I 
cannot easily test.  3.8 works also.

--

___
Python tracker 

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



[issue41136] argparse uses default encoding when read arguments from file

2020-07-11 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 3.0 -> 4.0
pull_requests: +20592
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21444

___
Python tracker 

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



[issue41220] add optional make_key argument to lru_cache

2020-07-11 Thread Itay azolay


Itay azolay  added the comment:

Hey Felipe! Thanks for stepping in!
I do get your argument. 
However, in my opinion, I try to argue the same thing for max or sorted.
"if one wants to use `sorted`, they should make sure their arguments are 
comparable".
However, it is not the case, since we do have the `key` argument for sorted or 
max. 
Also, I don't believe caching equals hashing. 
Maybe from the technical point view, it does, but in reality, One can(and 
probably will) cache unhashable object, whether we give the option to do so or 
not.
I think, embedding the key argument in lru_cache, we allow the 
caller(developer) to solve the caching issue, in a way that is right according 
to his implementation of the cached function and its arguments.

Unrelated, this is my first feature proposal for python. I want to thank you 
for taking the time to think and answer with some very good arguments and 
respect, I truly enjoy this little debate we have here :)

--

___
Python tracker 

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



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-11 Thread Tony


Change by Tony :


--
pull_requests: +20589
pull_request: https://github.com/python/cpython/pull/21442

___
Python tracker 

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



[issue41270] NamedTemporaryFile is not its own iterator.

2020-07-11 Thread Tony


Change by Tony :


--
pull_requests: +20590
pull_request: https://github.com/python/cpython/pull/21442

___
Python tracker 

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



[issue41268] 3.9-dev regression? TypeError: exec_module() missing 1 required positional argument: 'module'

2020-07-11 Thread Hugo van Kemenade


Hugo van Kemenade  added the comment:

Okay, looks like this is actually a setuptools issue, introduced in version 
47.3.2.

Reported: https://github.com/pypa/setuptools/issues/2246

--

___
Python tracker 

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



[issue41210] LZMADecompressor.decompress(FORMAT_RAW) truncate output when input is paticular LZMA+BCJ data

2020-07-11 Thread Hiroshi Miura


Hiroshi Miura  added the comment:

Here is a BCJ only CFFI test project.
https://github.com/miurahr/bcj-cffi

It imports two bcj_x86 C sources, one is from liblzma (src/xz_bcj_x86.c) taht 
is bind with python's lzma module, and the other is from xz-embbed project for 
linux kernel.(src/xz_simple_bcj.c)

We can observe that

1. it has an interface which overwrite buffer
2. it returns good resulted buffer (digest assertion) in both case
3. it returns 4 bytes less size than expected.

for 3, it is because return value  of BCJ is defined such as

```
size -= 4;
for (i = 0; i < size; ++i) {...}
return i;
```
and  variable i sometimes increment 4 bytes when target sequence is found and 
processed.

It may be natural that a size value returned from BCJ filter is often 4 bytes 
smaller than actual.

--

___
Python tracker 

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



[issue41278] Wrong Completion on Editing Mode of IDLE

2020-07-11 Thread Alex


New submission from Alex <2423067...@qq.com>:

When I type (on editing mode, not interacting mode) __main__. + Ctrl+Space, the 
completion window shows 'idlelib'.

--
assignee: terry.reedy
components: IDLE
messages: 373518
nosy: Alex-Python-Programmer, terry.reedy
priority: normal
severity: normal
status: open
title: Wrong Completion on Editing Mode of IDLE
type: behavior
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