[issue45605] Return False from __contains__ method if object not hashable for set and dict

2021-10-25 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

Can you please specify in what cases we need to get an exception instead of 
False? It just seems very strange to me to rely on this behaviour.

--

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



[issue45605] Return False from __contains__ method if object not hashable for set and dict

2021-10-25 Thread Андрей Казанцев

New submission from Андрей Казанцев :

Now if do something like `[] in set()` python raise an exception, but if an 
object isn't hashable then we know for sure that it isn't in the set. Propose 
return False for these cases.

P.S. I would like to make a patch

--
components: Library (Lib)
messages: 404971
nosy: heckad
priority: normal
severity: normal
status: open
title: Return False from __contains__ method if object not hashable for set and 
dict
versions: Python 3.11

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



[issue40816] Add missed AsyncContextDecorator to contextlib

2020-06-18 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

Yury Selivanov, did you see the pull request?

--

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



[issue40888] Add close method to queue

2020-06-09 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

Thank you so much

--

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



[issue40888] Add close method to queue

2020-06-09 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

How to do this?

--
type: enhancement -> 

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



[issue40888] Add close method to queue

2020-06-06 Thread Андрей Казанцев

New submission from Андрей Казанцев :

I have a problem with notifying all current subscribers and new subscribers 
about the closure of the queue and the reason. For example, I have a producer 
that reads messages from websocket or something else and send this to a queue, 
and several consumers (I do not know how many). If any exception occurred, then 
all current subscribers and subscribers which will be added later should know 
about this error. I tried to send an exception to a queue, but that did not 
help, because I have several consumers. Also, this will not protect new 
consumers. I propose to add a new close method with exc argument, which will 
throw an exception when calling the get method, and also throw an exception for 
all current _getters.

--
components: asyncio
messages: 370818
nosy: asvetlov, heckad, yselivanov
priority: normal
severity: normal
status: open
title: Add close method to queue

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



[issue40816] Add missed AsyncContextDecorator to contextlib

2020-06-06 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

No, please look at the pull request.

--

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



[issue40816] Add missed AsyncContextDecorator to contextlib

2020-05-29 Thread Андрей Казанцев

Change by Андрей Казанцев :


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

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



[issue40816] Add missed AsyncContextDecorator to contextlib

2020-05-29 Thread Андрей Казанцев

New submission from Андрей Казанцев :

I can use context manager as decorator but can't use async context manager. 
Seems it because didn't implemented AsyncContextDecorator class

--
components: Library (Lib)
messages: 370317
nosy: heckad
priority: normal
severity: normal
status: open
title: Add missed AsyncContextDecorator to contextlib
versions: Python 3.9

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



[issue39483] Proposial add loop parametr to run in asyncio

2020-01-31 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

Where can I find issue which you are discussing for this thread?

--
resolution: rejected -> 
status: closed -> open

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



[issue39483] Proposial add loop parametr to run in asyncio

2020-01-30 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

@asvetlov, I provided an example where else this useful feature would be. What 
do you think?

--

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



[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

How to make singleton class? I wrote this 

```
import asyncio


class Singleton:
_CREATE_LOCK = asyncio.Lock()

@classmethod
async def create(cls):
if not hasattr(cls, '_Singleton__instance'):
async with cls._CREATE_LOCK:
if not hasattr(cls, '_Singleton__instance'):
await asyncio.sleep(1)
cls.__instance = cls()
return cls.__instance


async def main():
await asyncio.wait([
Singleton.create(),
Singleton.create(),
])


if __name__ == '__main__':
asyncio.run(main())
```

and got `RuntimeError`

--

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



[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

I create the client object in `bot` file. If I import it then it creates loop 
when will import and then when I run it I will get errors attaching to a 
different loop. Another way to use `import` statement in main. This is blocking 
code. What to choose?

--

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



[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев

Change by Андрей Казанцев :


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

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



[issue39483] Proposial add loop parametr to run in asyncio

2020-01-29 Thread Андрей Казанцев

New submission from Андрей Казанцев :

Sometimes need get loop from another place and run corutine in it. For example 
when use teleton lib. Example from this lib 
https://docs.telethon.dev/en/latest/basic/signing-in.html#id2 suggests using 
```client.loop.run_until_complete``` but it's not handle errors like in run 
method.

--
components: asyncio
messages: 360957
nosy: asvetlov, heckad, yselivanov
priority: normal
severity: normal
status: open
title: Proposial add loop parametr to run in asyncio
versions: Python 3.9

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



[issue37333] Fail build on windows 10(visual studio 2019)

2019-06-18 Thread Андрей Казанцев

New submission from Андрей Казанцев :

Error   MSB4113 Specified condition "$(IncludeTkinter)" evaluates to "" instead 
of a boolean.   python  cpython\PCbuild\python.vcxproj  156

It is the master branch (id: 0a28f8d379544eee897979da0ce99f0b449b49dd)

--
components: Build
messages: 346019
nosy: heckad
priority: normal
severity: normal
status: open
title: Fail build on windows 10(visual studio 2019)
versions: Python 3.9

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



[issue36670] test suite broken due to cpu usage feature on win 10/ german

2019-06-02 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

I have the same problem in Russian locale.
Adding "oem" encoding in the decode method solve problem with decoding but got:
File 
"C:\Users\User\Documents\Projects\cpython\lib\test\libregrtest\win_utils.py", 
line 98, in getloadavg
load = float(toks[1].replace('"', ''))
ValueError: could not convert string to float

In typeperf_output text with description of the error:
'\r\nВыполняется выход, подождите... \r\nОшибка: 
Счетчики не указаны.\r\n\r\r'
Translation on English is "Exiting, wait... Error: Counters are not specified."

Is it possible to check if the counters are found in advance?

--
nosy: +heckad

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



[issue37133] Erro "ffi.h: No such file" when build python 3.8 (branch master) on windows 10

2019-06-02 Thread Андрей Казанцев

Андрей Казанцев  added the comment:

No, I used https://devguide.python.org/setup/ guide. I have downloaded the 
latest version of Visual Studio 2019 and evaluated in PowerShell 
"PCBuild\build.bat". After this, I opened "PCBuild\pcbuild.sln" and trying to 
build "python" solution and run it. Instead of successful build, the build 
broked.

--

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



[issue37133] Erro "ffi.h: No such file" when build python 3.8 (branch master) on windows 10

2019-06-02 Thread Андрей Казанцев

New submission from Андрей Казанцев :

Where to get "ffi.h" file?

--
components: Build
messages: 344287
nosy: heckad
priority: normal
severity: normal
status: open
title: Erro "ffi.h: No such file" when build python 3.8 (branch master) on 
windows 10
versions: Python 3.8

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



[issue36319] Erro 0xC0000374 on windows 10

2019-03-16 Thread Андрей Казанцев

New submission from Андрей Казанцев :

On windows 10 python falls after evaluate this code
```
import time
import locale

locale.setlocale(locale.LC_ALL, 'Russian_Russia.utf8')
time.localtime(1552753806.2363703)
```

What tools would you recommend for getting more information?

--
components: Windows
files: Снимок.PNG
messages: 338093
nosy: paul.moore, steve.dower, tim.golden, zach.ware, Андрей Казанцев
priority: normal
severity: normal
status: open
title: Erro 0xC374 on windows 10
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48212/Снимок.PNG

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