2012-03-02 10 views
21

एक मॉड्यूल के भीतर __author__ जैसे निजी मेटाडेटा चर का उपयोग करने का सम्मेलन कहां से आता है?__author__ की उत्पत्ति क्या है?

This पायथन मेलिंगलिस्ट थ्रेड 2001 में इसके बारे में कुछ चर्चाओं पर संकेत देने लगता है, लेकिन इसकी आवाज़ से यह सम्मेलन जंगली में पहले से ही बाहर था।

उसके अलावा, मैं केवल this PEP on package metadata पा सकते हैं, जो प्रभावशाली लगती है लेकिन tangental पर सबसे अच्छा।

मैं कोशिश करते हैं और इस विषय पर कुछ स्पष्ट सामग्री खोजने के लिए तो मेरे प्रलेखन उपकरण इन मेटाडाटा चर सफलतापूर्वक पार्स कर सकते हैं करना चाहते हैं।

उत्तर

17

मेरा अनुमान है, यह पुराना समय है जब पैकेजिंग मेटा डेटा तब सामान्य नहीं था। पीईपी 8 में उपयोग में सिस्टमिंग सिस्टम की संशोधन आईडी रखने के लिए __version__ शीर्ष स्तरीय चर का उपयोग करने के लिए प्रोत्साहित किया जाता है। यह 2001-05-01 की तारीख है। पीईपी 3 9 6 मॉड्यूल __version__ विशेषताओं के लिए इसे अधिग्रहण कर रहा है।

__author__ के लिए वहाँ अजगर देव मेलिंग सूची से एक पोस्ट, इस मामले के विषय में है। यह 2001-03-01 की तारीख है। लेखक __author__ के उपयोग पर सवाल उठाता है: "अगला क्या है? __cute_signoff__?"।

चूंकि पीईपी में कोई उल्लेख नहीं है, इसलिए हमें __author__ के बारे में चिंता करने की ज़रूरत नहीं है। पैकेजिंग मेटाडाटा वैसे भी हमारे दोस्त है।

http://mail.python.org/pipermail/python-dev/2001-March/013328.html

 
Ping just checked in this: 

> Log Message: 
> Add __author__ and __credits__ variables. 
> 
> 
> Index: tokenize.py 
> =================================================================== 
> RCS file: /cvsroot/python/python/dist/src/Lib/tokenize.py,v 
> retrieving revision 1.19 
> retrieving revision 1.20 
> diff -C2 -r1.19 -r1.20 
> *** tokenize.py 2001/03/01 04:27:19 1.19 
> --- tokenize.py 2001/03/01 13:56:40 1.20 
> *************** 
> *** 10,14 **** 
> it produces COMMENT tokens for comments and gives type OP for all operators.""" 
> 
> ! __version__ = "Ka-Ping Yee, 26 October 1997; patched, GvR 3/30/98" 
> 
> import string, re 
> --- 10,15 ---- 
> it produces COMMENT tokens for comments and gives type OP for all operators.""" 
> 
> ! __author__ = 'Ka-Ping Yee ' 
> ! __credits__ = 'first version, 26 October 1997; patched, GvR 3/30/98' 
> 
> import string, re 

I'm slightly uncomfortable with the __credits__ variable inserted 
here. First of all, __credits__ doesn't really describe the 
information given. Second, doesn't this info belong in the CVS 
history? I'm not for including random extracts of a module's history 
in the source code -- this is more likely than not to become out of 
date. (E.g. from the CVS log it's not clear why my contribution 
deserves a mention while Tim's doesn't -- it looks like Tim probably 
spent a lot more time thinking about it than I did.) 

Anothor source of discomfort is that there's absolutely no standard 
for this kind of meta-data variables. We've got __version__, and I 
believe we once agreed on that (in 1994 or so :-). But __author__? 
__credits__? What next -- __cute_signoff__? 
+0

को देखते हुए यह वहाँ शायद कोई रास्ता नहीं मज़बूती से \ _ \ _ लेखक \ _ \ _ या \ _ \ _ क्रेडिट पार्स करने के लिए है \ _ \ _ जिम्मेदार बताते हैं। – itsafire

संबंधित मुद्दे