FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add as_integer_ratio to PyInt by minhnhdo · Pull Request #1759 · RustPython/RustPython · GitHub

Repository navigation

Add as_integer_ratio to PyInt - #1759

Merged
coolreader18 merged 1 commit into
RustPython:masterfrom
minhnhdo:master
Feb 12, 2020
Merged

coolreader18 merged 1 commit into
RustPython:masterfrom
minhnhdo:master

Conversation

Copy link
Copy Markdown
Contributor

This pull request adds support for as_integer_ratio to the VM's integer number type, PyInt.

Current behavior on master

>>>>> (10).as_integer_ratio()        
Traceback (most recent call last):                                             
  File "<stdin>", line 1, in <module>
AttributeError: 'int' object has no attribute 'as_integer_ratio'
>>>>> 

Behavior after this pull request

>>>>> (10).as_integer_ratio()
(10, 1)
>>>>> 

minhnhdo commented Feb 11, 2020 •
edited
Loading

Copy link
Copy Markdown
Contributor Author

It looks like the failed runs are due to int.as_integer_ratio not being available in CPython 3.6. Should I just delete the tests?

Copy link
Copy Markdown
Member

Thanks for your contributing.
Upgrading test to use 3.8 will be the best. If it is hard, add an if-statement for python version like:

import sys
if sys.version_info >= (3, 8):
    # run 3.8 test here

Copy link
Copy Markdown
Contributor Author

I'll try upgrading the Python version in GitHub workflow first.

palaviv commented Feb 11, 2020

Copy link
Copy Markdown
Contributor

Upgrading test to use 3.8 will be the best. If it is hard, add an if-statement for python version like:

@youknowone have already tried upgrading to 3.8 in #1705. I think that commenting out the tests and adding a TODO will be good enough.

Copy link
Copy Markdown
Contributor Author

@palaviv, sure, I'll modify this PR.

coolreader18 merged commit 133a571 into RustPython:master Feb 12, 2020

Copy link
Copy Markdown
Member

Thank you for contributing!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL