-
Notifications
You must be signed in to change notification settings - Fork 120
Do's and Dont's
Giovanni Torres edited this page Aug 19, 2017
·
1 revision
Do encode before passing to C, otherwise, end up with the following error in Py3
- TypeError: expected bytes, str found
Do encode before passing to Python function, which ultimately passes variable to C function:
- AttributeError: 'bytes' object has no attribute 'encode'
Don't use temporary python variables when passing to a C function
- Obtaining char * from temporary Python value
Do convert dict.values() to a list before returning for python 3 compat
- TypeError: 'dict_values' object does not support indexing
Do decode subprocess output to avoid error in Py3
- TypeError: 'str' does not support the buffer interface
Question: should something return 'No' instead of False, or vice versa? or map int 1 -> bool True, etc.
Intro
Getting Started
Development
- Running a local user installation
- Testing PySlurm with Docker
- Continuous Integration
- Updating PySlurm for New Slurm Releases
- Using latest version of Cython
- Strings and bytes in Cython
- Profiling PySlurm
- Checking for memory leaks
- Do's and Dont's
- Slurm shell completion
Contributing