[issue35319] pkgutil.get_data() is a wrapper for a deprecated class

2018-11-26 Thread Kevin Norris
New submission from Kevin Norris : pkgutil.get_data()'s documentation[1] says it is a wrapper for importlib.abc.ResourceLoader.get_data(), but the latter's documentation[2] says the whole class is deprecated since 3.7. Please either: A. Formally deprecate pkgutil.get_data() (and ideally

[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-08-18 Thread Kevin Norris
Kevin Norris added the comment: There is none. It raises a TypeError. See https://docs.python.org/3/reference/expressions.html#value-comparisons -- ___ Python tracker <https://bugs.python.org/issue34

[issue34365] datetime's documentation refers to "comparison [...] falling back to the default scheme of comparing object addresses"

2018-08-08 Thread Kevin Norris
New submission from Kevin Norris : The 3.x datetime documentation contains the following footnote: > In other words, date1 < date2 if and only if date1.toordinal() < > date2.toordinal(). In order to stop comparison from falling back to the > default scheme of comparing object

[issue28383] __hash__ documentation recommends naive XOR to combine but this is suboptimal

2016-10-06 Thread Kevin Norris
New submission from Kevin Norris: The documentation for __hash__ contains this text: "The only required property is that objects which compare equal have the same hash value; it is advised to somehow mix together (e.g. using exclusive or) the hash values for the components of the o

[issue26160] Tutorial incorrectly claims that (explicit) relative imports don't work in the main module

2016-01-23 Thread Kevin Norris
Kevin Norris added the comment: >It could be misleading saying “the name of the current package”, because the >import could be relative to the a higher level parent package if more than one >dot is specified. While this is correct, Python still uses __package__ to determine what t

[issue26160] Tutorial incorrectly claims that (explicit) relative imports don't work in the main module

2016-01-19 Thread Kevin Norris
New submission from Kevin Norris: The tutorial contains this statement: Note that relative imports are based on the name of the current module. Since the name of the main module is always "__main__", modules intended for use as the main module of a Python application must always us

[issue24132] Direct sub-classing of pathlib.Path

2015-06-30 Thread Kevin Norris
Kevin Norris added the comment: If I were designing pathlib from scratch, I would not have a separate Path class. I would instead do something like this: In pathlib.py: if os.name == 'nt': Path = WindowsPath else: Path = PosixPath Alternatively, Path() could

[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-05 Thread Kevin Norris
Kevin Norris added the comment: I'm a little concerned about this fix. In particular, if I understand the design of the patch correctly, it is intended to produce this behavior: Path('C:/foo').resolve() != Path('//?/C:/foo').resolve() Since both paths are valid and both paths refer

[issue22299] resolve() on Windows makes some pathological paths unusable

2014-08-29 Thread Kevin Norris
New submission from Kevin Norris: Run Python as an administrator: import pathlib pth = pathlib.Path('//?/C:/foo.') pth.mkdir() pth.resolve().rmdir() Traceback (most recent call last): File stdin, line 1, in module File C:\Python34\lib\pathlib.py, line 1141

[issue22299] resolve() on Windows makes some pathological paths unusable

2014-08-29 Thread Kevin Norris
Kevin Norris added the comment: When the directory name is '...', the error is different: pth = pathlib.Path('//?/C:/...') pth.mkdir() pth.resolve().rmdir() Traceback (most recent call last): File stdin, line 1, in module File C:\Python34\lib\pathlib.py, line 1141

[issue21832] collections.namedtuple does questionable things when passed questionable arguments

2014-06-23 Thread Kevin Norris
New submission from Kevin Norris: Code such as this: class Foo: def __str__(self): # Perhaps this value comes from user input, or # some other unsafe source return something_untrusted def isidentifier(self): # Perhaps