[Checkins] SVN: grok/trunk/doc/naming_conventions.txt Add naming conventions for Grok.

Martijn Faassen faassen at infrae.com
Fri Mar 16 11:21:11 EDT 2007


Log message for revision 73219:
  Add naming conventions for Grok.
  

Changed:
  A   grok/trunk/doc/naming_conventions.txt

-=-
Added: grok/trunk/doc/naming_conventions.txt
===================================================================
--- grok/trunk/doc/naming_conventions.txt	2007-03-16 15:17:55 UTC (rev 73218)
+++ grok/trunk/doc/naming_conventions.txt	2007-03-16 15:21:10 UTC (rev 73219)
@@ -0,0 +1,33 @@
+Grok naming conventions
+-----------------------
+
+Zope 3 used to follow PEP 8, but then PEP 8 changed so that
+methodNames() is deprecated in favor of method_names().
+
+Grok aims to be mostly consistent with Zope 3, but does make some
+changes in the direction of PEP 8.
+
+modulenames - module and package names are all lower case, no
+underscores
+              
+ClassNames - CamelCase (Zope 3 + PEP 8)
+
+methodNames - camelCase: follow Zope 3 conventions. We work a lot with Zope 3
+              classes and sometimes subclass.
+
+attribute_names - Zope 3 + PEP 8
+
+class_annotations - we break with Zope 3 tradition
+                    (grok.local_utility() versus implementsOnly()). 
+                    This makes class annotations stand out a bit
+                    more and is more consistent with the use of
+                    class-level attribute names for customization
+                    as well (as in formlib).
+
+top_level_functions - Zope 3 uses camel case (getUtility()).  Grok
+                      uses underscores for top-level functions that
+                      define class annotations. Grok internally has also
+                      been using underscores for functions defined
+                      internally. So far we have avoided exposing them
+                      to the outside world. If you need to expose
+                      one of these, bring it up on the grok-dev mailing list.



More information about the Checkins mailing list