Python还部分拒绝主/从条款

即使在编程语言中,也要考虑到政治上的正确性。 上周,Red Hat的Python开发人员Victor Stinner发送了四个池请求,以重命名Python文档和代码中可能令人反感的术语master / slave。 作者建议用社交中立的词语代替它们,这不会冒犯始祖为真正奴隶的人。 作为一种可能的替代方法,有父母/工人一词。

提议的更改不是一个开发人员的心血来潮,而是不同编程语言和技术的普遍趋势。 Stinner提供了RedisDrupalCouchDBDjango中类似更改的示例。 因此,Django和CouchDB用领导者/跟随者代替了主/从。

同时,Stinner表示认为,“奴隶制”术语仍然可以保留一些术语,例如Git中的master分支,网站管理员和postmaster。

激烈的讨论开始了。

python / cpython代码库中进行搜索时,发现“冒犯性”术语“主”和“从”彼此相邻,包括pty和openpty库。

例如,这是lib / pty.py代码

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/zh-CN423057/


All Articles