[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2021-12-20 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

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



[issue29595] Expose max_queue_size in ThreadPoolExecutor

2021-10-14 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

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



[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2021-10-13 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

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



[issue39645] Expand concurrent.futures.Future's public API

2020-04-23 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

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



[issue11588] Add "necessarily inclusive" groups to argparse

2019-11-06 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

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



[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-07-17 Thread Jack Wong


Change by Jack Wong :


--
nosy: +iforapsy

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-07-11 Thread Jack Wong


Jack Wong  added the comment:

Thanks, Karthikeyan! I applied your change to Lib/unittest/mock.py, and it 
fixed the bug for me. I confirmed that calls to the child mock now appear in 
the parent's mock_calls in my test suite. Your PR looks good to me.

--

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-07-09 Thread Jack Wong


Jack Wong  added the comment:

Can we reopen this bug? Karthikeyan's PR works for Dmitry's toy example, but it 
does not work in the usual case where patch() and attach_mock() are used. I 
encountered this bug on Python 3.7.3, which includes the PR.

Non-toy example:
import unittest.mock as mock

def foo():
pass

parent = mock.Mock()

with mock.patch('__main__.foo', autospec=True) as mock_foo:
parent.attach_mock(mock_foo, 'child')
parent.child()
print(parent.mock_calls)

Actual output:
[]

Expected output:
[call.child()]

The reason why Karthikeyan's PR works on the toy example is that that mock's 
name is not set. In the usual case, the function mock's name will be set so 
this "if" block in _check_and_set_parent will return immediately.
if ((value._mock_name or value._mock_new_name) or
(value._mock_parent is not None) or
(value._mock_new_parent is not None)):
return False

I think a possible fix is to move the inner mock extraction out to the 
attach_mock function as that function contains code to clear the mock's parent 
and name attributes. Downside is that that would make it fail on Dmitry's toy 
example.

--
nosy: +iforapsy

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