Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
crazysim
May 23, 2004
I AM SOOOOO GAY

Share Bear posted:

i really like python ive found it very easy to work with and get stuff done in as long as i never ever have to deploy it outside one specific environment

now i have to deploy it outside that env and gotta figure out conda or venvs, cant deploy a full containerized thing

pyinstaller? idk

Adbot
ADBOT LOVES YOU

crazysim
May 23, 2004
I AM SOOOOO GAY
your 8th offense?

i'm amazed there's a clippy-level lint that counts. it should go "..." after like, the 100th or something.

crazysim
May 23, 2004
I AM SOOOOO GAY
mypy?

crazysim
May 23, 2004
I AM SOOOOO GAY

gonadic io posted:

omg gently caress rls

don't touch that garbo and use intellij instead

i thought it was interesting that the original developer of the plugin has since left jetbrains and is working on an rls successor. he seems a lot more reluctant to call it stable.

crazysim
May 23, 2004
I AM SOOOOO GAY

dick traceroute posted:

I wrote something like this on Friday

code:

Assert(true, false);
In a test

Sometimes I do that to quickly and brainlessly see the stdout my test runner captures.

crazysim
May 23, 2004
I AM SOOOOO GAY

Krankenstyle posted:

also, is the pycharm typechecker messing up here or am i missing something?

code:
self.alignments: DefaultDict[str, Dict[int, str]] = None

[...]

self.alignments = collections.defaultdict(dict)

[...]

self.alignments[left][i] = right # left/right are str, i is int
it indicates the "right" variable and says: "Expected type 'dict' (matched generic type '_VT'), got 'str' instead"

other than self.alignments could be "Optional[DefaultDict[str, Dict[int, str]]]" because self.alignments can be None, i'm not able to reproduce this with 2018.3.5. could you post a complete and small python file or snippet that can reproduce this?

code:
import collections
from typing import DefaultDict, Dict, Optional


class Hello:
    def __init__(self):
        self.alignments: Optional[DefaultDict[str, Dict[int, str]]] = None

    def set(self):
        self.alignments = collections.defaultdict(dict)

    def process(self):
        left = "yes"
        right = "happy"
        i = 123
        if self.alignments is not None:
            self.alignments[left][i] = right  # left/right are str, i is int # 2018.3.5 HAPPY 
            self.alignments[left]["ho"] = right  # PyCharm 2018.3.5 not happy about "ho" because it's a str not an int NOT HAPPY
            self.alignments[5][i] = right  # PyCharm 2018.3.5 not happy about 5 because it's a int not an str NOT HAPPY
            self.alignments[left][i] = 42  # PyCharm 2018.3.5 not happy about 42 because it's a int not an str NOT HAPPY
alt without optional. same results.

code:

import collections
from typing import DefaultDict, Dict


class Hello:
    def __init__(self):
        self.alignments: DefaultDict[str, Dict[int, str]] = None

    def set(self):
        self.alignments = collections.defaultdict(dict)

    def process(self):
        left = "yes"
        right = "happy"
        i = 123
    
        self.alignments[left][i] = right  # left/right are str, i is int # 2018.3.5 HAPPY
        self.alignments[left]["ho"] = right  # PyCharm 2018.3.5 not happy about "ho" because it's a str not an int NOT HAPPY
        self.alignments[5][i] = right  # PyCharm 2018.3.5 not happy about 5 because it's a int not an str NOT HAPPY
        self.alignments[left][i] = 42  # PyCharm 2018.3.5 not happy about 42 because it's a int not an str NOT HAPPY

crazysim fucked around with this message at 17:02 on Mar 1, 2019

crazysim
May 23, 2004
I AM SOOOOO GAY

Krankenstyle posted:

thanks!! i can try later, but its nested deep in loops and poo poo so it might be a bit of a pain to dig out while preserving semantics

actually that might be the issue i guess, maybe?? it correctly infers that right is a str but for some reason thinks it should be a dict (at least thats how i read it anyway???)

i don't think the Optional thing is the reason. i posted a version without the Optional and it still worked fine. the whole "nullability" annotation stuff is optional. it's a stylistic thing that i've seen jetbrain use to great effect in java and kotlin. it just happens to be applicable to python/pycharm too.

i don't know about Windows, but you can hold down command and hover over "alignments" in self.alignments at the problem area to see what the inferred type is. it's correct on mine but maybe something has messed up the inference going down.

crazysim fucked around with this message at 17:36 on Mar 1, 2019

crazysim
May 23, 2004
I AM SOOOOO GAY

Beamed posted:

I posted about getting burned really hard by this a few months back, to the point where I wanted to write my own framework - it was at the height of the panic over Actix's tons of unsafe blocks, Rocket still being Too Unstable, and Gotham being abandoned (temporarily). Rust's web story still doesn't seem to be there.


i've been using rouiille. it's synchronous but its fast enough to tide me over and let me use other more mature parts of the rust ecosystem until something matures. just internal tools only though.

crazysim
May 23, 2004
I AM SOOOOO GAY
Some Mazdas and some Nissans cannot stream over Bluetooth the 99% Invisible podcast because of the "% I" in the name so they made an alternate "99% invisible" podcast to work around it.

More weirdness: https://www.reddit.com/r/gimlet/comments/bdxht4/hey_its_ben_from_the_reply_all_episode_140_i_have/

crazysim fucked around with this message at 13:03 on Apr 22, 2019

crazysim
May 23, 2004
I AM SOOOOO GAY

necrotic posted:

lol i thought they fixed that after the last fiasco with left pad.

there's a post in that thread discussing how the author unpublished things. they're not sure how and it wasn't responded to.

i love the posts about "my multi-illion banking software is broken!".

Adbot
ADBOT LOVES YOU

crazysim
May 23, 2004
I AM SOOOOO GAY

DONT THREAD ON ME posted:

openssl cli is so bad, i spent a few hours learning the template system and gave up

i gave up and used cfssl instead.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply