Sunday, April 25, 2021

Python Annoyances

I have started programming in Python only very recently! More annoyances will be added as I gain more experience with this language.

  1. Lack of constants
  2. del listname[index] to remove an item from a list at a certain position! This is very awkward and not intuitive!
  3. The abundance of packages is overwhelming
  4. The rstrip() function removes one to many characters on the left hand side of the argument of the rstrip function. Therefore, they came up with the removesuffix() function, introduced with Python version 3.9 (see e.g. PEP 616 -- String methods to remove prefixes and suffixes dated 3/19/2020). This is almost to clever by half instead of fixing the rstrip() function by e.g. adding an optional parameter! (added 6/15/2021)
  5. Despite hundreds of standard libraries, there is no built in function to copy and paste from the clipboard. So I installed Pyperclip, but resulted in errors, when I tried to used it. I had to resort to an old Unix command and subprocess to copy/paste from the clipboard.

No comments: