Re: Naming conventions for functions and methods

2014-07-08 Thread Ben Finney
pyt...@bdurham.com writes: > Looking for your opinions on how you name your functions and > methods. Example: I have a function that hashes a file. I could > name this function hash_file() or file_hash(). I'd prefer just ‘hash’. The function name can be considered an action verb, with its argumen

Re: Naming conventions for functions and methods

2014-07-08 Thread Arnaud Delobelle
On 8 July 2014 15:59, wrote: > > Looking for your opinions on how you name your functions and methods. > Example: I have a function that hashes a file. I could name this function > hash_file() or file_hash(). The 1st naming convention sounds more natural, > the 2nd naming convention allows one

Naming conventions for functions and methods

2014-07-08 Thread python
Looking for your opinions on how you name your functions and methods. Example: I have a function that hashes a file. I could name this function hash_file() or file_hash(). The 1st naming convention sounds more natural, the 2nd naming convention allows one to group related functions together by the

Re: Proposal about naming conventions around packaging

2012-05-30 Thread Tarek Ziadé
On 5/30/12 6:59 PM, Benoît Bryon wrote: Hi, Hi Benoit you should post this to the distutils SIG Thank you Here is a proposal about naming conventions around packaging. Main question is: would you accept it as a PEP? Preliminary notes (not

Proposal about naming conventions around packaging

2012-05-30 Thread Benoît Bryon
Hi, Here is a proposal about naming conventions around packaging. Main question is: would you accept it as a PEP? Preliminary notes (not part of the proposal) Before I start, here are some preliminary

Re: PEP for module naming conventions

2011-03-17 Thread Jonathan Gossage
is looked in for package/module resolution. Do you have any suggestions for handling this kind of packaging? On Thu, Mar 17, 2011 at 12:17 PM, eryksun () wrote: > On Friday, March 11, 2011 4:52:57 PM UTC-5, Tim Johnson wrote: >> I need to be better informed on naming conventions fo

Re: PEP for module naming conventions

2011-03-17 Thread eryksun ()
On Friday, March 11, 2011 4:52:57 PM UTC-5, Tim Johnson wrote: > I need to be better informed on naming conventions for modules. For > instance, I need to create a new module and I want to make sure that > the module name will not conflict with any future or current python > system

Re: PEP for module naming conventions

2011-03-17 Thread Mel
Tim Johnson wrote: > I need to be better informed on naming conventions for modules. For > instance, I need to create a new module and I want to make sure that > the module name will not conflict with any future or current python > system module names. COBOL in its golden years ha

Re: PEP for module naming conventions

2011-03-13 Thread Tim Johnson
* Ben Finney [110313 17:15]: > Tim Johnson writes: > > > I need to be better informed on naming conventions for modules. For > > instance, I need to create a new module and I want to make sure that > > the module name will not conflict with any future or current python

Re: PEP for module naming conventions

2011-03-13 Thread Ben Finney
Tim Johnson writes: > I need to be better informed on naming conventions for modules. For > instance, I need to create a new module and I want to make sure that > the module name will not conflict with any future or current python > system module names. You'll never be able to

Re: PEP for module naming conventions

2011-03-11 Thread Tim Johnson
You can find the list of all PEPs at http://python.org/dev/peps/ Thank you for the links David. > -- > David Marek > dav...@atrey.karlin.mff.cuni.cz > http://davidmarek.cz And interesting web site. The future is with us. > > On Fri, Mar 11, 2011 at 10:52 PM, Tim Johnson wrote:

Re: PEP for module naming conventions

2011-03-11 Thread David Marek
-- David Marek dav...@atrey.karlin.mff.cuni.cz http://davidmarek.cz On Fri, Mar 11, 2011 at 10:52 PM, Tim Johnson wrote: > I need to be better informed on naming conventions for modules.  For > instance, I need to create a new module and I want to make sure that > the module name will not confli

PEP for module naming conventions

2011-03-11 Thread Tim Johnson
I need to be better informed on naming conventions for modules. For instance, I need to create a new module and I want to make sure that the module name will not conflict with any future or current python system module names. There may be a PEP for this, if so, a URL to such a PEP would suffice

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-15 Thread Aahz
In article <4c3a8087$0$28662$c3e8...@news.astraweb.com>, Steven D'Aprano wrote: > >For some reason, when I answer the phone and say "Hello, Steven >speaking?" I often get called Peter. That's the Peter Principle in action. -- Aahz (a...@pythoncraft.com) <*> http://www.pythonc

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-13 Thread Neil Cerutti
On 2010-07-12, Steven D'Aprano wrote: > On Sun, 11 Jul 2010 01:30:36 -0700, rantingrick wrote: > >> On Jul 11, 3:03??am, "G??nther Dietrich" wrote: >> >>> So, it is not a disadvantage that the functions you listed above are >>> named in this way. In the contrary, it is an advantage, as it keeps

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-12 Thread Jean-Michel Pichavant
rantingrick wrote: On Jul 11, 3:03 am, "Günther Dietrich" wrote: So, it is not a disadvantage that the functions you listed above are named in this way. In the contrary, it is an advantage, as it keeps newcomers from using stupid variable names. "int" for an Integer is stupid? "list"

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-12 Thread Cameron Simpson
On 12Jul2010 02:43, Steven D'Aprano wrote: | On Mon, 12 Jul 2010 02:40:07 +, Steven D'Aprano wrote: | > On Mon, 12 Jul 2010 01:31:14 +0100, Mark Lawrence wrote: | >> Well said Steven, or is it Stephen, or Stephan, or Stefen, or what? | > | > For some reason, when I answer the phone and say "

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Terry Reedy
On 7/11/2010 3:26 AM, rantingrick wrote: Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --need i go on...?-- start with lowercase. This is an anomaly

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Steven D'Aprano
On Mon, 12 Jul 2010 02:40:07 +, Steven D'Aprano wrote: > On Mon, 12 Jul 2010 01:31:14 +0100, Mark Lawrence wrote: > >> Well said Steven, or is it Stephen, or Stephan, or Stefen, or what? > > For some reason, when I answer the phone and say "Hello, Steven > speaking?" I often get called Peter

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Steven D'Aprano
On Mon, 12 Jul 2010 01:31:14 +0100, Mark Lawrence wrote: > Well said Steven, or is it Stephen, or Stephan, or Stefen, or what? For some reason, when I answer the phone and say "Hello, Steven speaking?" I often get called Peter. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Mark Lawrence
On 12/07/2010 01:06, Steven D'Aprano wrote: On Sun, 11 Jul 2010 00:26:36 -0700, rantingrick wrote: Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --n

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Steven D'Aprano
On Sun, 11 Jul 2010 00:26:36 -0700, rantingrick wrote: > Another source of asininity seems to be the naming conventions of the > Python language proper! True/False start with an upper case and i > applaud this. However str, list, tuple, int, float --need i go on...?-- > start wi

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Steven D'Aprano
On Sun, 11 Jul 2010 01:30:36 -0700, rantingrick wrote: > On Jul 11, 3:03 am, "Günther Dietrich" wrote: > >> So, it is not a disadvantage that the functions you listed above are >> named in this way. In the contrary, it is an advantage, as it keeps >> newcomers from using stupid variable names. >

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread rantingrick
On Jul 11, 12:23 pm, MRAB wrote: > If you're so unhappy with Python, why don't you create your own > language. I suggest the name "Rantthon". Ah yes, then i can finally assume my worthy title of the "Ranting Dictator For Life"! ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread MRAB
rantingrick wrote: Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --need i go on...?-- start with lowercase. Q: Well what the hell is your problem Rick

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread News123
Andreas Waldenburger wrote: > > Having capitalized boolean values ... that is a bit odd, but as long as > children are starving in Africa, this isn't very high on my gripe-list. > +1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Andreas Waldenburger
On Sun, 11 Jul 2010 15:46:40 +0200 News123 wrote: > Andre Alexander Bell wrote: > > On 07/11/2010 10:30 AM, rantingrick wrote: > > >>> So, it is not a disadvantage that the functions you listed above > >>> are named in this way. In the contrary, it is an advantage, as it > >>> keeps newcomers fr

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread News123
Andre Alexander Bell wrote: > On 07/11/2010 10:30 AM, rantingrick wrote: >>> So, it is not a disadvantage that the functions you listed above are >>> named in this way. In the contrary, it is an advantage, as it keeps >>> newcomers from using stupid variable names. >> "int" for an Integer is stupi

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Marek Kubica
On Sun, 11 Jul 2010 00:26:36 -0700 (PDT) rantingrick wrote: > Another source of asininity seems to be the naming conventions of the > Python language proper! True/False start with an upper case and i > applaud this. However str, list, tuple, int, float --need i go > on...?-- start wi

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Andre Alexander Bell
On 07/11/2010 10:30 AM, rantingrick wrote: > On Jul 11, 3:03 am, "Günther Dietrich" > wrote: > >> So, it is not a disadvantage that the functions you listed above are >> named in this way. In the contrary, it is an advantage, as it keeps >> newcomers from using stupid variable names. > > "int" f

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread rantingrick
On Jul 11, 3:03 am, "Günther Dietrich" wrote: > So, it is not a disadvantage that the functions you listed above are > named in this way. In the contrary, it is an advantage, as it keeps > newcomers from using stupid variable names. "int" for an Integer is stupid? "list" for a List is stupid? "s

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Günther Dietrich
rantingrick wrote: >Another source of asininity seems to be the naming conventions of the >Python language proper! True/False start with an upper case and i >applaud this. However str, list, tuple, int, float --need i go >on...?-- start with lowercase. > >Q: Well what the he

Re: Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread Alf P. Steinbach /Usenet
* rantingrick, on 11.07.2010 09:26: Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --need i go on...?-- start with lowercase. Q: Well what the hell is

Naming Conventions, Where's the Convention Waldo?

2010-07-11 Thread rantingrick
Another source of asininity seems to be the naming conventions of the Python language proper! True/False start with an upper case and i applaud this. However str, list, tuple, int, float --need i go on...?-- start with lowercase. Q: Well what the hell is your problem Rick. Who cares right

Re: pylint naming conventions?

2009-06-09 Thread Esmail
R. David Murray wrote: Well, I for one looked at that long pylint output when I first tried it, and switched to another tool :) (pyflakes...but I don't think it does PEP 8) :-) Ok, so I'm not the only one who thinks the output is rather lengthy. I've since dug into the docs and searched on

Re: pylint naming conventions?

2009-06-08 Thread R. David Murray
Esmail wrote: > Ben Finney wrote: > > My understanding of Esmail's original message was that, like many of us > > on first running ‘pylint’ against an existing code base, the output is > > astonishingly verbose and tedious to read. By the above I presume he's > > being a good forum member and tryi

Re: pylint naming conventions?

2009-06-08 Thread Esmail
Ben Finney wrote: My understanding of Esmail's original message was that, like many of us on first running ‘pylint’ against an existing code base, the output is astonishingly verbose and tedious to read. By the above I presume he's being a good forum member and trying to find a minimal example

Re: pylint naming conventions?

2009-06-08 Thread Esmail
Hi David, David Stanek wrote: It is my understanding that it does check for PEP8 names. Even if it doesn't it is really easy to change. If you run 'pylint --generate-rcfile' (i think) it will output the configuration that it is using. You can then save this off and customize it. Thanks, I'll

Re: pylint naming conventions?

2009-06-07 Thread Ben Finney
David Stanek writes: > On Sun, Jun 7, 2009 at 9:23 AM, Esmail wrote: > > I'll try to come up with a nice short code example in the next few > > days to demonstrate what I think the problem is and post it, thanks > > for the suggestion. > > If you didn't have an example handy what prompted you to

Re: pylint naming conventions?

2009-06-07 Thread David Stanek
On Sun, Jun 7, 2009 at 9:23 AM, Esmail wrote: > Ben Finney wrote: >> >> Esmail writes: >> >>> I am confused by pylint's naming conventions, I don't think the are in >>> tune with Python's style recommendations (PEP 8?) >>> >>>

Re: pylint naming conventions?

2009-06-07 Thread Esmail
Ben Finney wrote: Esmail writes: I am confused by pylint's naming conventions, I don't think the are in tune with Python's style recommendations (PEP 8?) Anyone else think this? It's hard to know, without examples. Can you give some output of pylint that you think does

Re: pylint naming conventions?

2009-06-05 Thread Ben Finney
Esmail writes: > I am confused by pylint's naming conventions, I don't think the are in > tune with Python's style recommendations (PEP 8?) > > Anyone else think this? It's hard to know, without examples. Can you give some output of pylint that yo

pylint naming conventions?

2009-06-05 Thread Esmail
Hi, as someone who is still learning a lot about Python I am making use of all the tools that can help me, such as pyflakes, pychecker and pylint. I am confused by pylint's naming conventions, I don't think the are in tune with Python's style recommendations (PEP 8?) Anyone else

Re: Naming conventions for regular variables

2008-07-04 Thread Ben Finney
mk <[EMAIL PROTECTED]> writes: > http://www.python.org/dev/peps/pep-0008/ > > "Function Names > > Function names should be lowercase, with words separated by > underscores as necessary to improve readability." > > However, this PEP does not recommend any particular style for naming > regula

Naming conventions for regular variables

2008-07-04 Thread mk
http://www.python.org/dev/peps/pep-0008/ "Function Names Function names should be lowercase, with words separated by underscores as necessary to improve readability." However, this PEP does not recommend any particular style for naming regular (local) variables. Personally I like "m

Re: Developing Techniques (and naming conventions)

2008-02-24 Thread Steve Holden
Adekoba wrote: > On Feb 24, 1:06 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: >> Adekoba wrote: >>> food.py >>> food/ >>> __init__.py >>> ham.py >>> cheese.py >>> where food.py is a script that uses the package food. Is it possible >>> for this to work in any way? Every time I

Re: Developing Techniques (and naming conventions)

2008-02-24 Thread Adekoba
On Feb 24, 3:21 pm, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080224 20:01], Adekoba ([EMAIL PROTECTED]) wrote: > > >I don't think moving food.py's code to __init__.py would work out to > >well, because then how would I run the script? > > import food > > Which in

