473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Coding conventions for class names

set, int, float, list, object,...

Don't see any of the basic types following the capitalized word
convention for classes covered by PEP 08. This does not hold only for
__builtins__ in the strict sense but also for types defined in builtin
modules like datetime.

My question is: does anyone actually follow guidelines here and if yes
which ones and are they resonable ( e.g. stable with regard to
refactoring etc. )?

Apr 25 '07 #1
6 1180
In <11**********************@c18g2000prb.googlegroups .com>, Kay Schluehr
wrote:
set, int, float, list, object,...

Don't see any of the basic types following the capitalized word
convention for classes covered by PEP 08. This does not hold only for
__builtins__ in the strict sense but also for types defined in builtin
modules like datetime.
Most built-ins are easy to explain: They were functions long before it
was possible to use them as base classes and stayed lowercase for
backwards compatibility. Don't know about `set` and `object`. I guess
it's foolish consistency!?
My question is: does anyone actually follow guidelines here and if yes
which ones and are they resonable ( e.g. stable with regard to
refactoring etc. )?
I follow PEPÂ*8 in my (mostly unpublished) code if that does matter to you. :-)

Ciao,
Marc 'BlackJack' Rintsch
Apr 25 '07 #2
Kay Schluehr wrote:
My question is: does anyone actually follow guidelines here
Yes.
and if yes
which ones and are they resonable ( e.g. stable with regard to
refactoring etc. )?
All of them that I know of. What does it mean to be "stable with regard
to refactoring etc."?
--
Michael Hoffman
Apr 25 '07 #3
Marc 'BlackJack' Rintsch wrote:
In <11**********************@c18g2000prb.googlegroups .com>, Kay Schluehr
wrote:
>set, int, float, list, object,...

Don't see any of the basic types following the capitalized word
convention for classes covered by PEP 08. This does not hold only for
__builtins__ in the strict sense but also for types defined in builtin
modules like datetime.

Most built-ins are easy to explain: They were functions long before it
was possible to use them as base classes and stayed lowercase for
backwards compatibility. Don't know about `set` and `object`. I guess
it's foolish consistency!?
Well originally there was sets.Set (uppercase). It became set when it
went to being a built-in.
--
Michael Hoffman
Apr 25 '07 #4
On 25 Apr., 12:32, Michael Hoffman <cam.ac...@mh391.invalidwrote:
Kay Schluehr wrote:
My question is: does anyone actually follow guidelines here

Yes.
and if yes
which ones and are they resonable ( e.g. stable with regard to
refactoring etc. )?

All of them that I know of. What does it mean to be "stable with regard
to refactoring etc."?
--
Michael Hoffman
What happens when an enthusiast re-implements a stdlib module e.g.
decimal s.t. it becomes a builtin module? Will the stdlib module serve
as a wrapper to conform the current API or will the builtin module
conform to the current interface. BTW the distinction between builtins
and non-builtins seems to be an artifact of the particular runtime
implementation. Application level / interpreter level becomes pretty
fluent with regard to PyPy for example. Not sure about these
distinctions in Jython and IronPython. Note that I do like all these
lower case builtin classes, so it is not about my personal taste, but
making coding conventions depended on how something is right now
implemented seems to miss the point.

Apr 26 '07 #5
Kay Schluehr schrieb:
set, int, float, list, object,...

Don't see any of the basic types following the capitalized word
convention for classes covered by PEP 08.
These aren't classes, they are types. PEP 8 doesn't specify any
convention for types; it is common to either apply the conventions
for functions to them, or the conventions for classes.

Regards,
Martin
Apr 26 '07 #6
Kay Schluehr wrote:
What happens when an enthusiast re-implements a stdlib module e.g.
decimal s.t. it becomes a builtin module? Will the stdlib module serve
as a wrapper to conform the current API or will the builtin module
conform to the current interface.
Well, the best example is probably the transition from sets.Set to
__builtin__.set. The API changed but only slightly. So far sets.Set
retains the old implementation--it is not a wrapper for __builtin__.set.

Future modules may be implemented differently.
--
Michael Hoffman
Apr 26 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jarit | last post by:
Hi, Found these coding guidelines for C#, HTML, Javascript, Java, HTML, PL/SQL, T-SQL, VB and VBScript. Well written and free to download. www.demachina.com/products/swat Jeroen
9
by: Neil Zanella | last post by:
Hello, Some programmers like to use a coding convention where all names of variables that are pointers start with the letter p (and sometimes even use similar conventions for strings and other...
144
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this...
39
by: Patrick | last post by:
The c# code style guide that I follow suggests that class variables (fields) be coded with camel casing, like this: int recordId; string name; It also suggests that variables within methods...
10
by: Allan Ebdrup | last post by:
We have a developer who has defined our vraiable naming conventions, He has defined that variables should benamed the same as the class they are an instance of, for example: ...
6
by: Andrea Williams | last post by:
Responding to this link in an old thread: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/ht ml/cpconnetframeworkdesignguidelines.asp According to that naming...
60
by: Dave | last post by:
I'm never quite sure whether to use "this." or not when referring to fields or properties in the same class. It obviously works just fine without it but sometimes I wonder if using this....
19
by: auratius | last post by:
http://www.auratius.co.za/CSharpCodingStandards.html Complete CSharp Coding Standards 1. Naming Conventions and Styles 2. Coding Practices 3. Project Settings and Project Structure 4....
3
by: Hal Vaughan | last post by:
This is more a style question, so I know it's subjective (I hope I don't start a religious war!), but I'm also interested to know if there is a trend. I've noticed that a lot of C++ code shuns...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.