Skip to content

Support __index__ on additional code paths in Bytes/ByteArray construction#950

Merged
slozier merged 4 commits intoIronLanguages:masterfrom
BCSharp:byteslike_bp
Sep 26, 2020
Merged

Support __index__ on additional code paths in Bytes/ByteArray construction#950
slozier merged 4 commits intoIronLanguages:masterfrom
BCSharp:byteslike_bp

Conversation

@BCSharp
Copy link
Copy Markdown
Member

@BCSharp BCSharp commented Sep 25, 2020

I had to tweak bytes construction a little again. Apparently, it is not only "always call __bytes__", but also "always call __index__" — except when constructing from str or int derived classes…

A similar story in bytearray.

Copy link
Copy Markdown
Contributor

@slozier slozier left a comment

Choose a reason for hiding this comment

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

Looks good to me.

A though that came to be while looking is that int.from_bytes(2, 'big') probably shouldn't work (and indeed it doesn't with CPython). Similarly, there should be no __index__ calls when going through int.from_bytes.

@BCSharp
Copy link
Copy Markdown
Member Author

BCSharp commented Sep 25, 2020

Any idea why test_smtpnet.SmtpTest('test_connect_starttls') fails on Azure Pipelines?

@slozier
Copy link
Copy Markdown
Contributor

slozier commented Sep 25, 2020

No idea for the smtp stuff. Looking at the log is seems like test_smtplib runs to completion in about 5 seconds, but them becomes stuck and times out after 10 minutes.

@slozier slozier merged commit e1770a2 into IronLanguages:master Sep 26, 2020
@BCSharp BCSharp deleted the byteslike_bp branch September 26, 2020 04:46
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.

2 participants