Re: Developing Techniques (and naming conventions)

2008-02-24 Thread Jeroen Ruigrok van der Werven
-On [20080224 20:01], Adekoba ([EMAIL PROTECTED]) wrote: >I don't think moving food.py's code to __init__.py would work out to >well, because then how would I run the script? import food Which in turn has something like this in food/__init__.py: from food.cheese import gouda from food.ham import

Re: Developing Techniques (and naming conventions)

2008-02-24 Thread Adekoba
On Feb 24, 1:06 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Adekoba wrote: > > food.py > > food/ > > __init__.py > > ham.py > > cheese.py > > > where food.py is a script that uses the package food. Is it possible > > for this to work in any way? Every time I try to run food.

Re: Developing Techniques (and naming conventions)

2008-02-24 Thread Christian Heimes
Adekoba wrote: > food.py > food/ > __init__.py > ham.py > cheese.py > > where food.py is a script that uses the package food. Is it possible > for this to work in any way? Every time I try to run food.py, python > tries to import everything from the script instead of from the > p

Developing Techniques (and naming conventions)

2008-02-24 Thread Adekoba
I have some questions... Say we have a package "food" food/ __init__.py ham.py cheese.py Is it possible to have a file named "food.py" in the package and have non-referential imports work? i.e., for ham.py to have a line "import food.food". From my experience, python will not wo

