Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 3.09 KB

2023-08-22.md

File metadata and controls

53 lines (36 loc) · 3.09 KB

2023-08-22 -- Last meeting at the Enclave

Sad news is the coworking location we've been meeting at since PySprings was created is closing. The Enclave closes on 01-SEPT-2023, which means this was our last in-person meeting here.

Please bear with us while we find another venue to host our in-person meetups.

Notes

We talked quite a lot about random things. Here's my best attempt at organization:

Tim gave a lightning talk on singledispatch

We then spawned various converstaions about:

https://repl.it : A very handy website to try out different languages. It even supports pygbag/pygame in the browser!

wasm / pygame / pygbag / piodide - Tools for running Python code directly in the browser. - "Web Assembly" allows various languages to "cross compile" to something understood by your browser. - pygbag and pyodide are tools that are related to this.

Microsoft announced a collaboration with Anaconda to include Python in Excel

class MyClass(object): can be found on the web. Python 2.x required classes to define a base class (object is the most generic). It is preferred to use class MyClass: in Python 3.x. Inheriting from object is implied.

Formatters like black add a trailing comma to multiline lists. For example:

mylist = [
    1,
    2,
]

Here you can see the line 2, ends with a comma. This is syntactically equivalent to using 2 (without the comma), however, it provides the following benefits:

  1. The git diff when adding a new line only contains the new line and not an additional comma in the line above
  2. Removes copy/paste errors when adding new lines

If you've ever worked with json, you know that a trailing comma leads to a parsing error (as well as single-quoted strings). JSON5 is a json schema that is much more flexible, and is used by JavaScript and TypeScript.

The "GIL" in CPython might eventually go away. The Global Interpreter Lock was originally introduced as an easy way to keep CPython thread safe. Python 3.12 will introduce a compiler option to remove this. This is not a simple thing!
CPython (the default version downloaded from python.org) is not the only option, either. Interpreters like pypy and numba already remove the GIL.

We also discussed WSL2 (Windows Subsystem for Linux version 2). Some thoughts:

  • far better than running Linux VM in Windows (easier and less resource intensive)
  • not as good as booting into Linux
  • Best to only install either Docker Desktop in Windows OR docker-ce in WSL2

Many new AI tools are moving from their specific languages (like R, etc) to Python for:

  • Unified tracebacks throughout the stack (easier debug)
  • Ease of adding features
  • AI/ML libraries use Python for the glue logic, but CPU/GPU-intensive tasks are passed to compiled libraries written in C++, Fortran, etc.