-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stdlib] Add a bunch of new features to object (dict, tuple, __iter__
, structs
!)
#3716
base: nightly
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rd4com this looks good. Left some nitpicks on the usages of dunders that can be changed to builtin functions.
__iter__
!)
Hello @JoeLoser , last review is implemented ! my_list._value.get_as_list()[x._value.get_as_int()]._value.get_as_list()[y._value.get_as_int()] = z
#List.__getitem__[0]().__getitem__[1]() = z
# edit: with latest commits
my_list.as_list()[x.as_int()].as_list()[y.as_int()] = z It is super important, because the lifetime/origin is propagated through, Last commit also have |
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Co-authored-by: martinvuyk <[email protected]> Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
There is: `fn __init__[dt: DType](inout self, value: SIMD[dt, 1])` Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
…tList`) Signed-off-by: rd4com <[email protected]>
…tring`, test cow for `__iadd__` Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Co-authored-by: Joe Loser <[email protected]> Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
…_`, `__gt__`, `__lt__`, `__ge__`, `__le__` Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
__iter__
!)__iter__
, structs
!)
Signed-off-by: rd4com <[email protected]>
Signed-off-by: rd4com <[email protected]>
Hello, it would be really nice to use our object a lot more,
it is the default type in def functions and makes programming easy,
hope this pr is good, it has a dict implementation for both K and V of object,
really looking forward to use the features of the pr everyday:
uses Arc in in variant for ref count (list, dict, attributes, string)
RefCountDict
andRefCountTuple
RefCountAttrsDict
,RefCountDict
andRefCountTuple
_ObjectImpl.ref_count()
forRefCounted*
structsWrappedStruct
Can anybody check a benchmark for the matmul example ?
because changes might be slower or faster (not tested)
With this that now works:
We can then implement type(x) is type(y) !
json could also be an exciting next step,
then we could have a hybrid between dynamic and typed:
a.typed[Int]() += SIMD[Int, 4]().reduce_add()
Hope you like this pr, if it's not good enough no worries lol
(no merge 👍 or we could even refine with huge reviews if needed)
usecase is to transition from
def event(inout self, props: PythonObject)
to
def event(inout self, props)
in a web-framework i'm trying to create