470,814 Members | 805 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,814 developers. It's quick & easy.

Codetags (also Pylint/Pychecker + Variable declarations)

* Codetag PEP:

** I would like to comment on the codetags PEP, which I give a 0+.
I think the end "<>" is bad; I would be in favor of a block system or
something that looks more like regular Python (e.g. "#
:FIXME(line_count=10, date='2005-08-09', ...) ").

** As to the comments that say "Trac does the same functionality"
or "Eclipse/Eric/Emacs... has the same functionality" I think codetags
are orthogonal to that. Also, some of us still use the old vi to edit
a system script in an emergency, and relying on bloated silliness like
Eclipse for documenting code seems, well, against all that is good and

* Pylint:

** I also agree that a lint system is the place to enforce or
otherwise use things like codetags. A useful implementation would go a
long way to creating a standard organically.

* Variable declarations--a synthesis of codetags and lint:

** Perhaps a codetag system is the place to put variable
declarations, type checking, and the like. The lint system could grab
these and evaluate the code with them without messing with the compiler
or quick and dirty code styles. (Inferring properties of code from
static listings is for geniuses--not for me--so forgive any unrealistic
examples below). As an added benefit, there wouldn't be any
non-explicit checking to impede performance (but if you want, you can
always add assert's to your heart's content when it really matters,
which is rarely).

** Example

str_var = '' # :DECLARE(type='string')
flt_var = 0 # :DECLARE(type='float')
line_index = 0 # :DECLARE(type='int', min=0, max=10)
for line_index in range(-10, 10) # "maximum exceeded" warning
mispelled_flt_var = 1ine_index / 2.5 # "undeclared variable"
str_var = var + 1 # "type mismatch" warning

Thanks for everyone's patience in reading this--I hope it helps further
the Pythonic cause of graceful programming.

Oct 8 '05 #1
0 1135

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Neal Norwitz | last post: by
10 posts views Thread by Kylotan | last post: by
4 posts views Thread by beliavsky | last post: by
21 posts views Thread by Philippe Fremy | last post: by
8 posts views Thread by Micah Elliott | last post: by
20 posts views Thread by Micah Elliott | last post: by
5 posts views Thread by Tuomas | last post: by
7 posts views Thread by montyphyton | last post: by
reply views Thread by KLEIN Stephane | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.