Function: python-info-current-symbol
python-info-current-symbol is a byte-compiled function defined in
python.el.gz.
Signature
(python-info-current-symbol &optional REPLACE-SELF)
Documentation
Return current symbol using dotty syntax.
With optional argument REPLACE-SELF convert "self" to current parent defun name.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-info-current-symbol (&optional replace-self)
"Return current symbol using dotty syntax.
With optional argument REPLACE-SELF convert \"self\" to current
parent defun name."
(let ((name
(and (not (python-syntax-comment-or-string-p))
(with-syntax-table python-dotty-syntax-table
(let ((sym (symbol-at-point)))
(and sym
(substring-no-properties (symbol-name sym))))))))
(when name
(if (not replace-self)
name
(let ((current-defun (python-info-current-defun)))
(if (not current-defun)
name
(replace-regexp-in-string
(python-rx line-start word-start "self" word-end ?.)
(concat
(mapconcat #'identity
(butlast (split-string current-defun "\\."))
".")
".")
name)))))))