[Python-ideas] Allow attribute references for decimalinteger

אלעזר elazarg at gmail.com
Thu Oct 31 02:55:10 CET 2013


[MRAB‏]
> it's already the case> that 1.j == 1.0j, not (1).j, so saying that 1.real == (1).real would be inconsistent.

I don't understand. In what sense 1.j != (1).j ? The latter is an
AttributeError, which I suggest to change.

[Alexander Belopolsky]
> What would 1.e50 mean under your proposal?

Well that seems to kill it :-(. I should have digged deeper before
proposing this idea.

I assume it's fixable by making it a special syntax itself, or by
raising an AttributeError (I really doubt it appears anywhere) or by
making int's __getattribute__ handle it in a special way, but I
wouldn't suggest these ideas seriously.

The docs should mention this issue, however. perhaps in an end note.


More information about the Python-ideas mailing list