Skip to content

Need to implement int.*  #304

Closed
Closed

Description

@mrveera

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

Activity

  1. changed the title [-]Implementing int.* [/-] [+]Need to implement int.* [/+] on Feb 4, 2019
  2. added a commit that references this issue on Feb 9, 2019
  3. Tom1380 commented on Feb 9, 2019

    @Tom1380
    Contributor

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

  4. lausek commented on Feb 10, 2019

    @lausek
    Contributor

    Sorry, __int__ was merged in #326 aswell.

  5. Mec-iS commented on Feb 14, 2019

    @Mec-iS

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

  6. dralley commented on Oct 3, 2019

    @dralley
    Contributor

    The current list is just

    int.__getnewargs__
    int.__init_subclass__
    int.__sizeof__
    
  7. ashermancinelli commented on Oct 15, 2019

    @ashermancinelli
    Contributor

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

  8. coolreader18 commented on Oct 15, 2019

    @coolreader18
    Member

    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.

  9. youknowone commented on Jan 2, 2020

    @youknowone
    Member

    __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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions