Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Add private field to access declared types #33

Merged

Conversation

SebastienLavoie
Copy link
Contributor

This introduces a way to fetch the types that were declared in the Case[...]. If there is a better way of doing this, please let me know!

Copy link
Owner

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request! I'm happy to add this as a private API, but would like it to be implemented a little differently for landing.

Instead of attempting to access certain attributes and catch any exception that results, can you extend the TupleConstructor and IdentityConstructor types so they all have one method/property which you can consistently invoke from this code?

Once the exception handling is gone, this can also be nicely rewritten as a list comprehension. 😄

@SebastienLavoie
Copy link
Contributor Author

Thank you for the quick response and the feedback! I hope these changes are what you wanted. It does make for much cleaner code 😃

@jspahrsummers
Copy link
Owner

Very sorry for the delayed review, and thank you for the updates! This looks great. 🌟

@jspahrsummers jspahrsummers merged commit e0f3724 into jspahrsummers:master Feb 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants