a 'hello world' python C extension (intermediate - advanced) anthony explains #134

preview_player
Показать описание
today I create a sample hello world python C extension and walk through a bit of api and reference counting.

==========

I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
Рекомендации по теме
Комментарии
Автор

thank you, that was exactly what i was looking for!

LoucuraMagic
Автор

Awesome vid, as usual! There's not much out there on the C-API that is this straightforward.
I recently wrote my first C-extension with a lot of frustration (I hated C before starting), but I now have an appreciation for it. I got a ~20% speed-up vs the same function implemented in vanilla Python. I'm curious to see how it stacks up against Cython, but I have no idea how to write .pyx

chriskorfmann
Автор

Like watching your vids. Even thou I am still to grasping the core concepts of python language itself.

dannymurphy
Автор

What this enviroment/WM? I search for usable tiling solution...

imreolah
Автор

This is, most of the time, more of a hobby/curiosity than an actual need (which is still great so many thanks).
However, it's usually best to check out libraries like numpy/scipy/numba/etc before writing your own C extension.

anibaldk
Автор

Thanks for the video! Why we dont have to call Py_DECREF on name variable?

TheNotStated
Автор

im starting new job as software engineer and they are going to use capi for python 2.7. I find this video so useful. Thanks man! PS. What you like to continue with this topic? ;)

POPO
Автор

This is a nice video, it was a good watch and to the point.

fernandodiazurbano
Автор

Does sys.getrefcount(ANY STRING) by default return 3?
Because it didn't change after the code rewrite.

nicezombies
Автор

Great video. A Zig version would also be nice.

DataPastor
Автор

same for RUST and GO as mentioned please ;)

marcello
Автор

Is there any advantage of using C++ over C for this and if so can you make a guide?

victordvickie
Автор

Why we use .c extension to save program

jd
Автор

what does 'pip install .' do?

erjiaxiao
Автор

Too small font, can't see the code. A pity :-/

jccheloven