« first day (4940 days earlier)   
07:00 - 15:0015:00 - 17:00

7:14 AM
Is it possible to make a generic type that appends a type to a tuple?
Input = tuple[int, str]
Output = Append[Input, bool]  # Output should be tuple[int, str, bool]
I'm gonna go ahead and say "probably not" because so far that has always ended with Miyagi proving me wrong
I'm manipulating fate
 
7:52 AM
Have you tried typing.Unpack?
 
And there it is! I only tried Concatenate :/
I devised an alternative implementation in the meantime, so now I have to decide which one I wanna go with
The quail of the whale
(German inside joke, don't worry about it)
 
(cringes in German)
@Aran-Fey Now I'm interested in just how you did that. ^^
 
Proving once again that germans have no sense of humor :/
(Whether that's me or Miyagi is up for interpretation)
@MisterMiyagi The idea was to represent units as a tuple. For example, acceleration would be Unit[Distance, Invert[Time], Invert[Time]]. But typing out the whole thing every time was annoying, so I wanted something like Divide[Speed, Time] to give the same output
The alternative is to represent that as a bunch of nested Mul and Div types, i.e. Acceleration = Div[Div[Distance, Time], Time]
 
8:38 AM
@Aran-Fey Ooooh, that sounds like fun if you want to support conversions between equivalent units.
 
I don't think that's going to be possible. Unit[A, B] and Unit[B, A] will be treated as distinct types, and we're just gonna have to live with that
 
Union supports that, but it's probably special-cased.
 
The problem with Union is that it doesn't allow duplicates, so it can't express Area = Mul[Distance, Distance]
 
True. You'll probably run into some further issues along the line anyways if you go down that rabbit hole.
 
 
2 hours later…
10:40 AM
@Aran-Fey I'd assume something dodgy like Mul = _Mul[A, B] | _Mul[B, A] could work. However, I wouldn't be surprised if mypy breaks at some point
 
 
3 hours later…
1:32 PM
@MisterMiyagi thanks, that's what I'm gonna go with
@Marco Conda is known to have many problems, I avoid it at all costs
 
2:28 PM
@Hakaishin hmmm, what environment manager do you use instead?
 
@Marco just pip
 
2:46 PM
Well, I say the opposite, I've had a lot of problems using just pip, with conda I only end up having problems when I end up involving some installation via pip.
When you use conda it checks which package should be installed so that it is compatible with your installed packages.
 
That's what pip does. Dependency resolution.
 
Well, I don't know what dependency resolution this is when it ends up breaking packages in many cases.
I've never broken packages using just conda.
 
Jedem Tierchen sein Pläsierchen :)
Pycharm is giving me a strange warning
Unexpected type(s): (LiteralString | str | bytes) Possible type(s): (LiteralString) (str)

Does that make sense to you guys? I mean if the possible types are the same as the ones given how is it unexpected? Is it because it could also be bytes?
 
07:00 - 15:0015:00 - 17:00

« first day (4940 days earlier)