[issue44552] incomplete documentation of __main__.py

2021-07-02 Thread Erik Carstensen
Erik Carstensen added the comment: thanks for the pointer and sorry for the noise! I'll review your text. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44552] incomplete documentation of __main__.py

2021-07-02 Thread Erik Carstensen
New submission from Erik Carstensen : I can find partial information on how Python treats __main__.py here: https://docs.python.org/3/library/__main__.html However, it is not documented how python handles __main__.py when passing the Python package to the interpreter without -m. If I have

[issue44225] stop() on a stopped loop inhibits the next run_forever

2021-05-24 Thread Erik Carstensen
New submission from Erik Carstensen : If you call stop() on an already stopped event loop, then the next call to run_forever will terminate after one loop iteration. I would expect the stop to either be a nop, or to be invalid in this state (and raise an exception). Example: import asyncio

[issue43905] dataclasses.astuple does deepcopy on all fields

2021-05-20 Thread Erik Carstensen
Erik Carstensen added the comment: Would it make sense to make dataclasses iterable, like so? def __iter__(self): return (getattr(self, field.name) for field in fields(self)) With that in place, deprecating astuple would maybe be less disruptive

[issue43905] dataclasses.astuple does deepcopy on all fields

2021-04-21 Thread Erik Carstensen
New submission from Erik Carstensen : It seems that the 'dataclass.astuple' function does a deepcopy of all fields. This is not documented. Two problems: 1. Dictionary keys that rely on object identity are ruined: import dataclasses @dataclasses.dataclass class Foo: key

[issue8886] zipfile.ZipExtFile should be a context manager

2010-06-03 Thread Erik Carstensen
New submission from Erik Carstensen sandb...@virtutech.com: It's nice that ZipFile is a context manager in 2.7. It would be nice and more consistent if the objects returned from ZipFile.open() were context managers too. -- components: Library (Lib) messages: 106941 nosy: sandberg

[issue8886] zipfile.ZipExtFile is a context manager, but that is not documented

2010-06-03 Thread Erik Carstensen
Erik Carstensen sandb...@virtutech.com added the comment: Sorry, my mistake, ZipExtFile is indeed a context manager: I ran into the problem in 2.6, and checked whether it was fixed in 2.7; when quickly reading zipfile.py I saw that only ZipFile had context manager methods, I missed

[issue8886] zipfile.ZipExtFile is a context manager, but that is not documented

2010-06-03 Thread Erik Carstensen
Erik Carstensen sandb...@virtutech.com added the comment: Patch that makes the zipfile test consistently use with statements to handle the return value of ZipFile.open(). -- keywords: +patch Added file: http://bugs.python.org/file17529/with-ZipExtFile-in-test.patch

[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-12-03 Thread Erik Carstensen
Erik Carstensen sandb...@virtutech.com added the comment: Once I considered this approach, but problems was that nFileIndexLow/High can change every time file handle is opened, so it's not unique. See remarks in following page. http://msdn.microsoft.com/en-us/library/aa363788%28VS.85%29.aspx

[issue5827] os.path.normpath doesn't preserve unicode

2009-11-19 Thread Erik Carstensen
Erik Carstensen sandb...@virtutech.com added the comment: Also, assertTrue has an alias failUnless which I personally find more descriptive (I don't know if either form is preferred for inclusion in Python though). -- ___ Python tracker rep

[issue5985] Implement os.path.samefile and os.path.sameopenfile on Windows

2009-10-14 Thread Erik Carstensen
Erik Carstensen sandb...@virtutech.com added the comment: Once I considered this approach, but problems was that nFileIndexLow/High can change every time file handle is opened, so it's not unique. Ah, I see, then your approach makes sense. There's another part of your patch that I don't