John Machin:
import foo # used by baz()
import bar # used by spam()
Why bother with the ()?
I code in other language too beside Python, in those languages there
are other things (like templates in D language) beside functions, so
my comment helps me remember that baz() is a function instead
On Nov 16, 6:58 pm, [EMAIL PROTECTED] wrote:
John Machin:
import foo # used by baz()
import bar # used by spam()
Why bother with the ()?
I code in other language too beside Python, in those languages there
are other things (like templates in D language) beside functions, so
my
r0g [EMAIL PROTECTED] wrote:
I'm collecting together a bunch of fairly random useful functions I have
written over the years into a module. Generally speaking is it best to
a) Import all the other modules these functions depend on into the
modules global namespace by putting them at the
Scott David Daniels wrote:
I would amend this advice by adding that you should (in such cases) put
a commented-out import at the top level (so you can look at the top of a
module's source and see what other modules it relies upon.
That's what your editor's search function is for.
--
I'm collecting together a bunch of fairly random useful functions I have
written over the years into a module. Generally speaking is it best to
a) Import all the other modules these functions depend on into the
modules global namespace by putting them at the top of the module or
should I...
b)
r0g [EMAIL PROTECTED] writes:
I'm collecting together a bunch of fairly random useful functions I have
written over the years into a module. Generally speaking is it best to
a) Import all the other modules these functions depend on into the
modules global namespace by putting them at the top
r0g:
a) Import all the other modules these functions depend on into the
modules global namespace by putting them at the top of the module or
should I...
b) Include them in each function individually.
This is a interesting topic, that requires some care.
Generally I suggest you put them at the
[EMAIL PROTECTED] wrote:
r0g:
a) Import all the other modules these functions depend on into the
modules global namespace by putting them at the top of the module or
should I...
b) Include them in each function individually.
This is a interesting topic, that requires some care.
Generally
[EMAIL PROTECTED] wrote:
r0g:
a) Import all the other modules these functions depend on into the
modules global namespace by putting them at the top of the module or
should I...
b) Include them in each function individually.
This is a interesting topic, that requires some care.
Generally I
On Nov 15, 9:08 pm, [EMAIL PROTECTED] wrote:
I also put a comment after each import, with the name of the function/
class it is used into:
import foo # used by baz()
import bar # used by spam()
Why bother with the ()? Why bother at all? Surely this rapidly becomes
tedious clutter:
import
r0g wrote:
The module I am compiling is kind of a scrapbook of snippets for my own
development use, it has no coherent theme and I wouldn't be distributing
it or using the whole thing in a production environment anyway, just
copying the relevant functions into a new module when needed. I'm
Robert Kern wrote:
r0g wrote:
The module I am compiling is kind of a scrapbook of snippets for my own
development use, it has no coherent theme and I wouldn't be distributing
it or using the whole thing in a production environment anyway, just
copying the relevant functions into a new module
12 matches
Mail list logo