[issue38933] unusual behaviour on list of dependable lambdas

2019-11-27 Thread Alexey Burdin


New submission from Alexey Burdin :

>>> x=[2,3]
>>> [f(x) for f in [(lambda a:a[i]) for i in [0,1]]]
[3, 3]
>>> [f(x) for f in [lambda a:a[0],lambda a:a[1]]]
[2, 3]

--
components: Interpreter Core
messages: 357586
nosy: Alexey Burdin
priority: normal
severity: normal
status: open
title: unusual behaviour on list of dependable lambdas
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

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



[issue38933] unusual behaviour on list of dependable lambdas

2019-11-27 Thread Alexey Burdin


Alexey Burdin  added the comment:

x=[2,3]
[f(x) for f in [(lambda a:a[i]) for i in [0,1]]]
#the expected output is [2,3] but actual is [3,3]
[f(x) for f in [lambda a:a[0],lambda a:a[1]]]
#results [2,3] normally

--

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



[issue41388] IDLE fails to detect corresponding opening parenthesis

2020-07-24 Thread Alexey Burdin


New submission from Alexey Burdin :

```
answers_field_order=sorted(
set(j for i in data['items'] for j in i),
key=cmp_to_key(lambda x,y:(
-1 if (x,y) in answer_order 
else (0 if x==y else 1)))
)
```
when the cursor is placed in line 5 col 31 (between `)` and `))` ) hitting 
Ctrl-0 (Show surrounding parens) produces an error sound, though there's no 
error, the script works fine.

```
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:Ubuntu 18.04.4 LTS
Release:18.04
Codename:   bionic
$ uname -a
Linux odd-one 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 
x86_64 x86_64 x86_64 GNU/Linux
$ python3.8
Python 3.8.0 (default, Oct 28 2019, 16:14:01) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>> importlib.util.find_spec('idlelib.pyshell')
ModuleSpec(name='idlelib.pyshell', 
loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f1ea8ee14c0>, 
origin='/usr/lib/python3.8/idlelib/pyshell.py')
>>> exit()
$ dpkg-query -S /usr/lib/python3.8/idlelib/pyshell.py
idle-python3.8: /usr/lib/python3.8/idlelib/pyshell.py
$ dpkg -l | grep idle-python3\.8
ii  idle-python3.8 3.8.0-3~18.04
all  IDE for Python (v3.8) using Tkinter
```

--
assignee: terry.reedy
components: IDLE
messages: 374205
nosy: Alexey Burdin, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE fails to detect corresponding opening parenthesis
type: behavior
versions: Python 3.8

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