[issue46527] enumerate no longer accepts iterable keyword argument

2022-01-25 Thread Trey Hunner
New submission from Trey Hunner : While playing around with the main CPython branch against I noticed that enumerate now gives a strange error message when `iterable` is provided as a keyword argument: >>> enumerate(iterable=[]) Traceback (most recent call last): File &

[issue46334] Glossary URLs with anchor link no longer jump to definitions

2022-01-10 Thread Trey Hunner
Trey Hunner added the comment: I just realized those only affects some terms. parameter works: https://docs.python.org/3/glossary.html#term-parameter And LBYL does work but only if LBYL was used: https://docs.python.org/3/glossary.html#term-LBYL The EAFP term does link to #term-LBYL

[issue46334] Glossary URLs with anchor link no longer jump to definitions

2022-01-10 Thread Trey Hunner
New submission from Trey Hunner : The glossary page allows for anchor links to jump to specific definitions. For example: https://docs.python.org/3.9/glossary.html#term-lbyl will open the glossary page with the web browser showing the LBYL at the top of the page. This no longer works

[issue45897] Frozen dataclasses with slots raise TypeError

2021-11-24 Thread Trey Hunner
New submission from Trey Hunner : When making a dataclass with slots=True and frozen=True, assigning to an invalid attribute raises a TypeError rather than a FrozenInstanceError: >>> from dataclasses import dataclass >>> @dataclass(frozen=True, slots=True) ... class Vector

[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Trey Hunner
Trey Hunner added the comment: Thank you Steve and Tadek for confirming that this is a readline feature and for pointing me to the readline manual. The note about an ~/.inputrc file lead me to discover (happily) that I could override this behavior by creating a ~/.inputrc file

[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Trey Hunner
Trey Hunner added the comment: I got some help investigating via a Twitter thread on this topic: https://twitter.com/treyhunner/status/1355280273399664642 Here's more context: that combination of keys seems to put readline into vi mode, though it only does so in Python and not inside my

[issue43070] Control keys stop working after pressing Ctrl-C Escape Enter

2021-01-29 Thread Trey Hunner
New submission from Trey Hunner : On Ubuntu Linux 18.04 when I run Python from within a terminal, control keys such as Ctrl-L, Ctrl-A, Ctrl-E, and Ctrl-K work as expected. However, if I type Ctrl-C Escape Enter (^C followed by Esc followed by Return), control keys stop working as expected

[issue42354] Tuple unpacking with * causes SyntaxError in with ... as ...

2020-11-13 Thread Trey Hunner
New submission from Trey Hunner : The below code worked on Python 3.5, 3.6, 3.7, and 3.8, but it now crashes on Python 3.9. from contextlib import contextmanager @contextmanager def open_files(names): yield names # This would actually return file objects with open_files(['file1.txt

[issue19217] Calling assertEquals for moderately long list takes too long

2020-06-02 Thread Trey Hunner
Trey Hunner added the comment: This is a bug for string comparisons as well. I just had to manually reimplement assertMultiLineEqual (which doesn't call assertSequenceEqual) on one of my test classes to workaround this issue. -- nosy: +trey versions: +Python 3.7, Python 3.8, Python

[issue36582] collections.UserString encode method returns a string

2019-04-09 Thread Trey Hunner
New submission from Trey Hunner : It looks like the encode method for UserString incorrectly wraps its return value in a str call. ``` >>> from collections import UserString >>> UserString("hello").encode('utf-8') == b'hello' False >>> UserString("h

[issue33049] itertools.count() confusingly mentions zip() and sequence numbers

2018-03-11 Thread Trey Hunner
New submission from Trey Hunner <trey@truthful.technology>: >From the itertools documentation: >https://docs.python.org/3/library/itertools.html?highlight=itertools#itertools.count > Also, used with zip() to add sequence numbers. I'm not certain what the goal of the or

[issue32915] Running Python 2 with -3 flag doesn't complain about cmp/__cmp__

2018-02-22 Thread Trey Hunner
New submission from Trey Hunner <trey@truthful.technology>: I might be misunderstanding the use of the -3 flag, but it seems like cmp() and __cmp__ should result in warnings being displayed. -- components: 2to3 (2.x to 3.x conversion tool) files: caseless.py messages: 312604 nosy

[issue30466] Tutorial doesn't explain the use of classes

2017-07-13 Thread Trey Hunner
Changes by Trey Hunner <trey@truthful.technology>: -- pull_requests: +2766 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30466> ___

[issue30466] Tutorial doesn't explain the use of classes

2017-05-24 Thread Trey Hunner
Changes by Trey Hunner <trey@truthful.technology>: -- pull_requests: +1887 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30466> ___

[issue30466] Tutorial doesn't explain the use of classes

2017-05-24 Thread Trey Hunner
New submission from Trey Hunner: The tutorial page for classes starts with "Compared with other programming languages". While object-oriented programming and classes are popular in many programming languages, not everyone learning about Python's classes is familiar with the concept

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-09-30 Thread Trey Hunner
Trey Hunner added the comment: This is a problem I experience occasionally while teaching and while developing teaching curriculum. I tend to close problem windows quickly enough to avoid a computer crash in front of a live audience, but it's still an annoyance to get the REPL state back