[issue40616] Add `asyncio.BufferQueue`
Change by Serge Matveenko : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue40616> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33953] The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module
Change by Serge Matveenko : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue33953> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38701] datetime.timedelta string representation is ambiguous
Change by Serge Matveenko : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue38701> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33953] The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module
Change by Serge Matveenko : -- versions: +Python 3.6 ___ Python tracker <https://bugs.python.org/issue33953> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33953] The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module
Change by Serge Matveenko : -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue33953> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38701] datetime.timedelta string representation is ambiguous
Serge Matveenko added the comment: I would be happy to submit a PR if there would be an agreement on the format. -- ___ Python tracker <https://bugs.python.org/issue38701> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40616] Add `asyncio.BufferQueue`
New submission from Serge Matveenko : It looks handy to be able to leverage `collections.deque` ability to be sized it `asyncio.Queue`. This could provide the ability to implement backpressure in the queue or just use it as a buffer in messaging systems. The implementation provided in the linked PR. -- components: asyncio messages: 368788 nosy: asvetlov, lig, yselivanov priority: normal pull_requests: 19377 severity: normal status: open title: Add `asyncio.BufferQueue` ___ Python tracker <https://bugs.python.org/issue40616> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38701] datetime.timedelta string representation is ambiguous
New submission from Serge Matveenko : Negative `timedelta` string representation is ambiguous. ``` >>> from datetime import datetime, timedelta >>> d2 = datetime.now() >>> d1 = d2 - timedelta(days=42, seconds=5) >>> str(d2 - d1) '42 days, 0:00:05' >>> str(d1 - d2) '-43 days, 23:59:55' ``` I would expect `str(d1 - d2)` to be one of the following: * '-42 days, 0:00:05' * '-(42 days, 0:00:05)' * '- 42 days, 0:00:05' -- components: Library (Lib) messages: 356041 nosy: lig priority: normal severity: normal status: open title: datetime.timedelta string representation is ambiguous type: behavior versions: Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue38701> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33953] The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module
New submission from Serge Matveenko : There is the corresponding section on the topic here https://github.com/python/cpython/blob/3.6/Doc/library/secrets.rst#how-many-bytes-should-tokens-use The current value of 32 bytes is mentioned there correctly. Unfortunately, there is no way to know which constant in the `secrets` stores this value. It is easy to imagine a use case to use say `DEFAULT_ENTROPY * 4` in the code and stay updated with the default entropy being increased over time. Thus, it looks reasonable to document the `secrets.DEFAULT_ENTROPY` constant in the module docs. -- assignee: docs@python components: Documentation messages: 320402 nosy: docs@python, lig priority: normal severity: normal status: open title: The DEFAULT_ENTROPY variable used to store the current default random bytes value should be documented for `secrets` module type: enhancement versions: Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue33953> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25315] OrderedDict mangled private attribute is inaccessible
Serge Matveenko added the comment: Sorry for reopening. I completely agree with the point that is it not necessary for Python and C implementations to duplicate each other. But then the Python OrderedDict implementation should be dropped from the library source. The code that is there now is nothing more than confusing. For some one not aware of C implementation it is very hard to get from documentation that the code she sees via "Go to definition" feature of her IDE is not meant to be executing at all. -- resolution: not a bug -> status: closed -> open ___ Python tracker <http://bugs.python.org/issue25315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25315] OrderedDict mangled private attribute is inaccessible
Serge Matveenko added the comment: Ok, then the OrderedDict is useless for any advanced hacking like altering the order in which __setitem__ stores items. It is just useless Python code and so much appliances missed for this class:( Thank you all for these completely helpful answers. -- ___ Python tracker <http://bugs.python.org/issue25315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25315] OrderedDict mangled private attribute is inaccessible
Serge Matveenko added the comment: If Python source does conform the one in C, it will be completely fine and understandable to have such a change and to rely on it in using version checks or whatever. -- ___ Python tracker <http://bugs.python.org/issue25315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25315] OrderedDict mangled private attribute is inaccessible
Serge Matveenko added the comment: Zach, ok I got your point. But there is Python implementation in the library still which does not conform the one done in C. Such a behavior is tremendously confusing. If there is both Python and C implementation in the library they must conform each other. And there is nothing with "you *really* shouldn't use this" when you need to especially when it is there. If it is there it must work as it written. Otherwise why Python does have this peace of code while it is completely useless as reference? -- resolution: wont fix -> status: closed -> open ___ Python tracker <http://bugs.python.org/issue25315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25315] OrderedDict mangled private attribute is inaccessible
New submission from Serge Matveenko (lig): Consider this code in Python 3.5.0: Python 3.5.0 (default, Sep 26 2015, 14:59:25) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from collections import OrderedDict >>> class MyDict(OrderedDict): ... def __setitem__(self, *args, **kwargs): ... print(self._OrderedDict__root) ... OrderedDict.__setitem__(self, *args, **kwargs) ... >>> md = MyDict({'a': 1}) Traceback (most recent call last): File "", line 1, in File "", line 3, in __setitem__ AttributeError: 'MyDict' object has no attribute '_OrderedDict__root' However in Python 3.4: Python 3.4.2 (default, Jul 9 2015, 17:24:30) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from collections import OrderedDict >>> class MyDict(OrderedDict): ... def __setitem__(self, *args, **kwargs): ... print(self._OrderedDict__root) ... OrderedDict.__setitem__(self, *args, **kwargs) ... >>> md = MyDict({'a': 1}) -- components: Library (Lib) messages: 252296 nosy: Serge Matveenko (lig) priority: normal severity: normal status: open title: OrderedDict mangled private attribute is inaccessible type: behavior versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue25315> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com