Do you need to recall cython library or something like that or it is embebed in pythin interpreter?

|
smol_mazunki 2022-09-29 21:25:52
this is huge for long collections of the same data type
smol_mazunki 2022-09-29 21:26:29
Jamerive 2022-09-29 21:25:34
yep, In those time of qtile 0.11, it used python 3.4 I think

if linked against cpython it doesn’t make a difference

Jamerive 2022-09-29 21:26:37
smol_mazunki 2022-09-29 21:25:44
it basically assumes types won’t change, and fails if it happened, running it twice

yeah, python improved compared to JS. That Is a feature that JS lack and TS came to offer!XDD

smol_mazunki 2022-09-29 21:26:37
it’s just linter hints
smol_mazunki 2022-09-29 21:27:13
Jamerive 2022-09-29 21:26:37
yeah, python improved compared to JS. That Is a feature that JS lack and TS came to offer!XDD

python3.11 allows dynamic types just as before

smol_mazunki 2022-09-29 21:27:27
typescript is statically typed
Jamerive 2022-09-29 21:27:37
smol_mazunki 2022-09-29 21:26:29
if linked against cpython it doesn’t make a difference

I don-t know. THe thing I know is that qtile was slow and resource consuming and now is fast and resource lightweigh

smol_mazunki 2022-09-29 21:27:50
it probably uses cython now
smol_mazunki 2022-09-29 21:28:25
which is statically typed python-like code extensions which can be imported without effort
smol_mazunki 2022-09-29 21:28:47
essentially it adds static types to the language, bypassing the type checking
Jamerive 2022-09-29 21:29:48
smol_mazunki 2022-09-29 21:28:47
essentially it adds static types to the language, bypassing the type checking

and using static types takes out a huge load in processing and memory use, right?

smol_mazunki 2022-09-29 21:30:28
Jamerive 2022-09-29 21:29:48
and using static types takes out a huge load in processing and memory use, right?

static typing means the types of a variable can’t and won’t change

smol_mazunki 2022-09-29 21:30:47
this is beneficial since you don’t need to check the type at runtime
smol_mazunki 2022-09-29 21:31:09
smol_mazunki 2022-09-29 21:30:47
this is beneficial since you don’t need to check the type at runtime

“you” = the interpreter

Jamerive 2022-09-29 21:31:33
smol_mazunki 2022-09-29 21:30:47
this is beneficial since you don’t need to check the type at runtime

every time the process is doing something, it have to check type if it is dinamically implement, right?

smol_mazunki 2022-09-29 21:31:51
Jamerive 2022-09-29 21:31:33
every time the process is doing something, it have to check type if it is dinamically implement, right?

welcome to python

Jamerive 2022-09-29 21:32:34
smol_mazunki 2022-09-29 21:31:51
welcome to python

or JS and Interpreted language with dinamic types? SO that is why that kind of languages is slow_

smol_mazunki 2022-09-29 21:32:47
for i in range(1000):
print(i)

there’s gonna be 1000 type checks here

Jamerive 2022-09-29 21:32:54
how do you declare static types on python?
smol_mazunki 2022-09-29 21:33:17
cdef int64 i = 0
for i in range(1000):
print(i)
smol_mazunki 2022-09-29 21:33:38
smol_mazunki 2022-09-29 21:33:17
cdef int64 i = 0
for i in range(1000):
print(i)

there’s no type checking here except on the first round. this is only available in cython

Jamerive 2022-09-29 21:33:54
smol_mazunki 2022-09-29 21:33:17
cdef int64 i = 0
for i in range(1000):
print(i)

do you need to recall cython library or something like that or it is embebed in pythin interpreter?

smol_mazunki 2022-09-29 21:34:15
Jamerive 2022-09-29 21:33:54
do you need to recall cython library or something like that or it is embebed in pythin interpreter?

you need to import this from a normal python instance

Jamerive 2022-09-29 21:34:36
smol_mazunki 2022-09-29 21:34:15
you need to import this from a normal python instance

like import cython?

smol_mazunki 2022-09-29 21:34:54
Jamerive 2022-09-29 21:34:36
like import cython?

import my_cython_code

smol_mazunki 2022-09-29 21:35:36
you compile it with cython my_cython_code.pyx
Jamerive 2022-09-29 21:35:42
smol_mazunki 2022-09-29 21:34:54
import my_cython_code

but what is cython exactly? a new kind of language?

smol_mazunki 2022-09-29 21:36:34
there’s some other ways to do it too, but eh
smol_mazunki 2022-09-29 21:36:46
Jamerive 2022-09-29 21:35:42
but what is cython exactly? a new kind of language?

it’s the official way of creating c extensions

Jamerive 2022-09-29 21:37:07
smol_mazunki 2022-09-29 21:36:46
it’s the official way of creating c extensions

using python code?

smol_mazunki 2022-09-29 21:37:16
https://cython.readthedocs.io/en/latest/src/quickstart/overview.html
Jamerive 2022-09-29 21:38:15
smol_mazunki 2022-09-29 21:37:16
https://cython.readthedocs.io/en/latest/src/quickstart/overview.html

My insight were correct. It is a new language!XDD

smol_mazunki 2022-09-29 21:38:52
https://youtu.be/wh_W-veFpKU

Pythonizing Imgui (feat. Cython) and contributing to open source.YouTube
Dear ImGui is a GUI library for C++ that has Python bindings. Let’s see how to use these Python bindings, and then go through the process of adding a more Pythonic interface to the library by added context manager “with” statement support.

Note: the PR in this video has been ACCEPTED! Coming to a release near you soon!

― mCoding with James Murphy (https://mcoding.io)

Source code: https://github.com/mCodingLLC/VideosSampleCode
Dear ImGui: https://github.com/ocornut/imgui
Pyimgui: https://github.com/pyimgui/pyimgui
My original issue: https://github.com/pyimgui/pyimgui/issues/255
Nooby Python habits video: https://youtu.be/qUeud6DvOWI

AFFILIATES AND REFERRALS
—————————————————
Python AI courses: https://joindeltaacademy.com/?utm_source=mcoding&utm_medium=link&utm_campaign=MCODING&utm_id=mcoding

SUPPORT ME ⭐
—————————————————
Sign up on Patreon to get your donor role and early access to videos!
https://patreon.com/mCoding

Feeling generous but don’t have a Patreon? Donate via PayPal! (No sign up needed.)
https://www.paypal.com/donate/?hosted_button_id=VJY5SLZ8BJHEE

Want to donate crypto? Check out the rest of my supported donations on my website!
https://mcoding.io/donate

Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, John Martin, Casey G

BE ACTIVE IN MY COMMUNITY 😄
—————————————————
Discord: https://discord.gg/Ye9yJtZQuN
Github: https://github.com/mCodingLLC/
Reddit: https://www.reddit.com/r/mCoding/
Facebook: https://www.facebook.com/james.mcoding

CHAPTERS
—————————————————
0:00 Intro
0:36 Pyimgui
1:02 Getting a blank window
1:36 Imgui commands
3:43 Begin and end
5:36 The solution, with statement
5:59 Let’s fork and clone
6:30 Pyimgui’s core
8:28 Adding with support
11:31 Long road ahead
12:17 Compile and test
12:38 Did we fix the problem?
13:00 The last step

smol_mazunki 2022-09-29 21:38:58
Jamerive 2022-09-29 21:38:15
My insight were correct. It is a new language!XDD

kind of

smol_mazunki 2022-09-29 21:39:14
your old python code is 100% valid under cython
|