[issue25452] Add __bool__() method to subprocess.CompletedProcess

2015-10-22 Thread Richard Neumann
Richard Neumann added the comment: A useless use case is attached. Basically it boils down to having the ability to evaluate the CompletedProcess directly by if/else rather than comparing its returncode attribute to zero each time or handling the exception raised by check_returncode(). I use

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2015-10-21 Thread Richard Neumann
New submission from Richard Neumann: The class subprocess.CompletedProcess is currently lacking a __bool__() method. It might be a practical feature to have the possibility to evaluate a CompletedProcess instance in an if/else block without the necessity to handle the exception raised

[issue26999] Add child seperator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-11 Thread Richard Neumann
New submission from Richard Neumann: Currently Python's logging library has the Child-Separator hard-coded in Logger.getChild() as '.'. It would be useful to have the ability to preset this via an optional basicConfig() argument like 'child_sep=' and preset it to '.' to retain the current

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-11 Thread Richard Neumann
Changes by Richard Neumann <r.neum...@homeinfo.de>: -- title: Add child seperator keyword to logging.basicConfig and use it in Logger.getChild() -> Add child separator keyword to logging.basicConfig and use it in Logger.getChild() _

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Please excuse my ambiguous phrasing. What I meant was I created the patch _from_ the Python 3.5.1 module _for_ Python 3.6. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Thank you for the hint. I never before contributed code to the python foundation and thus am not familiar with the process. I will look into it when I find the time. -- ___ Python tracker <rep...@bugs.python.

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: I am using loggers and sub-loggers (getChild()) in classes, which contain sub-classes, wich contain sub-sub-classes and so on for complex data processing. Hence I was using the logging library with sub-loggers to see in which of the (sub-)classes things

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: PS: @vinay.sajip You do realize that I want this argument to be optional and to retain '.' as default setting in order to keep the current behaviour?! -- ___ Python tracker <rep...@bugs.python.org>

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Changes by Richard Neumann <r.neum...@homeinfo.de>: Removed file: http://bugs.python.org/file42825/logger.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: Added proposed patch -- keywords: +patch Added file: http://bugs.python.org/file42825/logger.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26999] Add child separator keyword to logging.basicConfig and use it in Logger.getChild()

2016-05-12 Thread Richard Neumann
Changes by Richard Neumann <r.neum...@homeinfo.de>: Added file: http://bugs.python.org/file42827/logger.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2016-05-12 Thread Richard Neumann
Richard Neumann added the comment: I took the liberty to create a patch for Python v3.5.1. -- keywords: +patch nosy: +Richard Neumann Added file: http://bugs.python.org/file42828/subprocess.patch ___ Python tracker <rep...@bugs.python.org>

[issue31992] Make iteration over dict_items yield namedtuples

2017-11-10 Thread Richard Neumann
Richard Neumann <r.neum...@homeinfo.de> added the comment: Maybe there is no need to sacrifice performance, if a new, optional keyword argument would be introduced to dict.items(): def items(self, named=False): if named: else: Currently

[issue31992] Make iteration over dict_items yield namedtuples

2017-11-09 Thread Richard Neumann
New submission from Richard Neumann <r.neum...@homeinfo.de>: Currently, iterating over dict_items will yield plain tuples, where the first item will be the key and the second item will be the respective value. This has some disadvantages when e.g. sorting dict items by value and key:

[issue32664] Connector "|" missing between ImportError and LookupError

2018-01-25 Thread Richard Neumann
New submission from Richard Neumann <r.neum...@homeinfo.de>: In the documentation of the built-in exceptions hierarchy, there is a "|" missing connecting ImportError and LookupError. https://docs.python.org/3/library/exceptions.html#exception-hierarchy >From LookupError.

[issue33028] tempfile.TemporaryDirectory incorrectly documented

2018-03-08 Thread Richard Neumann
New submission from Richard Neumann <r.neum...@homeinfo.de>: The tempfile.TemporaryDirectory is incorrectly documented at https://docs.python.org/3.6/library/tempfile.html#tempfile.TemporaryDirectory. It is described as a function, though actually being a class (u

[issue34732] uuid returns version more than 5

2018-09-19 Thread Richard Neumann
Richard Neumann added the comment: Typos: "For explicitely checking the version" → "For explicitely *setting* the version". "on not 1<= verision 1<=5" → "on not 1 <= version <= 5". -- ___

[issue31958] UUID versions are not validated to lie in the documented range

2018-09-19 Thread Richard Neumann
Richard Neumann added the comment: @xtreak Indeed. It fails on _windll_getnode(). == ERROR: test_windll_getnode (test.test_uuid.TestInternalsWithoutExtModule

[issue34732] uuid returns version more than 5

2018-09-19 Thread Richard Neumann
Richard Neumann added the comment: @xtreak RFC 4122, section 4.1.3. specifies only versions 1 to 5. For explicitely checking the version, there is already a test in UUID.__init__, raising a ValueError on not 1<= verision 1<=5. I moved it to the bottom of __init__, i.e. after setting th

[issue34732] uuid returns version more than 5

2018-09-20 Thread Richard Neumann
Richard Neumann added the comment: I updated my pull request. Since "_windll_getnode()" is only returning a (random?) node for a UUID, I circumevented the value checking by introducing a new keyword-only argument "strict" defaulting to "True&qu

[issue34732] uuid returns version more than 5

2018-09-19 Thread Richard Neumann
Richard Neumann added the comment: I'm not sure whether the property method should be changed. I think it'd be more appropriate to raise a value error upon __init__ in this case as it is done with other checks. -- nosy: +conqp ___ Python tracker

[issue37113] 'ß'.upper() should return 'ẞ'

2019-05-31 Thread Richard Neumann
Richard Neumann added the comment: See also: https://en.wikipedia.org/wiki/Capital_%E1%BA%9E -- ___ Python tracker <https://bugs.python.org/issue37113> ___ ___

[issue37113] 'ß'.upper() should return 'ẞ'

2019-05-31 Thread Richard Neumann
New submission from Richard Neumann : Currently, calling the method .upper() on a string containing 'ß' will replace this character by 'SS'. It should, however, be replaced by 'ẞ'. -- components: Unicode messages: 344065 nosy: Richard Neumann, ezio.melotti, vstinner priority: normal

[issue40054] Allow formatted strings as docstrings

2020-03-24 Thread Richard Neumann
New submission from Richard Neumann : Currently only plain strings can be used as docstrings, such as: class Foo: """Spamm eggs.""" For dynamic class generation, it would be useful to allow format strings as docstrings as well: doc = 'eggs'

[issue41795] Allow assignment in yield statement

2020-09-16 Thread Richard Neumann
New submission from Richard Neumann : I often write factory (deserialization) methods for ORM models for web application backends that produce a number of records (ORM model instances) of itself and related database tables: @classmethod def from_json(cls, json): "&qu

[issue41795] Allow assignment in yield statement

2020-09-16 Thread Richard Neumann
Richard Neumann added the comment: Awesome, I didn't know that. I tried it without the parens and it gave me a SyntaxError. This can be closed then as it's obviously already implemented. Let's get to refactoring. -- ___ Python tracker <ht

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Richard Neumann
New submission from Richard Neumann : I have use cases in which I use named tuples to represent data sets, e.g: class BasicStats(NamedTuple): """Basic statistics response packet.""" type: Type session_id: BigEndianSignedInt32 motd: str

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
New submission from Richard Neumann : When sublassing the built-in list, the invocation of super().__new__ will unexpectedly expand the passed arguments: class MyTuple(tuple): def __new__(cls, *items): print(cls, items) return super().__new__(cls, items) class MyList

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
Richard Neumann added the comment: I could have sworn, that this worked before, but it was obviously me being tired at the end of the work day. Thanks for pointing this out and sorry for the noise. -- ___ Python tracker <https://bugs.python.

[issue41629] __class__ not set defining 'X' as

2021-01-06 Thread Richard Neumann
Richard Neumann added the comment: I just stumbled across this issue trying to resolve this: https://bugs.python.org/issue42765? While this fails: from typing import NamedTuple class Spamm(NamedTuple): foo: int bar: str def __getitem__(self, index_or_key): "&quo

[issue42765] Introduce new data model method __iter_items__

2021-01-06 Thread Richard Neumann
Richard Neumann added the comment: Okay, I found the solution. Not using super() works: from typing import NamedTuple class Spamm(NamedTuple): foo: int bar: str def __getitem__(self, index_or_key): if isinstance(index_or_key, str): try

[issue42765] Introduce new data model method __iter_items__

2021-01-06 Thread Richard Neumann
Richard Neumann added the comment: Thank you all for your input. I had a look at aforementioned discussion and learned something new. So I tried to implement the dict data model by implementing keys() and __getitem__() accordingly: from typing import NamedTuple class Spamm(NamedTuple