Re: module naming conventions

2008-01-17 Thread Jorgen Grahn
ays/packages.html>. >> They allow a hierarchy of modules in directories. > > I do use packages. I mentioned the Java naming conventions because > they were my first thought for solving the problem of name clashes, > and they work well in some non-Java languages. They don'

Re: module naming conventions

2008-01-16 Thread Terry Reedy
"Tobiah" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | | > Release your package as free software on the Cheeseshop | > http://cheeseshop.python.org/>. If the name you want is already | > taken, pick one that will help users distinguish yours from the | > existing one. | > | | I li

Re: module naming conventions

2008-01-15 Thread Tobiah
> Release your package as free software on the Cheeseshop > http://cheeseshop.python.org/>. If the name you want is already > taken, pick one that will help users distinguish yours from the > existing one. > I like this idea. I developed a library with a name that got a couple of obscure softwa

Re: module naming conventions

2008-01-14 Thread Ben Finney
grackle <[EMAIL PROTECTED]> writes: > On Jan 14, 6:28 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: > > Release your package as free software on the Cheeseshop > > http://cheeseshop.python.org/>. If the name you want is > > already taken, pick one that will help users distinguish yours > > from the

Re: module naming conventions

2008-01-14 Thread grackle
On Jan 14, 6:28 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > grackle <[EMAIL PROTECTED]> writes: > What do you mean by "top-level module", and "the same top-level name"? > Do you mean "the same fully-qualified name"? If two modules are in > separate places in the hierarchy, they will have different

