[issue38904] "signal only works in main thread" in main thread

2019-11-23 Thread Richard Warfield


Richard Warfield  added the comment:

I should mention, this behavior is new in 3.8.0.  It did not occur in 3.7.x.

--

___
Python tracker 

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



[issue38904] "signal only works in main thread" in main thread

2019-11-23 Thread Richard Warfield


New submission from Richard Warfield :

I have an application (https://github.com/litxio/ptghci) using embedded Python, 
which needs to set a signal handler (and use the prompt-toolkit library which 
itself sets signal handlers).

My call to signal.signal is guarded by a check that we're running in the main 
thread:

if threading.current_thread() is threading.main_thread():
print (threading.current_thread().name)
signal.signal(signal.SIGINT, int_handler)

And the above indeed prints "MainThread".  But this raises an exception:

  File "app.py", line 45, in __init__
signal.signal(signal.SIGINT, int_handler)
  File "/usr/lib/python3.8/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread

This seems like something that should not happen.  

Now, I tried to generate a simple replicating example but thus far haven't been 
able to do so -- simply calling signal.signal from PyRun_SimpleString doesn't 
do the trick, even within a pthreads thread.

--
messages: 357390
nosy: Richard Warfield
priority: normal
severity: normal
status: open
title: "signal only works in main thread" in main thread
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



[issue2504] Add gettext.pgettext() and variants support

2019-11-23 Thread Eli Schwartz


Eli Schwartz  added the comment:

Interestingly enough, the final accepted patch (and the 2010 one) also fixes a 
bug where gettext.install(..., names='ngettext') would incorrectly work, in 
violation of the documentation.

I think it would also incorrectly install 'gettext', too...

It used to just check if names.__contains__ is a valid attribute, then check if 
'foo' in names, so a dumb string "worked" and even matched more things than it 
should have.

How I discovered this: I fixed a bug in a python project that stopped working 
on python 3.8, and had a bit of a head-scratch regarding how it ever worked to 
begin with: https://github.com/linuxmint/cinnamon/pull/8964

--
nosy: +eschwartz

___
Python tracker 

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



[issue38901] Add a CLI flag to venv to use the pwd basename as the prompt

2019-11-23 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



[issue36682] duplicate method definitions in Lib/test/test_sys_setprofile.py

2019-11-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +16852
pull_request: https://github.com/python/cpython/pull/17366

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

patchcheck.py removes even a single newline if that is all that remains after 
stripping each line.  So the revised rule is that a file should be either empty 
or end with a non-whitespace followed by a newline.  My intent is that a file 
be ready to merge to out github python/cpython repository.

--

___
Python tracker 

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



[issue38862] IDLE: Include end newlines in whitespace fix.

2019-11-23 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +16851
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/17366

___
Python tracker 

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



[issue38903] #if 0 block on parsetok.c

2019-11-23 Thread Emmanuel Arias


Change by Emmanuel Arias :


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

___
Python tracker 

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



[issue38903] #if 0 block on parsetok.c

2019-11-23 Thread Emmanuel Arias


New submission from Emmanuel Arias :

Hi, 

I can see that on parsetok.c there is the next block:

```
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
#if 0
static const char with_msg[] =
"%s:%d: Warning: 'with' will become a reserved keyword in Python 2.6\n";

static const char as_msg[] =
"%s:%d: Warning: 'as' will become a reserved keyword in Python 2.6\n";

static void
warn(const char *msg, const char *filename, int lineno)
{
if (filename == NULL)
filename = "";
PySys_WriteStderr(msg, filename, lineno);
}
#endif
#endif
```
I think that the #if 0 block can be remove safely, right?

I don't know if the #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD we can remove.

--
messages: 357387
nosy: eamanu
priority: normal
severity: normal
status: open
title: #if 0 block on parsetok.c
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



[issue38902] image/webp support in mimetypes

2019-11-23 Thread Lee Ball


New submission from Lee Ball :

WebP is currently missing from the list of supported mimetypes.

It's an open source image format, using VP8 or VP8L for image data and RIFF for 
containers.

Previously, adding webp support was considered in 2011, but wasn't well 
supported at the time: ( https://bugs.python.org/issue11362 ). In 2019, WebP 
now enjoys support in major browsers and OSes. Its sister video format WebM was 
added to mimetypes in 2016 ( https://bugs.python.org/issue16329 ) and has 
similar support to WebP.

WebP homepage: https://developers.google.com/speed/webp
WebP source: https://chromium.googlesource.com/webm/libwebp/
RIFF container spec: 
https://developers.google.com/speed/webp/docs/riff_container
VP8 format spec: https://datatracker.ietf.org/doc/rfc6386/

--
components: Library (Lib)
messages: 357386
nosy: leecatball
priority: normal
severity: normal
status: open
title: image/webp support in mimetypes
type: enhancement
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



[issue38901] Add a CLI flag to venv to use the pwd basename as the prompt

2019-11-23 Thread Brett Cannon


New submission from Brett Cannon :

I did a Twitter poll to see if there was consistent naming of the directory 
people created a virtual environment into when done locally to code (the answer 
is no). But a common theme was people not liking that the prompt defaults to 
the name of the directory that the virtual environment is in and seem to prefer 
for it to be `os.path.basename(os.getcwd())`.

Maybe it makes sense to add a `--basename-prompt` flag to set the prompt to the 
current working directory's basename?

--
components: Library (Lib)
messages: 357385
nosy: brett.cannon, vinay.sajip
priority: low
severity: normal
status: open
title: Add a CLI flag to venv to use the pwd basename as the prompt
type: enhancement

___
Python tracker 

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



[issue38899] Document that virtual environment activation for fish should use `source`

2019-11-23 Thread Brett Cannon


Change by Brett Cannon :


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



[issue38871] lib2to3 generates invalid code with filter and ternary operator

2019-11-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

Dear core developers,

I 'd like to discuss fixing this issue.
IMHO, There are 2 options to fix this issue.

1. Add parenthesize when creating ListComp.
The change will be as follow:
 new = ListComp(results.get("fp").clone(),
results.get("fp").clone(),
results.get("it").clone(),
-   results.get("xp").clone())
+   parenthesize(results.get("xp").clone()))

But generated codes are not pretty.

2. Transform the lambda function as same as a normal function.
The only needed is removing lambda specific logics on fixer.

The generated code will be like this in this case.
x = filter(lambda x: True if x > 2 else False, data)
x = list(filter(lambda x: True if x > 2 else False, data))

Personally, I prefer the 2nd option because it's more clear.
If the proposal is accepted, I 'd like to fix this issue. 

If there are any ideas, please let me know.
Thank you always!

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-11-23 Thread Paul Moore


Paul Moore  added the comment:

Thanks for the clarification, Nick. Yes, I agree that the basic "this is the 
tag that matches this precise CPython installation" is not the difficult part 
of the problem here, and if that is all that this issue is targeting, there 
should be no major problem.

My understanding was that Michael wanted to address the other part of the 
issue, that installers would somehow need to encapsulate the question of what 
binaries were compatible with what installations, and that, as you say, is a 
*much* murkier question.

If you're comfortable that the two aspects can be cleanly separated (and 
ideally that the second can be avoided altogether) then I'm much happier.

--

___
Python tracker 

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



[issue38895] performance degradation creating a mock object (by factor 7-8)

2019-11-23 Thread Marcel Zięba

Marcel Zięba  added the comment:

This is the first commit I've observed slow down:

77b3b7701a34ecf6316469e05b79bb91de2addfa

Especially this part looks suspicious
https://github.com/python/cpython/commit/77b3b7701a34ecf6316469e05b79bb91de2addfa#diff-ff75b1b83c21770847ade91fa5bb2525R366

--

___
Python tracker 

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



[issue38483] [venv] Add ~/.venvrc to change module defaults

2019-11-23 Thread Cooper Lees


Change by Cooper Lees :


--
resolution:  -> rejected
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



[issue37334] Add a cancel method to asyncio Queues

2019-11-23 Thread Martin Teichmann


Martin Teichmann  added the comment:

I do not think that exposing the lists of futures does any good. I cannot come 
up with a semantics that could be implemented with that other than the one 
proposed.
Also I think that close() or cancel() is something a reader intuitively 
understands, while looping over a list of futures is not immediately obvious.

--

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-11-23 Thread Nick Coghlan


Nick Coghlan  added the comment:

For folks that aren't aware, Michael and I have been discussing the AIX package 
tagging problem via email since his initial distutils-sig posts about it.

It's genuinely murky as fixing the AIX problem doesn't *technically* require 
any PEP 425 changes, as the main problem with the status quo is in the way the 
platform string is calculated, rather than in the way that then gets 
incorporated into a PEP 425 compatibility tag.

I think the subtlety I may not have cconveyed clearly though is that installers 
only do exact string matches on platform tags, working through a set of 
increasingly less specific candidates.

So if the goal is the same model that we use for Windows and Mac OS X, where 
the Python interpreter build defines the exact platform string that packages 
need to use, then all that's needed is the new platform string logic. That then 
places constraints on how AIX extension modules are built, but doesn't require 
a new PEP for installer logic changes. I think this is a good level of support 
to target.

There's then a further option that *would* require a new PEP: teaching 
installers to be more permissive in the compatibility tags they accept for AIX, 
based on the AIX ABI compatibility guidelines. I *don't* think that's a good 
idea - better to deal with that on the publication side, the way it is done for 
Windows and Mac OS X extensions.

--

___
Python tracker 

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



[issue38524] functools.cached_property is not supported for setattr

2019-11-23 Thread Florian Dahlitz


Change by Florian Dahlitz :


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

___
Python tracker 

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



[issue38895] performance degradation creating a mock object (by factor 7-8)

2019-11-23 Thread Marcel Zięba

Marcel Zięba  added the comment:

I've also tested it and can confirm it.

Master branch:
raw times: 8.43 sec, 7.26 sec, 8.16 sec, 8.4 sec, 7.31 sec  




  
10 loops, best of 5: 72.6 usec per loop

v3.8.0:
raw times: 13.6 sec, 11.9 sec, 11.6 sec, 11.7 sec, 12.3 sec 




  
10 loops, best of 5: 116 usec per loop 

v3.7.4:
raw times: 2.55 sec, 1.9 sec, 2.7 sec, 2.42 sec, 2.17 sec   




  
10 loops, best of 5: 19 usec per loop

--
nosy: +marseel
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



[issue37224] test__xxsubinterpreters fails randomly

2019-11-23 Thread Kyle Stanley


Kyle Stanley  added the comment:

> So, I was finally able to replicate a failure in test_still_running locally, 
> it required using a rather ridiculous number of parallel workers

I forgot to mention that I was able to replicate the above failure on the 
latest commit to the 3.8 branch. I was _unable_ to replicate the failure on the 
latest commit to master, even when scaling up the number of parallel workers 
(the max I tested was 300 workers and ~3k iterations of 
test__xxsubinterpreters).

--

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2019-11-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

I support Antoine's proposal.
Let's remove the suspicious option if we cannot handle it correctly in a 
secured manner.
If people still want to use SO_REUSEADDR they can apply it manually, old good 
transp.get_extra_info("socket") is still available.

--

___
Python tracker 

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



[issue37334] Add a cancel method to asyncio Queues

2019-11-23 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Lists of producers/consumers are just lists of future objects.

I don't think that we need to expose futures in high-level public API.

--

___
Python tracker 

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



[issue21063] Touch up one-line descriptions of modules for module index

2019-11-23 Thread Sanchit Khurana


Change by Sanchit Khurana :


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

___
Python tracker 

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



[issue38898] Tkinter checkbutton switch on and off together

2019-11-23 Thread zaza hohonini


zaza hohonini  added the comment:

Hello,

I have done a bit of digging and found out that this behavior appeared in 
python version 3.6.0 alpha2. I think it is related to bpo-27025 
(https://bugs.python.org/issue27025) that changed the way that widgets are 
named. It is my impression that the code that determines which checkbutton 
should have its appearance changed has not been changed accordingly. 

I also observe that if I use variable=tk.IntVar() as additional argument to 
tk.Checkbutton, normal behavior is restored. This is the easiest work around.

--
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue38900] Add a glossary entry for "callable" objects

2019-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I suggest linking to the built-in callable() function:  
https://docs.python.org/3/library/functions.html#callable

--
resolution:  -> rejected
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



[issue38881] unexpected behaviour of random.choices with zero weights

2019-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestions.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue38881] unexpected behaviour of random.choices with zero weights

2019-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 041d8b48a2e59fa642b2c5124d78086baf74e339 by Raymond Hettinger in 
branch 'master':
bpo-38881: choices() raises ValueError when all weights are zero (GH-17362)
https://github.com/python/cpython/commit/041d8b48a2e59fa642b2c5124d78086baf74e339


--

___
Python tracker 

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



[issue38900] Add a glossary entry for "callable" objects

2019-11-23 Thread Delgan


Delgan  added the comment:

I agree, it's straightforward. I just thought it could be useful to have a 
proper definition in the official documentation.

For example, this question on StackOverflow actually received many views: 
https://stackoverflow.com/questions/111234/what-is-a-callable

What do you think is the best documentation entry I can link to while 
mentioning a "callable" type? Just the builtin "callable()"? The 
`collections.abc.Callable` is interesting but does not look very appropriate 
for basic functions.

--

___
Python tracker 

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



[issue38881] unexpected behaviour of random.choices with zero weights

2019-11-23 Thread Mark Dickinson


Mark Dickinson  added the comment:

Either raising, or treating a zero-weight-sum as undefined behaviour and 
documenting that the sum of the weights should be positive sounds fine to me.

-1 on the suggestion to (deliberately, by documented design) choose at random 
in this case. Mathematically, this situation doesn't make sense: as Tim said, 
it's analogous to choosing from an empty population.

Ex: you have `nred` red balls and `nblue` blue balls in a bag. If you want to 
simulate drawing a single ball from the bag, then

   random.choices(["red", "blue"], [nred, nblue])

does the job. But in the case where `nred = nblue = 0`, the bag is empty and 
it's not possible to draw anything; in that case I'd expect an error. I 
definitely wouldn't expect to get either a red ball or a blue ball (with equal 
probability).

--

___
Python tracker 

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



[issue38889] Segmentation fault when using EPF Importer

2019-11-23 Thread Sebastian Szwarc


Sebastian Szwarc  added the comment:

If someone really want to test
The test procedure should be as follows:

Get the EPFImporter tool
https://affiliate.itunes.apple.com/resources/documentation/epfimporter/
Set up your database and put relevant login information in EPFConfig
Get the simple minimal dump from here -
https://drive.google.com/file/d/1s1VmE-7NGsUoiBjvBQ1iaalUjYSNPh9w/view?usp=sharing
try to import EPFImport.py full/*

these are only things I can provide at the moment,hope this helps
explaining a little more.

On Fri, Nov 22, 2019 at 10:26 PM Sebastian Szwarc
 wrote:
>
>
> Sebastian Szwarc  added the comment:
>
> I strongly disagree. Python 2.7 is 2.7 -> if some new errors appeared
> after upgrading between minor version this is not expected behaviour,
> and therefore it means there is error in interpreter itself.
> upgrading from 2.7 to 2.7 is not the same as upgrading from swift 3 to swift 
> 4.
>
> And as I said in another comment - I dont understand your tendency to
> "minimal example" - minimal example solves nothing because minimal !=
> production.
> On production there is of course 3rd party code - tool is written by
> Apple and MysqlDB module by another 3rd party vendor. How can you even
> expect to provide minimal example in such case?
>
> Not to mention I got no errors in code - just SEGMENTATION FAULT which
> indicates python interpreter after upgrade doing something very bad in
> memory management ---> this is python issue.
> Or give me solution to install specific version of 2.7 that was
> available one year ago on Ubuntu.
>
> On Fri, Nov 22, 2019 at 1:22 AM Eric V. Smith  wrote:
> >
> >
> > Eric V. Smith  added the comment:
> >
> > I agree this doesn't look like a python bug.
> >
> > However, if the original poster can reproduce it with a short example with 
> > no third party code, we could take another look. If so, please re-open this 
> > issue.
> >
> > And just because the code worked on a different version of python doesn't 
> > mean there's no bug in the code. I've written plenty of code where errors 
> > were exposed in my code when updating python.
> >
> > --
> > nosy: +eric.smith
> > resolution:  -> third party
> > stage:  -> resolved
> > status: open -> closed
> >
> > ___
> > 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



[issue38900] Add a glossary entry for "callable" objects

2019-11-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

-1 I don't think this would be an improvement.  We already have a builtin 
callable() function documented, and we have the documented Callable() abstract 
base class, and the __call__ method is documented in the library reference.  I 
don't we need yet another entry describing a straight-forward concept.  Also I 
don't think we should litter the rest of docs with a link to a term-callable 
everytime we use the wordl.

--
nosy: +rhettinger

___
Python tracker 

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



[issue38878] os.PathLike subclasshook causes subclass checks true on abstract implementation

2019-11-23 Thread Bar Harel


Bar Harel  added the comment:

A better example is this:

class A(PathLike):
def foo(self):
"""For all your foo needs"""

class B:
def __fspath__(self):
pass

issubclass(B, A) == True
A().foo() # Yay, I Foo'd.
B().foo() # oh barnacles, I should have stayed at home.

--

___
Python tracker 

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



[issue38900] Add a glossary entry for "callable" objects

2019-11-23 Thread Delgan


New submission from Delgan :

Hi.

Quick use case explanation about this: I would like to document my function, 
stating that it accepts any "callable" object and linking to a proper 
definition of such object.

For example, I'm already doing this when my function accepts a "file object". 
There exists no such type I can link to, so I link to the glossary definition: 
https://docs.python.org/3/glossary.html#term-file-object

I could link to the "callable()" built-in but than does not reflect well the 
expected *type* of the argument. For now, I define the argument as a "function" 
( https://docs.python.org/3/glossary.html#term-function ) but this is too 
restrictive.

The definition for "callable" would be pretty straightforward, just mentioning 
it should implement "__call__", also linking to "emulating callable object" ( 
https://docs.python.org/3/reference/datamodel.html#emulating-callable-objects ) 
and / or the "callable()" builtin ( 
https://docs.python.org/3/library/functions.html#callable ).

--
assignee: docs@python
components: Documentation
messages: 357366
nosy: Delgan, docs@python
priority: normal
severity: normal
status: open
title: Add a glossary entry for "callable" objects
versions: Python 3.5, Python 3.6, 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



[issue37224] test__xxsubinterpreters fails randomly

2019-11-23 Thread Kyle Stanley


Kyle Stanley  added the comment:

> I was able to consistently reproduce the above failure using 200 parallel 
> workers, even without `-f`. 

Oops, I didn't mean without passing `-F`, as this would result in only a single 
test being ran. I meant without letting it repeat multiple times, as in the 
test failure would consistently occur in the first batch of 200 parallel 
workers.

--

___
Python tracker 

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