Readit News logoReadit News
mivade commented on Swig – Connect C/C++ programs with high-level programming languages   swig.org/... · Posted by u/c0balt
dilawar · 3 years ago
I'd recommend pybind11 for c/c++ <--> python bridge. Though you have to compile your wheel for every minor python version separately.
mivade · 3 years ago
cibuildwheel (https://cibuildwheel.readthedocs.io/en/stable/) makes this fairly straightforward.
mivade commented on Python 3 Types in the Wild   neverworkintheory.org/202... · Posted by u/zdw
ghostwriter · 4 years ago
> which allow developers to say that a function returns Dict[List[Set[FrozenSet[int]]], str]

this type is impossible in Python

mivade · 4 years ago
Correct. Keys must be immutable and hashable.
mivade commented on DC Circuit Water Analogy (1998)   hyperphysics.phy-astr.gsu... · Posted by u/dynm
sandworm101 · 4 years ago
There are serious limits to the analogy. Water only ever remains inside the pipes that carry it. Anything involving the electrical energy not inside wires has no water analogue (ie the electromagnetic waves inside a transformer).
mivade · 4 years ago
No analogy is perfect. They are intended to help illustrate a concept to gain insight. Ideally when using an analogy its limits should also be described. Luckily the very first link after the analogy is explained does just that: http://hyperphysics.phy-astr.gsu.edu/hbase/electric/watcir3.....
mivade commented on Square is now called Block   twitter.com/Square/status... · Posted by u/muhammadusman
mivade · 4 years ago
Makes me think of Fakeblock.
mivade commented on Wikivoyage has disappeared from DuckDuckGo   gaganpreet.in/posts/duckd... · Posted by u/gsa
mivade · 4 years ago
The bang syntax works though: `!wv malta` sends me to the Wikivoyage page on Malta.
mivade commented on Time to retire the CSV?   bitsondisk.com/writing/20... · Posted by u/asicsp
dheera · 5 years ago
CSV is still easier to parse because the C++ dudes still refuse to implement some kind of nice operator-overloaded interface like

    #include <json>

    std::json myjson("{\"someArray\": [1,2,3,4,{\"a\": \"b\"}]}");
    std::cout << (std::string)myjson["someArray"][4]["a"];
and the result is we have 50 different rogue JSON libraries instead of an STL solution. Until the STL folks wake up, boost::split can deal with the CSV.

mivade commented on Amazon acquires MGM for $8.5B   reuters.com/technology/am... · Posted by u/helsinkiandrew
lotsofpulp · 5 years ago
> Today you want to watch an Apple show you must go to Apple's VOD.

When I was a kid, if you wanted to watch an NBC show, you had to watch it on an NBC network. What is the difference?

At least nowadays you can just pay, watch, and cancel at your leisure with the click of a few buttons.

mivade · 5 years ago
The difference is simple: NBC was (and still is) free to watch if you have a television and an antenna.
mivade commented on FastAPI framework, high perf, easy to learn, fast to code, ready for production   fastapi.tiangolo.com/... · Posted by u/homarp
lukin0110 · 5 years ago
We're using FastAPI in production at InvestSuite. Highly productive framework, very well written documentation. You get jump started right away.

Only caveat with async python. Might be tricky when using 'sync' libraries. It's not always straightforward and you'll find yourself wondering why your server is blocked from time to time. It's not a problem of FastAPI, but you need to be aware that if you do a blocking call (function is not prefixed with 'async') to a db that it blocks the event loop.

mivade · 5 years ago
My understanding was that if you write a regular function (`def` rather than `async def`) then FastAPI (or really Starlette which it uses under the hood) executes the function in a thread pool so that no blocking of the main event loop should occur.
mivade commented on Pyston v2: Faster Python   blog.pyston.org/2020/10/2... · Posted by u/kmod
Animats · 5 years ago
How about PyPy?
mivade · 5 years ago
They compare PyPy and CPython in their benchmarks.

Deleted Comment

u/mivade

KarmaCake day55June 3, 2016
About
[ my public key: https://keybase.io/mivade; my proof: https://keybase.io/mivade/sigs/pPb8ollnfz-gzxtgF9SPpapCzdb66qbVPyoigM_1DiY ]
View Original