HackerTrans
TopNewTrendsCommentsPastAskShowJobs

basil-rash

no profile record

comments

basil-rash
·vor 2 Jahren·discuss
My position is that if people find it objectionable (and it’s not actually causing any real harm) they should carry on with their life pretending like it doesn’t exist. This pitchfork army debacle is a load of bologna.
basil-rash
·vor 2 Jahren·discuss
Okay so don’t watch it? If I buy a $60 trumpet and a $30,000 dollar ad slot, I expect to be able to show whatever I damn please involving my $60 trumpet on my $30,000 ad slot, modulo laws of the land concerning acceptable use of broadcast media. If you are emotionally attached to the $60 trumpet I have used as a prop on my $30,000 ad slot in service of my personal artistic expression: fuck off, I don’t give a a shit, and there’s no reason I should. (Apologies for the crassness, but I really do believe the laws of the land correctly provide us significant rights of “uncouthuness” on public broadcasting channels)
basil-rash
·vor 2 Jahren·discuss
There is no visual distinction between high and low quality instruments.
basil-rash
·vor 2 Jahren·discuss
Musicians might not think of their personal instruments in that way, but surely any musician will acknowledge that there exist cheaply made imitations of their instruments that can be treated as more or less disposable. I can get a trumpet on ebay for $60 shipped to my door, and I expect to be able to do whatever I damn please with it, screw what anyone else says.
basil-rash
·vor 2 Jahren·discuss
Anything secret cannot be considered well-known, by definition. The common impression being X is more commonly phrased as “X is well known”.
basil-rash
·vor 2 Jahren·discuss
You’ve yet to produce a single bit of evidence supporting the claim that Trump is somehow more likely to pardon him than Biden, which if you could read you’d know is what I contested.
basil-rash
·vor 2 Jahren·discuss
That’s not SBF. But perhaps Salame will be pardoned by Trump, sure. If any of those PACs supported trump.
basil-rash
·vor 2 Jahren·discuss
Ok and this makes Trump more likely to pardon him than Biden how?
basil-rash
·vor 2 Jahren·discuss
“Convicted fraudster makes unsubstantiated claims, internet cites them as concrete evidence. More at 6.”
basil-rash
·vor 2 Jahren·discuss
If you want to believe a known fraudster saying “oh yeah I totally donated to the winning side, but I didn’t tell anyone”, that’s on you. But it doesn’t change the fact that Trump is very unlikely to pardon someone who publically donated to his opponent, and maybe privately donated to some random GOP members he refers to as “the swamp”. And that’s only if we take as fact some guys “oh yeah I used stolen money to make political donations, but I was just following orders” statement as uttered in a trial.
basil-rash
·vor 2 Jahren·discuss
He donated far more to liberals and it’s a well known. Nobody on the right wants to see him walk free.
basil-rash
·vor 2 Jahren·discuss
Much more likely the individual for whom he was a top donor than his opponent.

https://nymag.com/intelligencer/2021/02/sam-bankman-fried-bi...
basil-rash
·vor 2 Jahren·discuss
An HN-ism if I’ve ever seen one.

Women like sex, just as much as men (if not more so). Sure not every popup about “hot singles in your area” is legit, but women on dating sites messaging you with the goal of a quick night is definitely a thing. And I’m certainly not exceptionally attractive.
basil-rash
·vor 8 Jahren·discuss
At least we have TS.
basil-rash
·vor 8 Jahren·discuss
mypy's response to that code:

  error:invalid type comment or annotation
  note:Suggestion: use intBit[...] instead of intBit(...)
So what's really happening is the type expressions are pretending to be "just everyday python", but actually they have arbitrary restrictions (cannot be functions? need to work via overriding `__getitem__`?) that neither you nor I were aware of. This is probably the least "pythonic" implementation possible.

And even if the code were valid, it's relying on N being a statically known value, which is a bit off because sure, you could have N be some global const config variable, but it would be very weird for configuring the value of the variable to require you to also go into the code and change things around to work with bool's or None's instead of int's.
basil-rash
·vor 8 Jahren·discuss
I'm not trying to build using tons of factory patterns or the like, quite the opposite actually. I try to code as close to the bare language as possible, and work under the assumption that if I at some point would like to pivot my reasoning or approach to a program, the language and the tooling available will help me do so. This is simply not true without types.

I'm not alone in thinking that, the creator of Python himself has devoted his recent work to adding types to Python. Is that just because he doesn't write his code "the correct way"? Does he simply know the syntax but not hoe to effectively use the language? I don't think so.
basil-rash
·vor 8 Jahren·discuss
Is there a utility to having your types and your values in the same namespace?

The extra [ is not a typo, the syntax is: `Callable[[Arg1Type, Arg2Type], ReturnType]`. Or, if the arguments don't matter, `Callable[..., ReturnType]`, but this does not mean that the type is not a valid expression.

Edit: I was missing a ] actually, separating the arguments from the return value.
basil-rash
·vor 8 Jahren·discuss
Initial thoughts from looking through https://docs.python.org/3/library/typing.html#:

1. Love that it doesn't use structural typing, NewType seems great.

2. The syntax is bad. Maybe this is a "it just takes getting used to" thing, but I actually find it really bad. In TS, the syntax for typing almost always directly matches the syntax for the rest of the language. In Python, its a weird sort of LISPy DSL think that they made... compare:

  Py: Callable[[List[Tuple[int, string]], Dict[string, string]], int]
  TS: ([number, string][], { [key: string]: string }) => int
This only gets worse as you chain callables together, whereas in TS everything left-associates as you'd expect and it all works out nicely.

3. Admittedly, the TS dict syntax isn't beautiful, but it becomes very helpful for things like `{ [K in keyof T]: K extends number ? T[K] : never }`, which does not seem to be possible in Py.

4. Related to 3, but no never type? I see NoReturn, but it does not seem to actually cause any errors when you try to assign it to a variable. See below.

5. Type narrowing... does it exist? Seemingly not, see below.

6. Literals as types (enums)?

7. Generics, do I really need to pass in the internal representation of the type I'd like to use? That seems absurd. Will bad things happen if these internal identifiers collide? (Reference: `T = Generic('T')` creates a generic type)

Demo code that should throw an error at the assertUnreachable and nowhere else, but actually throws errors everywhere but the assert unreachable (types seemingly aren't narrowed by `type() == ...` checks):

  def foo(x: Union[str, int, float]):
    if (type(x) == int):
        return x / 3
    if (type(x) == str):
        return x.upper()

    return assertUnreachable()


  def assertUnreachable() -> NoReturn:
    raise RuntimeError('no way')
(this is all checked using mypy, v. 0.641)
basil-rash
·vor 8 Jahren·discuss
I use "short scripts" to mean: I have an idea I want to play around with, usually involving data analysis or some data structure or algorithm sketch, and I'd like to devote the next 2-3 hours to writing a 100-200 line program that evolves with me as I refine what exactly it is that I would like to be examining.
basil-rash
·vor 8 Jahren·discuss
In further reflection, it is perhaps only because I am so used to TS that I try to make as intense of refactorings as I do. A programmer who does not have prior experience working with as well tooled of a language would not be attempting the kinds of transformations I do, and thus may not experience as many issues.