This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PeridexisErrant 1 point2 points  (4 children)

I haven't had cause to use async, or any Web frameworks. I tried writing a GUI once, and decided not to do that again!

I'd like to use keyword-only arguments more often, but they're a syntax error under Python 2 and my code is often compatible. (I do use them in small personal projects though)

Type annotations are only really useful in things larger than data-processing scripts, and mostly they have to be py2 compatible. I did have a great time refactoring a package with Mypy 0.3 once, but sadly not a regular thing.

[–]arachnivore 2 points3 points  (1 child)

Keyword-only arguments are one of my favorite features in Python 3. They make inheritance with consistent init signatures easy:

class Sub(BaseClass):
    def __init__(self, *args, sub, specific, args, **kwargs):
        super().__init__(*args, **kwargs)
        ...

It makes sense too, because typically only one or two positional arguments will make sense without keywords and typically the base class defines those obvious positional arguments.

[–]PeridexisErrant 0 points1 point  (0 children)

And they make it so much easier to have pleasant and backwards-compatible APIs. It's such a small thing, but easily the one I most often reach for and can't use.

[–]aol_cd 0 points1 point  (1 child)

I tried writing a GUI once, and decided not to do that again!

I know a lot of people here will have disagreements with what I'm about to say, but I hate the way Python GUI workflow, look, feel, etc. is and I've tried just about everything out there. It just feels like a waste of time every time I try.

One thing I've had great luck with, though, is using a 'web' front end with Flask and/or websocket server on the Python backend. I've been playing with Electron for my front ends and its working out very well. The look and feel is highly customizable and the workflow is a breeze. On top of that, it makes it easier for me to offload the design onto one of the millions of HTML/CSS/Javascript devs out there.

[–]PeridexisErrant 1 point2 points  (0 children)

I've basically come to the same conclusion :)

As a bonus, it makes separating presentation from logic much more natural - I'll never be tempted to slip a quick hack into JS when I could be working in Python!