[issue29964] [doc] %z directive has no effect on the output of time.strptime

2022-01-14 Thread Paul Pinterits
Change by Paul Pinterits : -- nosy: -Paul Pinterits ___ Python tracker <https://bugs.python.org/issue29964> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Paul Pinterits
Paul Pinterits added the comment: You're telling me that some people out there rely on their custom __init__ *not* being called? O.o -- ___ Python tracker <https://bugs.python.org/issue43

[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Paul Pinterits
Paul Pinterits added the comment: Admittedly, with the way dataclasses accept their __init__ arguments, figuring out which arguments to consume and which to pass on isn't a trivial task. If a dataclass Bar inherits from a dataclass Foo, then Bar.__init__ is (for all intents and purposes

[issue43835] Dataclasses don't call base class __init__

2021-04-14 Thread Paul Pinterits
Paul Pinterits added the comment: No, I'm saying Bar should initialize the 'bar' attribute, and then call Foo.__init__ to let it initialize the 'foo' attribute. -- ___ Python tracker <https://bugs.python.org/issue43

[issue43835] Dataclasses don't call base class __init__

2021-04-13 Thread Paul Pinterits
Paul Pinterits added the comment: > dataclasses doesn't know the signature of the base class's __init__, so it > can't know how to call it. The dataclass doesn't need to know what arguments the parent __init__ accepts. It should consume the arguments it needs to initialize its in

[issue43835] Dataclasses don't call base class __init__

2021-04-13 Thread Paul Pinterits
New submission from Paul Pinterits : It's documented behavior that @dataclass won't generate an __init__ method if the class already defines one. It's also documented that a dataclass may inherit from another dataclass. But what happens if you inherit from a dataclass that implements

[issue34541] pathlib.Path.iterdir doesn't throw an exception until you start iterating

2018-08-29 Thread Paul Pinterits
Paul Pinterits added the comment: As an afterthought, I'd like to suggest an alternative solution: If changing the `iterdir` behavior is not possible or not desirable for some reason, please add a `Path.listdir` method that returns a list instead of an iterator. Lazy file system operations

[issue34541] pathlib.Path.iterdir doesn't throw an exception until you start iterating

2018-08-29 Thread Paul Pinterits
New submission from Paul Pinterits : The fact that `Path.iterdir()` only throws exceptions once you start iterating over it makes it very difficult to write correct code. Let's look at an example: We'll iterate over all children of a directory and print their file size. If we try to do

[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-08-28 Thread Paul Pinterits
New submission from Paul Pinterits : In a conversation with Ethan Furman (the author of the enum module) I've been informed that Enum automatically checks whether the _missing_ method has returned an instance of the correct class, and raises a TypeError if not. (Link: https

[issue32752] no information about accessing typing.Generic type arguments

2018-02-02 Thread Paul Pinterits
New submission from Paul Pinterits <rawi...@gmail.com>: The documentation of the typing module explains how to instantiate generic types, but there is no information about how to extract the type arguments from a generic type. Example: >>> list_of_ints = typing.List[int] >&

[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits
Paul Pinterits <rawi...@gmail.com> added the comment: If we take this class: class Obj: @property def d(self): print('called') And we access Obj.d: _ = Obj.d According to the docs, the following should happen: # obj.d looks up d in the dictionary of obj d = Obj.__dic

[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits
Paul Pinterits <rawi...@gmail.com> added the comment: I'm aware that descriptors have to exist on the class in order to work. The point is that the documentation states "If d defines the method __get__(), then d.__get__(obj) is invoked" (where d is obj.d), which is

[issue31735] Documentation incorrectly states how descriptors are invoked

2017-10-09 Thread Paul Pinterits
New submission from Paul Pinterits <rawi...@gmail.com>: The [descriptor howto](https://docs.python.org/3/howto/descriptor.html#invoking-descriptors) states: "For example, obj.d looks up d in the dictionary of obj. If d defines the method __get__(), then d.__get__(obj)

[issue31289] File paths in exception traceback resolve symlinks

2017-08-27 Thread Paul Pinterits
New submission from Paul Pinterits: The file paths displayed in exception tracebacks have their symlinks resolved. I would prefer if the "original" path could be displayed instead, because resolved symlinks result in unexpected paths in the traceback and can be quite confusing.

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Paul Pinterits
Paul Pinterits added the comment: No no, the docs are correct. This was definitely my mistake. I'm just trying to say that it's rather confusing how there's only partial support for time zones. When I saw that there is support for parsing the time zone offset, I assumed that the functions

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Paul Pinterits
Paul Pinterits added the comment: I see. You're right, it does make a difference. However, this behaviour is quite unexpected. Perhaps I just didn't read the docs carefully enough, but it wasn't clear to me that the time module had such half-baked support for time zones. An unsuspecting user

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Paul Pinterits
New submission from Paul Pinterits: %z is listed as a supported directive in the python 3 documentation (https://docs.python.org/3.5/library/time.html#time.strftime), but it doesn't actually do anything: >>> from time import strptime >>> strptime('+', '%z') == strptime('