Re: module naming conventions

2008-01-14 Thread Carl Banks
On Jan 14, 11:44 am, grackle <[EMAIL PROTECTED]> wrote: > Obviously Java-style naming is a mistake in Python, since top-level > names have to be unique. Is there a standard naming convention to > facilitate mixing code from different sources, such as > mygroupname_modulename? Is there a best prac

Re: module naming conventions

2008-01-14 Thread Ben Finney
grackle <[EMAIL PROTECTED]> writes: > I do use packages. I mentioned the Java naming conventions because > they were my first thought for solving the problem of name clashes, > and they work well in some non-Java languages. They don't apply well > to Python, since every

Re: module naming conventions

2008-01-14 Thread grackle
On Jan 14, 4:47 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > I'm not sure, but it sounds as though you have yet to discover Python > module packages http://www.python.org/doc/essays/packages.html>. > They allow a hierarchy of modules in directories. I do use packages. I me

Re: module naming conventions

2008-01-14 Thread Ben Finney
grackle <[EMAIL PROTECTED]> writes: > Obviously Java-style naming is a mistake in Python, since top-level > names have to be unique. Is there a standard naming convention to > facilitate mixing code from different sources, such as > mygroupname_modulename? Is there a best practices guide for mod

module naming conventions

2008-01-14 Thread grackle
Obviously Java-style naming is a mistake in Python, since top-level names have to be unique. Is there a standard naming convention to facilitate mixing code from different sources, such as mygroupname_modulename? Is there a best practices guide for module naming? Thanks, David -- http://mail.py

