Skip to main content


This is your periodic reminder that in #Python, the value of the expression `0xfor....real` is

15

```
$ python3 -c "print(0xfor....real)"
15
```

This entry was edited (2 months ago)
in reply to SnoopJ

Do you not get "SyntaxWarning: invalid hexadecimal literal"? (tried in v3.11, with same parsing as in https://hachyderm.io/@SnoopJ/112646011559348547 )


this expression has an identical parse tree to: `(0xf) or (...).real` and the RHS of the `or` is never evaluated so it doesn't matter that the attribute doesn't exist on the `Ellipsis` object
This entry was edited (2 months ago)
in reply to parvXtl

@parvXtl ah, I hadn't realized a `SyntaxWarning` was added for it. Interesting false positive!
in reply to SnoopJ

😅 And I was wondering if the warning was removed later [after v3.11].
This entry was edited (2 months ago)
in reply to SnoopJ

Content warning: explanation

This entry was edited (2 months ago)