Skip to content

Update the Scala for Python devs page #2892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
OlegAlexander opened this issue Aug 26, 2023 · 4 comments · Fixed by #2895
Closed

Update the Scala for Python devs page #2892

OlegAlexander opened this issue Aug 26, 2023 · 4 comments · Fixed by #2895

Comments

@OlegAlexander
Copy link
Contributor

Hello! I'm an experienced Python dev who's new to Scala. I was reading the Scala 3 book and noticed a few inaccuracies/omissions on the Scala for Python devs page.

For example:

  • Python has type hints that are checked by the mypy type checker.
  • Scala case classes == Python dataclasses.
  • Python supports metaprogramming in the forms of codegen+eval, monkey-patching, and ast transformations.

Would anyone mind if I submitted a PR to address some of these?

@bishabosha
Copy link
Member

bishabosha commented Aug 28, 2023

I'd support the first two, the third seems like it would be quite verbose, and its not really equivalent

@OlegAlexander
Copy link
Contributor Author

OlegAlexander commented Aug 30, 2023

Thanks for your reply, @bishabosha!

For the third point about metaprogramming, I was actually thinking of removing text rather than adding it. The issue I was having when reading that page was mainly the section called "Concepts that are unique to Scala". There are 3 bullet points I'd remove from that list because these things are, in fact, available in modern Python:

  • Case classes (Dataclasses added in Python 3.7)
  • Pattern matching and match expressions (added in Python 3.10)
  • Metaprogramming (has always been well supported because of dynamic typing)

So my plan is to delete those 3 points, add a little bit of info about Python type hints, and fix any other issues I find with a very light touch. I have no plans to make drastic changes to that page because it's already very good.

Does that sound good to you?

@bishabosha
Copy link
Member

bishabosha commented Aug 30, 2023

Hey, thank you for laying out your plan, I'd say go ahead with the PR!

@OlegAlexander
Copy link
Contributor Author

I submitted my PR. Please let me know if you'd like me to make any changes. Thank you.

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 a pull request may close this issue.

2 participants