Skip to content

Need to implement int.* #304

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

Closed
33 of 35 tasks
mrveera opened this issue Feb 4, 2019 · 7 comments
Closed
33 of 35 tasks

Need to implement int.* #304

mrveera opened this issue Feb 4, 2019 · 7 comments

Comments

@mrveera
Copy link
Contributor

mrveera commented Feb 4, 2019

Following methods/attributes need to be implemented on type int. Please feel to pick unchecked method/attributes
int is implemented in vm/src/obj/objint.rs

  • int . __bool__
  • int . __ceil__
  • int . __dir__
  • int . __floor__
  • int . __index__
  • int . __getnewargs__
  • int . __init_subclass__
  • int . __int__
  • int . __invert__
  • int . __radd__
  • int . __rand__
  • int . __rdivmod__
  • int . __reduce__
  • int . __reduce_ex__
  • int . __rfloordiv__
  • int . __rlshift__
  • int . __rmod__
  • int . __rmul__
  • int . __ror__
  • int . __round__
  • int . __rpow__
  • int . __rrshift__
  • int . __rsub__
  • int . __rtruediv__
  • int . __rxor__
  • int . __setattr__
  • int . __sizeof__
  • int . __subclasshook__
  • int . __trunc__
  • int . denominator
  • int . from_bytes
  • int . imag
  • int . numerator
  • int . real
  • int . to_bytes
@mrveera mrveera changed the title Implementing int.* Need to implement int.* Feb 4, 2019
lausek added a commit to lausek/RustPython that referenced this issue Feb 5, 2019
cthulahoops added a commit that referenced this issue Feb 9, 2019
int type: rounding, index, trunc, int (#304)
@Tom1380
Copy link
Contributor

Tom1380 commented Feb 9, 2019

Can someone point me towards where I can find the specifications for these methods?

@lausek
Copy link
Contributor

lausek commented Feb 10, 2019

Sorry, __int__ was merged in #326 aswell.

@Mec-iS
Copy link

Mec-iS commented Feb 14, 2019

@Tom1380 The reference is CPython implementation -> https://github.com/python/cpython

@dralley
Copy link
Contributor

dralley commented Oct 3, 2019

The current list is just

int.__getnewargs__
int.__init_subclass__
int.__sizeof__

@ashermancinelli
Copy link
Contributor

ashermancinelli commented Oct 15, 2019

I'd love to try at int.__sizeof__, mem::size_of:: comes to mind. Would anyone be willing to give some direction?

@coolreader18
Copy link
Member

coolreader18 commented Oct 15, 2019

See, you think it'll be that simple 😄. We've had two previous attempts at implementing int.__sizeof__, #1172 and #1426, the latter of which is currently open. There's also a discussion topic on __sizeof__ at #1250. If you want to give it a shot based on my comment (#1426 (comment)), feel free to, as #1426 has stagnated a bit.

@youknowone
Copy link
Member

youknowone commented Jan 2, 2020

__getnewargs__ is a pickle feature and __init_subclass__ is metaclass support(#1346). (maybe we'd better to have metaclass issue for this)
So it seems int is now practically done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants