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

Added len() function #147

Merged
merged 15 commits into from
May 28, 2024
Merged

Added len() function #147

merged 15 commits into from
May 28, 2024

Conversation

Vardan2009
Copy link
Contributor

Closes #120

Now all objects that have len() defined can be called with len(), even with classes!

class Test
{
    fun __constructor__(){};
    fun __len__()
    {
        return 10
    }
}
len(Test()) # 10
len("test") # 4
len([1,2,3]) # 3

@Almas-Ali
Copy link
Member

Some issue is raising at tests/in-op.rn L61

@Vardan2009
Copy link
Contributor Author

The problem seems to be when __contains__(friend_name) returns false, when I change in-op.rn L50 to return true, elt is not None anymore

@Almas-Ali
Copy link
Member

The problem seems to be when __contains__(friend_name) returns false, when I change in-op.rn L50 to return true, elt is not None anymore

@angelcaru Can you check this issue?

@Almas-Ali
Copy link
Member

I think this feature is complete now. We will fix the test later with another PR.

@Almas-Ali Almas-Ali merged commit d313573 into radon-project:master May 28, 2024
1 check failed
@Vardan2009 Vardan2009 deleted the len-function branch May 28, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants