Skip to content
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

Draft
wants to merge 53 commits into
base: nightly
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ce6cb52
nice simplification
rd4com Oct 26, 2024
fe204bf
nice simplification 2
rd4com Oct 26, 2024
d3230b7
add dict
rd4com Oct 26, 2024
a1dc7e5
add constructor for `List[Attr]`
rd4com Oct 26, 2024
de695f8
add `__contains__()` and `pop()` for dict and list
rd4com Oct 26, 2024
06b06fd
[stdlib] Add examples and documentations
rd4com Oct 26, 2024
a42b793
Fix: mojo format the changes
rd4com Oct 26, 2024
c0cd563
Add more examples and documentations
rd4com Oct 26, 2024
547b2e2
Update for review
rd4com Oct 28, 2024
b58606e
Update for review
rd4com Oct 28, 2024
721c245
Update for review
rd4com Oct 28, 2024
dfcfe5f
Update for review
rd4com Oct 28, 2024
113e773
Update for review
rd4com Oct 28, 2024
9a65479
Update for review
rd4com Oct 28, 2024
a4d5b31
Update for review
rd4com Oct 28, 2024
2f832d1
Update for review
rd4com Oct 28, 2024
425a3c5
Update for review
rd4com Oct 28, 2024
04715fe
Update for review
rd4com Oct 28, 2024
775b68b
nice simplification 3
rd4com Oct 27, 2024
cc58c16
Remove duplicate `__init__(inout self, other: Float64)`
rd4com Oct 27, 2024
bc35ab8
Fix: mojo format the changes
rd4com Oct 28, 2024
43dab4a
Add tests for `__hash__`
rd4com Oct 28, 2024
01fc69d
Simplify `RefCountList` and `RefCountAttrsDict`
rd4com Oct 28, 2024
acebe5d
add `__repr__` for `RefCountDict`
rd4com Oct 28, 2024
c9c7ad1
implement `__eq__` for `RefCountAttrsDict` and `RefCountDict`, ref fo…
rd4com Oct 28, 2024
268eb86
Fix: mojo format the changes
rd4com Oct 28, 2024
a8cfa89
Add `None` as default for pop() with no argument, and tests
rd4com Oct 29, 2024
0df4db6
Add tests for `__eq__` (`RefCountAttrsDict`, `RefCountDict`, `RefCoun…
rd4com Oct 29, 2024
f3d864a
add `_ObjectImpl.ref_count()` for `RefCounted*` structs, `RefCountedS…
rd4com Oct 29, 2024
e48c843
update new tests with `.ref_count()` for `RefCounted*` structs
rd4com Oct 29, 2024
09a3b53
Unify with ref then remove a lot
rd4com Oct 30, 2024
5d0a06e
add `RefCountedTuple` and tests
rd4com Oct 30, 2024
630b8de
ameliorate `__eq__` when types are not comparable
rd4com Oct 30, 2024
18bd37c
simplify `__ne__()`
rd4com Oct 31, 2024
d328bf2
simplify `__le__()`, `__ge__()`, `__lt__()`, `__gt__()`, `__eq__()`
rd4com Oct 31, 2024
f23c7dd
Fix: mojo format the changes
rd4com Oct 31, 2024
38b3a97
ameliorate/speedup `_list_compare` to iterate by reference and add tests
rd4com Oct 31, 2024
e227c61
Fix type number for tuple and use `int()` for `ref_count()`
rd4com Nov 1, 2024
55a15db
Update stdlib/src/builtin/object.mojo
rd4com Nov 1, 2024
0cb642e
add tests for `get_type_id()`
rd4com Nov 1, 2024
c480f63
`__getattr__` and `__setattr__` returns ref and `Dict._find_ref()`
rd4com Nov 2, 2024
2dfbb03
add tuple for `__getitem__` and `__setitem__`
rd4com Nov 2, 2024
e1cec16
Add capacity for tuple `__init__`
rd4com Nov 4, 2024
7026735
Parametrize `_compare()` for tuple and add tests for `__eq__`, `__ne_…
rd4com Nov 5, 2024
1278eff
Add attributes support for `__gt__`, `__lt__`, `__ge__`, `__le__`
rd4com Nov 5, 2024
ceb9cae
Add `__iter__` (by ref for dict keys and list elements)
rd4com Nov 5, 2024
2d7ff66
add as ref methods that returns a ref and type checking
rd4com Nov 6, 2024
d9389c7
Fix: mojo format the changes
rd4com Nov 7, 2024
a3f0e72
Update iterator to reflect the new `__has_next__()`
rd4com Nov 8, 2024
45b120f
change `__getattr__` to return a mutable ref
rd4com Nov 10, 2024
be42b49
Add `WrappedStruct` and simple trait for its `__init__`
rd4com Nov 11, 2024
1c8022d
Fix: mojo format the changes
rd4com Nov 11, 2024
b440904
Fix: mojo format the changes
rd4com Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading