[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-10 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset ac05f82ad4983e3d3653ae7494c1ff62c4a265fc by DevilXD in branch 
'master':
bpo-41974: Remove part of the note regarding complex.__float__ (GH-25197)
https://github.com/python/cpython/commit/ac05f82ad4983e3d3653ae7494c1ff62c4a265fc


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-05 Thread Bartosz


Bartosz  added the comment:

Done so: https://github.com/python/cpython/pull/25197

Signed the CLA thing too, it seems it'll take a while to update tho.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-05 Thread Bartosz


Change by Bartosz :


--
pull_requests: +23936
pull_request: https://github.com/python/cpython/pull/25197

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-04 Thread Guido van Rossum


Guido van Rossum  added the comment:

Indeed, Bartosz. Do you think you can help by submitting a PR for the docs?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2021-04-04 Thread Bartosz


Bartosz  added the comment:

The docs for this should probably be updated to reflect the change: 
https://docs.python.org/3/library/typing.html#typing.runtime_checkable

--
nosy: +DevilXD

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2020-10-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2020-10-09 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e2ec0b27c02a158d0007c11dcc1f2d7a95948712 by Serhiy Storchaka in 
branch 'master':
bpo-41974: Remove complex.__float__, complex.__floordiv__, etc (GH-22593)
https://github.com/python/cpython/commit/e2ec0b27c02a158d0007c11dcc1f2d7a95948712


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2020-10-09 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

+1 This makes sense.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2020-10-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +lemburg, mark.dickinson, rhettinger, stutzbach

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2020-10-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +21582
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/22593

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41974] Remove complex.__float__, complex.__floordiv__, etc

2020-10-08 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The complex class has special methods which always raise a TypeError:

   __int__
   __float__
   __floordiv__
   __mod__
   __divmod__

After removing them the corresponding operations (converting to int and float, 
operators // and %, function divmod()) will still a TypeError.

Advantages of removing:

* Less code to maintain.
* More uniform error messages.
* Clearer output of help().
* Possibility to implement a type with __rfloordiv__, __rmod__ and __rdivmod__ 
which support complex numbers.

--
components: Interpreter Core
messages: 378218
nosy: gvanrossum, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove complex.__float__, complex.__floordiv__, etc
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com