home.social

#knuthstyle — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #knuthstyle, aggregated by home.social.

  1. Style guide news!

    Do you write C code for CPython itself?

    PEP 7 (Style Guide for C Code) has been updated to allow putting newlines before operators, "Knuth style":

    if (type->tp_dictoffset != 0
    && base->tp_dictoffset == 0
    && type->tp_dictoffset == b_size
    && (size_t)t_size == b_size + sizeof(PyObject *))
    {
    return 0;
    }

    This is similar to PEP 8 and Black style for Python code.

    github.com/python/peps/pull/39

    peps.python.org/pep-0007/#code

    #Python #PEP7 #PEP8 #StyleGuide #KnuthStyle