Re: *Naming Conventions*

2007-06-11 Thread [EMAIL PROTECTED]
On Jun 8, 2:06 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-06-08, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > Neil Cerutti a écrit : (snip) > > >> Certainly i and j are just as generic, but they have the > >> advantage over 'item' of being more terse. > > > I'm not sure this is rea

Re: *Naming Conventions*

2007-06-11 Thread Neil Cerutti
On 2007-06-11, Marius Gedminas <[EMAIL PROTECTED]> wrote: > On Jun 6, 3:18 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> > Since 'i' and 'j' are canonically loop indices, I find it >> > totally confusing to use them to name the iteration variable - >> > which is not an index. >> >> Certainly i and

Re: *Naming Conventions*

2007-06-11 Thread Marius Gedminas
On Jun 6, 3:18 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > Since 'i' and 'j' are canonically loop indices, I find it > > totally confusing to use them to name the iteration variable - > > which is not an index. > > Certainly i and j are just as generic, but they have the > advantage over 'item'

Re: *Naming Conventions*

2007-06-08 Thread Neil Cerutti
On 2007-06-08, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Neil Cerutti a écrit : >> On 2007-06-06, Bruno Desthuilliers >> <[EMAIL PROTECTED]> wrote: >>> Neil Cerutti a écrit : On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Wildemar Wildenburger wrote: > I agree with

