Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.
#312 AI Goes on Trial For Writing Code
November 29, 2022
00:35:26
38.67 MB
Downloads: 0
Watch on YouTube
About the show
Sponsored by Complier Podcast from RedHat
Connect with the hosts
- Michael: @mkennedy@fosstodon.org
- Brian: @brianokken@fosstodon.org
Brian #1: Coping strategies for the serial project hoarder
- Simon Willison
- Also a talk from DjangoCon2022
- I’m actually not sure what title would be best, but this is an incredible video that I’m encouraging every developer to watch, whether or not you work with open source projects.
- Covers
- The perfect commit
- Implementation, Tests, Documentation, and a link to an issue thread
- Tests
- Prove the implementation works, pass if it works, fails otherwise
- A discussion of how adding tests is way easier than starting testing a project, so get the framework in place early, and devs won’t be afraid to add to it.
- Cookiecutter repo templates for projects you will likely start
- super cool idea to have your own that you keep up to date with your preferred best practices
- A trick for using GitHub actions to use those templates to populate new repos
- Trying this out is on my todo list
- Documentation must live in the same repo as the code
- and be included in PRs for the PR to be accepted by code review
- maybe even test this using documentation unit tests
- Everything links to an issue thread
- Keep all of your thoughts in an issue thread
- Doesn’t have to be a dialog with anyone but yourself
- This allows you to NOT HAVE TO REMEMBER ANYTHING
- Tell people what you did
- This is just as important in work projects as it is in open source
- Blog about it
- Post on Twitter (or Mastodon, etc.)
- Avoid side projects with user accounts
- “If you build something that people can sign into, that’s not a side-project, it’s an unpaid job. It’s a very big responsibility, avoid at all costs!” - this is hilarious and something I’m probably not going to follow
- The perfect commit
Michael #2: GitHub copilot lawsuit
- First, we aren’t lawyers
- Lawsuit filed on November 3, 2022
- We’ve filed a lawsuit challenging GitHub Copilot, an AI product that relies on unprecedented open-source software piracy.
- GitHub copilot is trained on projects on GitHub, including GPL and other restrictive licenses
- This is the first class-action case in the US challenging the training and output of AI systems.
Brian #3: Use Windows Dialog Boxes from Python with no extra libraries
- Actual title: Display a message box with Python without using a non-standard library or other dependency (Windows)
- By Matt Callahan / learned about from from PyCoders weekly
- When I need a simple pop up dialog box that’s cross platform, PySimpleGUI is awesome and so easy.
- But when I KNOW it’s only going to run on Windows, why not just use native dialog boxes?
- Matt’s article shows you how, using ctypes to call into a Windows dll.
Small example from article:
import ctypes def main(): WS_EX_TOPMOST = 0x40000 windowTitle = "Python Windows Message Box Test" message = "Hello, world!" # display a message box; execution will stop here until user acknowledges ctypes.windll.user32.MessageBoxExW(None, message, windowTitle, WS_EX_TOPMOST) print("User clicked OK.") if __name__ == "__main__": main()
Notes:
- The uType (fourth) parameter is a multi-use value that can be or-ed for things like:
- Type of dialog box: Help, OK, OK/Cancel, Retry/Cancel, Yes/No, etc.
- The icon to use: Exclamation, Info, Question, etc.
- Modality, …
- Return value is used to understand how user reacted:
- 1 - OK, 2 - Cancel (or x), …, 6 - Yes, 7 - No, …
- The uType (fourth) parameter is a multi-use value that can be or-ed for things like:
Michael #4: Extra Extra Extra
- Python browser extensions
- takahe - Mastodon on Python - the right way
- Michael’s article in Black Friday perf
- We could scale down our server after what I’ve learned. But we’d pay 10x more in bandwidth overages ironically: Last month Talk Python broadly transferred 20.2 TB of data from our servers
- Moved our static traffic to Bunny CDN, highly recommended service
- RSS revival
- My blog: mkennedy.codes
- Reeder 5 app on iOS and macOS
- Rivers Cuomo (from Weezer) and Guido sit down for a talk together
- Also check out the Talk Python episode with Rivers: talkpython.fm/327
- Kite is saying farewell