>> (2) The patch adds new functionality to use multiple processes in >> parallel. The normal parameter values are integers indicating how >> many processes to use. The parameter also needs two special values -- >> one to indicate "use os.cpu_count", and the other to indicate "don't >> use multiprocessing at all". >> >> (A) Is there a Best Practices for this situation, with two odd cases? > > > No. In this situation I would consider 0 or -1 for "use os.cpu_count' and > None for "don't use multi-processing".
Why would the user care if multiprocessing is used behind the scene? It would be strange for processes=1 to fail if multiprocessing is not available. If you set a default value of 1, then compileall() will work regardless of whether multiprocessing is available. In short: processes <= 0: use os.cpu_count() processes == 1 (default): just use normal sequential compiling processes > 1: use multiprocessing There's no reason to introduce None. Or am I missing something? _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com