Article View: pl.comp.lang.python
Article #27678Ile funkcja ma parametrów i "Predefined Completions" PyDev
From: max
Date: Thu, 23 Sep 2010 13:27
Date: Thu, 23 Sep 2010 13:27
39 lines
2274 bytes
2274 bytes
Mały przykład: import math a = dir(math) print(a) ['__doc__', '__name__', '__package__', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'e', 'exp', 'fabs', 'factorial', 'floor', 'fmod', 'frexp', 'fsum', 'hypot', 'isinf', 'isnan', 'ldexp', 'log', 'log10', 'log1p', 'modf', 'pi', 'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc'] Jak teraz dla każdej funkcji (o ile to jest funkcja) sprawdzić ile ma parametrów , ewentualnie jakie. Co chcę uzyskać, bo może można to zrobić inaczej: Chodzi mi o wygenerowanie niby kodu pythona któpry można by było użyc potem w pyDev "Predefined Completions" http://pydev.org/manual_101_interpreter.html "Predefined completions are completions acquired from sources that provide only the interfaces for a given Python module (with Python 3.0 syntax). A predefined completion module may be created by having a module with the extension ".pypredef" with regular Python 3.0 contents, but with attributes having assigns to its type and methods having as the body a sole return statement -- and the docstring may have anything. Example for a my.source.module (must be declared in a my.source.module.pypredef file):" Oczywiście dla math nie ma to najmniejszego sensu ale w przypadku gdy mamy moduł dla którego nie ma kodu a chcieli byśmy mieć code-completion. M
Technical Details
Message-ID:
<i7fkia$sjs$1@portraits.wsisiz.edu.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!.POSTED!not-for-mail From: max <max@max.pl> Newsgroups: pl.comp.lang.python Subject: Ile funkcja ma parametrów i "Predefined Completions" PyDev Date: Thu, 23 Sep 2010 15:27:19 +0200 Organization: WSISiZ Lines: 46 Sender: bulkowsk@nospam.wsisiz.edu.pl Message-ID: <i7fkia$sjs$1@portraits.wsisiz.edu.pl> NNTP-Posting-Host: agri.draminski.com.pl Mime-Version: 1.0 X-Trace: portraits.wsisiz.edu.pl 1285248394 29308 95.48.192.50 (23 Sep 2010 13:26:34 GMT) X-Complaints-To: abuse@wsisiz.edu.pl NNTP-Posting-Date: Thu, 23 Sep 2010 13:26:34 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; pl; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit