📜 ⬆️ ⬇️

Python also partially rejects the terms master / slave

Political correctness is taken into account even in programming languages. Last week, Python-developer Victor Stinner (Victor Stinner) from Red Hat sent four pull requests to rename potentially offensive master / slave terms in the documentation and Python code. The author proposed replacing them with socially neutral words that do not offend people whose ancestors were real slaves. As an alternative, there are parent / worker terms.

The proposed change is not a whim of a single developer, but a general trend for different programming languages ​​and technologies. Steener gave examples of similar changes in Redis , Drupal , CouchDB and Django . So, Django and CouchDB have replaced the terms master / slave with leader / follower.

At the same time Steener expressed the opinion that the “slave-owning” terminology can still be left for some terms, such as the master branch in Git, the webmaster and the postmaster.
')
A heated discussion ensued.

A search in the python / cpython codebase finds numerous inclusions of the “offensive” terms master and slave next to each other, including in the pty and openpty libraries.

For example, here is the Lib / pty.py code :

STDIN_FILENO = 0
STDOUT_FILENO = 1
STDERR_FILENO = 2

CHILD = 0

def openpty():
    """openpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible."""

    try:
        return os.openpty()

, « » , , , .

, Python Linux — master/slave . , Python, Linux. , Python Linux . «» Python , Linux.

, «» «» . master , . , doctest doctest.master:

# For backward compatibility, a global instance of a DocTestRunner
# class, updated by testmod.
master = None

, .

, « ». , nntplib.NNTP() slave(), slave . NNTP, 3.12 ( SLAVE), .

— mbuf.master PyMemoryViewObject C API:

typedef struct {
    PyObject_HEAD
    int flags;          /* state flags */
    Py_ssize_t exports; /* number of direct memoryview exports */
    Py_buffer master; /* snapshot buffer obtained from the original exporter */
} _PyManagedBufferObject;


/* memoryview state flags */
#define _Py_MEMORYVIEW_RELEASED    0x001  /* access to master buffer blocked */
#define _Py_MEMORYVIEW_C           0x002  /* C-contiguous layout */
#define _Py_MEMORYVIEW_FORTRAN     0x004  /* Fortran contiguous layout */
#define _Py_MEMORYVIEW_SCALAR      0x008  /* scalar: ndim = 0 */
#define _Py_MEMORYVIEW_PIL         0x010  /* PIL-style layout */

typedef struct {
    PyObject_VAR_HEAD
    _PyManagedBufferObject *mbuf; /* managed buffer */
    Py_hash_t hash;               /* hash value for read-only views */
    int flags;                    /* state flags */
    Py_ssize_t exports;           /* number of buffer re-exports */
    Py_buffer view;               /* private copy of the exporter's view */
    PyObject *weakreflist;
    Py_ssize_t ob_array[1];       /* shape, strides, suboffsets */
} PyMemoryViewObject;

, master slave . , . , Python 3.8 master/slave .

, , . , Redis : 1.0.0 SLAVEOF NO ONE, -slave -master. , . . , 2003 - master/slave .

2004 Global Language Monitor master/slave . , RFC 977 1986 .

- , — . , , Python. -, , pty UNIX.

, «» . , «: 5000 » “dominium” () “familia” ():

“dominium”, “dominus”, «», «», “domus”, . . «», «». “domestic” («»), « » , . “Domus” “familia”, . . «», “familia” “famulus”, . . «». , “pater familias”, , , .

, - , , , , — , , . , , . , .

“dominium”, , , , () , , , , , , . ., , .

«», «» : . , . .

« !

, , — .

, , . , , .

, .

.

, ».

— fukkit

Source: https://habr.com/ru/post/423057/


All Articles