Skip to content

Conversation

@mdickinson
Copy link
Member

@mdickinsonmdickinson commented May 28, 2020

This PR exposes PyFloat_AsDouble to Python level in the form operator.as_float. This provides a way for Python code to emulate the implicit float conversions that Python itself does at C level.

https://bugs.python.org/issue40801

@mdickinsonmdickinson added the type-feature A feature request or enhancement label May 28, 2020
pass

if bad_type:
raise TypeError(f"must be real number, not{obj.__class__.__name__}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean real number in the math sense? Or do you mean it as instead of a string representation of a number?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the mathematical sense. But this wording isn't new to this PR; it's copied from here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That makes sense. :-)

@mdickinsonmdickinson marked this pull request as draft May 29, 2020 09:59
@mdickinson
Copy link
MemberAuthor

Converted this PR to draft; the feature is still under discussion.

@mdickinsonmdickinson deleted the feature/operator-as-float branch June 12, 2021 08:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core reviewtype-featureA feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@mdickinson@csabella@the-knights-who-say-ni@bedevere-bot