Re: *Naming Conventions*

2007-06-08 Thread Bruno Desthuilliers
Neil Cerutti a écrit : > On 2007-06-06, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: >> Neil Cerutti a écrit : >>> On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote: Wildemar Wildenburger wrote: I agree with Bruno that i and j should be used only for indices, but I'm usual

Re: *Naming Conventions*

2007-06-06 Thread Neil Cerutti
On 2007-06-06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Neil Cerutti a écrit : >> On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote: >>> Wildemar Wildenburger wrote: >>> I agree with Bruno that i and j should be used only for >>> indices, but I'm usually less terse than that. >> >>

Re: *Naming Conventions*

2007-06-06 Thread Bruno Desthuilliers
Ninereeds a écrit : > Google Groups appears to have thrown away my original reply, so sorry > if this appears twice... > > On Jun 4, 9:51 pm, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> wrote: > >> 'i' and 'j' are the canonical names for for loops indices in languages >> that don't support proper i

Re: *Naming Conventions*

2007-06-06 Thread Bruno Desthuilliers
Neil Cerutti a écrit : > On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote: >> Wildemar Wildenburger wrote: >>> While that is true, I guess it is commonplace to use i, j, k >>> and n (maybe others) in constructs like >>> >>> for i in range(len(data)): >>>do_stuff(data[i]) >>> >>> Or shou

Re: *Naming Conventions*

2007-06-05 Thread Ninereeds
Google Groups appears to have thrown away my original reply, so sorry if this appears twice... On Jun 4, 9:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > 'i' and 'j' are the canonical names for for loops indices in languages > that don't support proper iteration over a sequence. Using th

Re: *Naming Conventions*

2007-06-05 Thread Michael Hoffman
Neil Cerutti wrote: > I find i and j preferable to overly generic terms like "item." Well, I probably wouldn't use "item" in a real example, unless it were for a truly generic function designed to act on all sequences. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: *Naming Conventions*

2007-06-05 Thread Neil Cerutti
On 2007-06-04, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Wildemar Wildenburger wrote: >> While that is true, I guess it is commonplace to use i, j, k >> and n (maybe others) in constructs like >> >> for i in range(len(data)): >>do_stuff(data[i]) >> >> Or should the good python hacker do th

Re: *Naming Conventions*

2007-06-04 Thread Wildemar Wildenburger
Carsten Haese wrote: > On Mon, 2007-06-04 at 23:20 +0200, Wildemar Wildenburger wrote: > >> I guess it is commonplace to use i, j, k and n >> (maybe others) in constructs like >> >> for i in range(len(data)): >> do_stuff(data[i]) >> >> Or should the good python hacker do that differently?

Re: *Naming Conventions*

2007-06-04 Thread Michael Hoffman
Wildemar Wildenburger wrote: > [EMAIL PROTECTED] wrote: >> On Jun 4, 12:20 am, Ninereeds <[EMAIL PROTECTED]> wrote: >> >>> First, for small loops with loop variables whose meaning is obvious >>> from context, the most readable name is usually something like 'i' or >>> 'j'. >>> >> >> 'i' and

Re: *Naming Conventions*

2007-06-04 Thread Carsten Haese
On Mon, 2007-06-04 at 23:20 +0200, Wildemar Wildenburger wrote: > I guess it is commonplace to use i, j, k and n > (maybe others) in constructs like > > for i in range(len(data)): > do_stuff(data[i]) > > Or should the good python hacker do that differently? Hope not ;). That's a big, fat "

Re: *Naming Conventions*

2007-06-04 Thread Wildemar Wildenburger
[EMAIL PROTECTED] wrote: > On Jun 4, 12:20 am, Ninereeds <[EMAIL PROTECTED]> wrote: > >> First, for small loops with loop variables whose meaning is obvious >> from context, the most readable name is usually something like 'i' or >> 'j'. >> > > 'i' and 'j' are the canonical names for for lo

Re: *Naming Conventions*

2007-06-04 Thread [EMAIL PROTECTED]
On Jun 4, 12:20 am, Ninereeds <[EMAIL PROTECTED]> wrote: > On Jun 4, 5:03 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > > for validanswer in validanswers: > > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > > MyOptions['style'] = validanswer > > First, for small loop

Re: Dict naming, global vs local imports, etc. [was Re: *Naming Conventions*]

2007-06-04 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, George Sakkis wrote: > While we're at it, although it's not strictly a naming convention > issue I still waste brain cycles on where to put the import statements > that are used only once or twice in a module. Should > (1) all imports be at the global scope at the top of th

Re: *Naming Conventions*

2007-06-03 Thread Michael Hoffman
Michael Hoffman wrote: > Thorsten Kampe wrote: > >> for validanswer in validanswers: >> if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: >> MyOptions['style'] = validanswer > > I usually try to avoid using "my" because I find it obscures a better > understanding of what

Re: *Naming Conventions*

2007-06-03 Thread Michael Hoffman
Thorsten Kampe wrote: > for validanswer in validanswers: > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > MyOptions['style'] = validanswer I usually try to avoid using "my" because I find it obscures a better understanding of what is really going -- Michael Hoffman

Re: *Naming Conventions*

2007-06-03 Thread Steve Howell
--- Dan Bishop <[EMAIL PROTECTED]> wrote: > > * Loop indices often have single-letter names > (typically i/j/k or x/ > y), or names that are the singular form of the list > name (e.g., "for > ballot in self._ballots"). For iterating over > files, I use "line". > You are in good company with "i"

Re: *Naming Conventions*

2007-06-03 Thread Dan Bishop
On Jun 3, 11:03 pm, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > Okay, > > I hear you saying 'not another naming conventions thread'. I've read > through Google and the 'naming conventions' threads were rather > *spelling conventions* threads. > &g

Dict naming, global vs local imports, etc. [was Re: *Naming Conventions*]

2007-06-03 Thread George Sakkis
On Jun 3, 4:32 pm, Steve Howell <[EMAIL PROTECTED]> wrote: > I also still waste brain cycles on naming > dictionaries. Sometimes I name the dictionary after > the values it stores, sometimes after the keys it > uses, and sometimes after both. I was in the same boat but now I've pretty much settl

Re: *Naming Conventions*

2007-06-03 Thread Ninereeds
On Jun 4, 5:03 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > for validanswer in validanswers: > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > MyOptions['style'] = validanswer First, for small loops with loop variables whose meaning is obvious from context, the most

Re: *Naming Conventions*

2007-06-03 Thread Steve Howell
--- Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > for validanswer in validanswers: > if myAnswers.myanswer in > myAnswers.validAnswers[validanswer]: > MyOptions['style'] = validanswer > I can at least sympathize with your problem, although I don't have a great solution for you. I o

Re: *Naming Conventions*

2007-06-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Thorsten Kampe wrote: > Recently I wrote this code and noticed that I was completely lost in > giving these objects names to describe and distinguish them: > > for validanswer in validanswers: > if myAnswers.myanswer in myAnswers.validAnswers[validanswer]: > M

*Naming Conventions*

2007-06-03 Thread Thorsten Kampe
Okay, I hear you saying 'not another naming conventions thread'. I've read through Google and the 'naming conventions' threads were rather *spelling conventions* threads. I'm not interested in camelCase versus camel_case or anything mentioned in 'PEP 8 --

Re: Naming conventions

2006-08-30 Thread Neil Cerutti
r. The >> latter is, to me, easier to read and write. > > Personally I think so long as you are consistent in your coding > style, be it httpserver, HttpServer or HTTPServer or any other > variation, the reader will soon figure out what it means. > > If you feel you are bei

Re: Naming conventions

2006-08-30 Thread Chaz Ginger
rite. > Personally I think so long as you are consistent in your coding style, be it httpserver, HttpServer or HTTPServer or any other variation, the reader will soon figure out what it means. If you feel you are being held hostage to capitalized naming conventions you might want to consider

Re: Naming conventions (was: Re: refering to base classes)

2006-08-30 Thread Neil Cerutti
On 2006-08-30, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney <[EMAIL PROTECTED]> wrote: >>"glenn" <[EMAIL PROTECTED]> writes: >> >>> Bruno Desthuilliers wrote: >>> > It might be better to use newstyle classes if you can. Also, the >>> > convention i

Re: Naming conventions

2006-08-30 Thread Bruno Desthuilliers
Ben Finney wrote: > "glenn" <[EMAIL PROTECTED]> writes: > >> Bruno Desthuilliers wrote: >>> It might be better to use newstyle classes if you can. Also, the >>> convention is to use CamelCase for classes names (unless you have >>> a strong reason to do otherwise). > > Note that this style is more

Re: Naming conventions (was: Re: refering to base classes)

2006-08-29 Thread Jean-Paul Calderone
On Wed, 30 Aug 2006 14:22:16 +1000, Ben Finney <[EMAIL PROTECTED]> wrote: >"glenn" <[EMAIL PROTECTED]> writes: > >> Bruno Desthuilliers wrote: >> > It might be better to use newstyle classes if you can. Also, the >> > convention is to use CamelCase for classes names (unless you have >> > a strong r

Naming conventions (was: Re: refering to base classes)

2006-08-29 Thread Ben Finney
"glenn" <[EMAIL PROTECTED]> writes: > Bruno Desthuilliers wrote: > > It might be better to use newstyle classes if you can. Also, the > > convention is to use CamelCase for classes names (unless you have > > a strong reason to do otherwise). Note that this style is more correctly called TitleCase

Re: Request for help on naming conventions

2005-06-13 Thread Terry Hancock
On Monday 13 June 2005 03:59 am, Steven D'Aprano wrote: > Are there any useful naming conventions for modules, classes and functions? > > For instance, should I name functions as verbs and classes as nouns? Hmm. Okay, here's a few I use: Classes are generally: Capitalized

Re: Request for help on naming conventions

2005-06-13 Thread Benjamin Niemann
Steven D'Aprano wrote: > Are there any useful naming conventions for modules, classes and > functions? > > For instance, should I name functions as verbs and classes as nouns? > > eg > class Transformer(): > pass > > def transform(): > do

Request for help on naming conventions

2005-06-13 Thread Steven D'Aprano
Are there any useful naming conventions for modules, classes and functions? For instance, should I name functions as verbs and classes as nouns? eg class Transformer(): pass def transform(): do_stuff What about the module name? transformations.py or transform.py? What do people do

Re: Library Naming Conventions.

2005-05-10 Thread Robert Kern
[EMAIL PROTECTED] wrote: > quoting: > > Modules should have short, lowercase names, without underscores. > > this still doesn't explain Cookie. PEP-008 didn't exist since the beginning of Python's development. Cookie (I believe) predates PEP-008. -- Robert Kern [EMAIL PROTECTED] "In th

Re: Library Naming Conventions.

2005-05-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > quoting: > > Modules should have short, lowercase names, without underscores. > > this still doesn't explain Cookie. the document you're quoting also says: This document was adapted from Guido's original Python Style Guide essay[2] where [2] points to a

Re: Library Naming Conventions.

2005-05-10 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > quoting: > > Modules should have short, lowercase names, without underscores. > > this still doesn't explain Cookie. Sure it does. The subject line says "conventions", and a convention isn't a firm rule, just something many people agree on. Obviously the auth

Re: Library Naming Conventions.

2005-05-10 Thread chris . lyon
quoting: Modules should have short, lowercase names, without underscores. this still doesn't explain Cookie. [EMAIL PROTECTED] wrote: > see http://www.python.org/peps/pep-0008.html for naming conventions and > other style issues -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >