cgi, parse_header and semi-colon

2008-06-06 Thread Sylvain
Hi,

I'm playing with Google App Engine and during my tests it seems that
there is a bug in cgi. parse_header function.

If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
cgi.FieldStorage.filename returns only "my" everything after the semi-
colon is missing

Is it a bug or i'm missing something ?

Regards
--
http://mail.python.org/mailman/listinfo/python-list


Re: cgi, parse_header and semi-colon

2008-06-07 Thread Sylvain
On Jun 6, 5:33 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote:
> "Sylvain" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") :
> > cgi.FieldStorage.filename returns only "my" everything after the semi-
> > colon is missing
>
> > Is it a bug or i'm missing something ?
>
> I doubt it's bug inparse_header, since it's meant to split on
> semicolons. Whether it's a bug in one of its callers, or the client
> not escaping sufficiently, I couldn't say offhand.

I've printed the filename in the content-disposition header :
filename="my;file.jpg"

If you look at the http://www.ietf.org/rfc/rfc2183.txt about "content-
disposition" :

"A short parameter value containing only ASCII characters, but
including `tspecials' characters, SHOULD be represented as `quoted-
string'."

So my header is correct but i think there is clearly a bug in the
parse_header and "content-disposition" should not be "splitted" only
with the split(';') method but should look at quoted-string too.

Regards
--
http://mail.python.org/mailman/listinfo/python-list


[ANN] Pylint 0.25.2 / ASTNG 0.24 / logilab-common 0.58.1 released

2012-07-18 Thread Sylvain Thénault
Hi there,

I've released this morning new versions of Pylint, ASTNG and logilab-common
projects. For more information, read http://www.logilab.org/blogentry/100365

Enjoy!

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (09.54.03.55.76)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.26 / logilab-astng 0.24.1

2012-10-08 Thread Sylvain Thénault
Hi all,

I'm very pleased to announce new releases of Pylint and
underlying ASTNG library, respectivly 0.26 and 0.24.1. The great
news is that both bring a lot of new features and some bug fixes,
mostly provided by the community effort.

We're still trying to make it easier to contribute on our free
software project at Logilab, so I hope this will continue and
we'll get even more contritions in a near future, and an even
smarter/faster/whatever pylint!

So many thanks to all those who made that release, and enjoy!

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Problem with long strings in the Boost.Python getting_started2 sample ?

2005-09-29 Thread Sylvain MARIE
Hi all,

I am discovering Boost.Python, and weird exceptions in my dummy extension 
modules lead me to think there is a potential problem with the 
getting_started2 sample :
if you replace the first lines

>>> hi = hello('California')
>>> hi.greet()
'Hello from California'

by
>>> hi = hello('A longer name with more than 15 chars')
>>> hi.greet()
'Hello from A longer name with more than 15 chars'

then the unit test asserts !?!? I get a c++ exception :-(

Please tell me we can use strings longer than 15 chars with Boost.Python :-)
(I'm using Boost 1.33.0 with VC7.1, and the bjam makefiles)

thank you very much in advance!
Sylvain 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem with long strings in the Boost.Python getting_started2 sample ?

2005-09-30 Thread Sylvain MARIE
Well, answering my own question here...

See http://mail.python.org/pipermail/c++-sig/2002-November/002415.html 
8-)

Sylvain


"Sylvain MARIE" <[EMAIL PROTECTED]> a écrit dans le message de news: 
[EMAIL PROTECTED]
> Hi all,
>
> I am discovering Boost.Python, and weird exceptions in my dummy extension 
> modules lead me to think there is a potential problem with the 
> getting_started2 sample :
> if you replace the first lines
>
>>>> hi = hello('California')
>>>> hi.greet()
> 'Hello from California'
>
> by
>>>> hi = hello('A longer name with more than 15 chars')
>>>> hi.greet()
> 'Hello from A longer name with more than 15 chars'
>
> then the unit test asserts !?!? I get a c++ exception :-(
>
> Please tell me we can use strings longer than 15 chars with Boost.Python 
> :-)
> (I'm using Boost 1.33.0 with VC7.1, and the bjam makefiles)
>
> thank you very much in advance!
> Sylvain
> 


-- 
http://mail.python.org/mailman/listinfo/python-list

[ANN] ASTNG 0.13

2005-10-22 Thread Sylvain Thénault
I'm please to announce the release of the Logilab's ASTNG package.
This package has been extracted from the logilab-common package, which
will be kept for some time for backward compatibility but will no
longer be maintained (this explains that this package is starting with
the 0.13 version number, since the fork occurs with the version
released in logilab-common 0.12).
See below for a description of what's inside...

What's new ?

* .locals  and .globals on scoped node handle now a list of references
  to each assigment statements instead of a single reference to the
  first assigment statement.

* fix bug with manager.astng_from_module_name when a context file is
  given (notably fix ZODB 3.4 crash with pylint/pyreverse)

* fix Compare.as_string method

* fix bug with lambda object missing the "type" attribute

* some minor refactoring


What is astng ?
---
The aim of this module is to provide a common base representation of
python source code for projects such as pychecker, pyreverse,
pylint... Well, actually the development of this library is essentialy
governed by pylint's needs.

It extends class defined in the compiler.ast module with some
additional methods and attributes. Instance attributes are added by a
builder object, which can either generate extended ast (let's call
them astng ;) by visiting an existant ast tree or by inspecting living
object. Methods are added by monkey patching ast classes.


Home page
-
http://www.logilab.org/projects/astng

Download

ftp://ftp.logilab.org/pub/astng

Mailing list
----
mailto://[EMAIL PROTECTED]

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] PyLint 0.8

2005-10-22 Thread Sylvain Thénault
Hi there !

I'm very please to announce the new 0.8 release of PyLint. I've promised
this release for a long time now, and finally got the time to do it :D.
This release includes a lot of bug fixes and enhancements. Notice that
a major change in this release is a new dependancy to the astng package
which has been extracted from logilab-common. This package is 
downloadable from http://www.logilab.org/projects/astng.

What's new ?

* check names imported from a module exists in the module (E0611),
  patch contributed by Amaury Forgeot d'Arc

* print a warning (W0212) for methods that could be a function
  (implements #9100)

* new --defining-attr-methods option on classes checker

* new --acquired-members option on the classes checker, used when
  --zope=yes to avoid false positive on acquired attributes (listed
  using this new option) (close #8616)

* generate one E0602 for each use of an undefined variable
  (previously, only one for the first use but not for the following)
  (implements #1000)

* make profile option saveable

* fix Windows .bat file,  patch contributed by Amaury Forgeot d'Arc

* fix one more false positive for E0601 (access before definition)
  with for loop such as "for i in range(10): print i" (test 
  func_noerror_defined_and_used_on_same_line)

* fix false positive for E0201 (undefined member) when accessing to
  __name__ on a class object
  
* fix astng checkers traversal order

* fix bug in format checker when parsing a file from a platform
  using different new line characters (close #9239)

* fix encoding detection regexp

* fix --rcfile handling (support for --rcfile=file, close #9590)


What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/projects/pylint/ for the
complete check list). The big advantage with Pylint is that it is
highly configurable, customizable, and you can easily write a small
plugin to add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list

mailto://[EMAIL PROTECTED]


Enjoy !
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] ASTNG 0.13.1

2005-11-07 Thread Sylvain Thénault
Hi there !

I'm pleased to announce a new bug fix release of ASTNG. This release
fixes a lot of bugs detected by pylint users, the most popular
application built on top of this package.


What's new ?

* fix bug on building from living module the same object in
  encountered more than once time (eg builtins.object) (close #10069)

* fix bug in Class.ancestors() regarding inner classes (close #10072)

* fix .self_resolve() on From and Module nodes to handle package
  precedence over module (close #10066)

* locals dict for package contains __path__ definition (close #10065)

* astng provide GenExpr and GenExprFor nodes with python >= 2.4
  (close #10063)

* fix python2.2 compatibility (close #9922)

* link .__contains__ to .has_key on scoped node to speed up execution

* remove no more necessary .module_object() method on From and Module
  nodes

* normalize parser.ParserError to SyntaxError with python 2.2


What is ASTNG
-
The aim of this module is to provide a common base representation of
python source code for projects such as pychecker, pyreverse,
pylint... Well, actually the development of this library is essentialy
governed by pylint's needs.

It extends class defined in the compiler.ast [1] module with some
additional methods and attributes. Instance attributes are added by a
builder object, which can either generate extended ast (let's call
them astng ;) by visiting an existant ast tree or by inspecting living
object. Methods are added by monkey patching ast classes.


Home page
-
http://www.logilab.org/projects/astng

Download

ftp://ftp.logilab.org/pub/astng

Mailing list

mailto://[EMAIL PROTECTED]


LOGILAB provides services in the fields of XML techniques and advanced
computing (implementation of intelligent agents, knowledge management,
natural language processing, statistical analysis, data mining, etc.),
and also trainings on Python, XML, UML, Object Oriented design, design
patterns use and other cutting edge topics. To know more about
Logilab, visit http://www.logilab.com/.

Logilab is also a strong supporter of the Free Software movement, and an
active member of the Python and Debian communities. Logilab's open 
source projects can be found on http://www.logilab.org/.

Enjoy!
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.8.1

2005-11-07 Thread Sylvain Thénault
Hi there !

I'm pleased to announce a new bug fix release of PyLint. Notice that a
lot of other bugs will be fixed by updating the logilab-astng package
to 0.13.1. Almost all bugs noticed by pylint users since the 0.8 is
out should be corrected by updating pylint and astng :)


What's new ?

* fix "deprecated module" false positive when the code imports a
  module whose name starts with a deprecated module's name (close
  #10061)

* fix "module has no name __dict__" false positive (close #10039)

* fix "access to undefined variable __path__" false positive (close
  #10065)

* fix "explicit return in __init__" false positive when return is
  actually in an inner function (close #10075)  


What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/projects/pylint/ for the
complete check list). The big advantage with Pylint is that it is
highly configurable, customizable, and you can easily write a small
plugin to add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list

mailto://[EMAIL PROTECTED]


Enjoy!
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyChecker messages

2005-01-11 Thread Sylvain Thenault
On Tue, 11 Jan 2005 06:54:54 +, Frans Englich wrote:
 
> Hello,

Hi

> I take PyChecker partly as an recommender of good coding practice

You may alos be interested by Pylint [1].

Pylint is less advanced in bug detection than pychecker, but imho its good
coding practice detection is more advanced and configurable (as the pylint
author, i'm a little biased... ;), including naming conventions, code
duplication, bad code smells, presence of docstring, etc...


Side note : I wish that at some point we stop duplicated effort between
pylint and pychecker. In my opinion that would be nice if each one focus
on its strenghs (as i said bugs detection for pychecker and convention
violation / bad code smell for pylint). That would be even better if both
tools could be merged in one, but (at least last time I took a look at
pychecker) the internal architecture is so different that it's not an easy
task today. Any thoughts ?

[1] http://www.logilab.org/projects/pylint

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


MemoryError with parser.suite and wrong encoding declaration

2005-01-18 Thread Sylvain Thenault
Hi there !
I've noticed the following problem with python >= 2.3 (actually 2.3.4 and
2.4):

[EMAIL PROTECTED]:test$ python
Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
[GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import parser
>>> parser.suite('# -*- coding: IBO-8859-1 -*-')
Traceback (most recent call last):
  File "", line 1, in ?
MemoryError
>>> parser.suite('# -*- coding: ISO-8859-1 -*-')


Shouldn't parser.suite just ignore the wrong encoding declaration, or at
least raise a more appropriate exception. IMHO the first solution
would be better, since that's the behaviour of the (C) python interpreter.

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MemoryError with parser.suite and wrong encoding declaration

2005-01-18 Thread Sylvain Thenault
On Tue, 18 Jan 2005 16:16:32 +0100, Thomas Heller wrote:

> Sylvain Thenault <[EMAIL PROTECTED]> writes:
> 
>> Hi there !
>> I've noticed the following problem with python >= 2.3 (actually 2.3.4
>> and 2.4):
>>
>> [EMAIL PROTECTED]:test$ python
>> Python 2.3.4 (#2, Sep 24 2004, 08:39:09) [GCC 3.3.4 (Debian 1:3.3.4-12)]
>> on linux2 Type "help", "copyright", "credits" or "license" for more
>> information.
>>>>> import parser
>>>>> parser.suite('# -*- coding: IBO-8859-1 -*-')
>> Traceback (most recent call last):
>>   File "", line 1, in ?
>> MemoryError
>>>>> parser.suite('# -*- coding: ISO-8859-1 -*-')
>> 
>>
>> Shouldn't parser.suite just ignore the wrong encoding declaration, or at
>> least raise a more appropriate exception. IMHO the first solution would
>> be better, since that's the behaviour of the (C) python interpreter.
> 
> Ignore the wrong declaration?  All Python's that I have (on windows, at
> least) raise a SyntaxError:
> 
>   File "x.py", line 1
> SyntaxError: 'unknown encoding: IBO-8859-1'

hum, right (with python >= 2.3 which is the first release using those
declaration...). I was sure to have checked this but I've obviously
missed something. Maybe the fact that being able to parse it anyway is
the solution I wish has driven me to write this ;) I would like this
behaviour so that pylint can check a module with a wrong encoding
declaration anyway. But at least, SyntaxError would be better than
MemoryError.

> See also:
> 
> http://www.python.org/sf/979739

thanks
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] PyLint 0.6

2005-01-21 Thread Sylvain Thenault
Hi there,

I'm very pleased to announce the 0.6 release of PyLint. This release
fix a lot of bugs and should be much more stable than the 0.5 release
where stopping actual import of analyzed modules has been introduced
(and that's really a huge improvment, since this was potentialy
introducing some side effects). There are also more documentation,
a better test suite, and also minor new features was added. Every
users of pylint should update to 0.6. Notice that Logilab's common
library 0.9 is required (http://www.logilab.org/projects/common). 

Enjoy !


What's new ?


* refix pylint emacs mode
* no more traceback when just typing "pylint"
* fix a bug which may cause crashes on resolving parent classes
* fix problems with the format checker: don't chock on files
  containing multiple CR, avoid C0322, C0323, C0324 false positives
  with triple quoted string with quote inside 
* correctly detect access to member defined latter in __init__ method
* now depends on common 0.8.1 to fix problem with interface resolution
  (close #8606) 
* new --list-msgs option describing available checkers and their
  messages
* added windows specific documentation to the README file, contributed
  by Brian van den Broek
* updated doc/features.txt (actually this file is now generated using
  the --list-msgs option), more entries into the FAQ
* improved tests coverage



What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/pylint/ for the complete
check list). The big advantage with Pylint is that it is highly
configurable, customizable, and you can easily write a small plugin to
add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list
----
mailto://[EMAIL PROTECTED]
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Maximum Number of Class Attributes

2005-01-26 Thread Sylvain Thenault
On Wed, 26 Jan 2005 02:03:12 +, Bob Parnes wrote:

> In its default configuration, my version of pylint (0.5.0) sets the
> maximum number of class attributes at 7. This seems low to me, but I can
> see how an excessive number might make maintenance more difficult. Is this
> indeed the best value for a maximum under ordinary conditions? If not, can
> anyone suggest a more  reasonable value?

well, this value is very subjective, and may change from one context to
another... For instance at some point I hope that pylint will detect "GUI"
classes and allow more attributes (and methods?) to those. 
Anyway that's just an indicator, not a rule of thumb (and pylint itself
has some class with more than 7 attributes...). 

And FYI, this value has been taken from a post to the
testdrivendevelopment at yahoogroups (as most others default values in the
"design analysis" checker). Hum, well... After checking it seems that the
post said 20 attributes. I don't remember why did i get this number down
to 7. If this discussion leads to an agreement for a better number, I
can change the default value.

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Next step after pychecker

2005-02-01 Thread Sylvain Thenault
On Tue, 01 Feb 2005 05:18:12 +0100, Philippe Fremy wrote:
>   Hi,

Hi

> I would like to develop a tool that goes one step further than pychecker
> to ensure python program validity. The idea would be to get close to what
> people get on ocaml: a static verification of all types of the program,
> without any kind of variable declaration. This would definitely brings a
> lot of power to python.
> 
> The idea is to analyse the whole program, identify constraints on function
> arguments and check that these constraints are verified by other parts of
> the program.

Did you take a look at the starkiller [1] and pypy projects [2] ?

> What is in your opinion the best tool to achieve this ? I had an
> extensive look at pychecker, and it could certainly be extended to do
> the job. Things that still concern me are that it works on the bytecode,
> which prevents it from working with jython and the new .NET python.
> 
> I am currently reading the documentation on AST and visitor, but I am
> not sure that this will be the best tool either. The AST seems quite
> deep and I am afraid that it will make the analysis quite slow and
> complicated.
 
are you talking about the ast returned by the "parser" module, or the ast
from the "compiler" module ? The former is a higher abstraction, using
specific class instances in the tree, and most importantly with all the
parsing junk removed. See [3]. You may also be interested in pylint
[4] which is a pychecker like program built in top of the compiler ast,
and so doesn't require actual import of the analyzed code. However it's
not yet as advanced as pychecker regarding bug detection.

And finally as another poster said you should probably keep an eye open
on the python 2.5 ast branch work...

Hope that helps !

[1]http://www.python.org/pycon/dc2004/papers/1/paper.pdf)
[2]http://codespeak.net/pypy/index.cgi?home
[3]http://www.python.org/doc/current/lib/module-compiler.ast.html
[4]http://www.logilab.org/projects/pylint

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Next step after pychecker

2005-02-02 Thread Sylvain Thenault
On Tue, 01 Feb 2005 16:27:48 -0600, John Roth wrote:

> 
> "Sylvain Thenault" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On Tue, 01 Feb 2005 05:18:12 +0100, Philippe Fremy wrote:
>>
>> Did you take a look at the starkiller [1] and pypy projects [2] ?
> 
> Has anything happened to Starkiller since PyCon 2004? The latest mention I
> can find on Google is a blog entry (by Ted Leung) on Aug 30 saying he
> wished someone would give the author some money to finish it and publish
> it.

nothing I'm aware of. Some people talked about it, but no news from
starkiller's author. However some posts mention that it already has some
usable output now.

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: making symlinks with distutils

2005-02-04 Thread Sylvain Thenault
On Fri, 04 Feb 2005 02:45:34 -0800, Michele Simionato wrote:

> I want to distribute a pure Python package with this structure:
> 
>>mypackage
>> __init__.py
>> module1.py
>> module2.py
>> ...
>> myexecutable.py
> 
> In particular, myexecutable.py is a script which is intended to be used
> from the command line via the shebang trick. I want to distribute on
> Unices.
> and I want a symlink
> 
> /usr/bin/myexecutable -> /mypackage/myexecutable.py
> 
> to be made at installation time, when the user runs "python setup.py
> install".
> 
> What is the recommanded way to do that? Do I need a postinstallation
> script or something like that?
> 
> I could do that in various way, but I don't see the obvious one, maybe
> because I am not a Dutch ;)

i'm not sure there is a standard way to do so with distutils.
My current way to handle executable scripts is to have a run() function in
the myexecutable.py module, and then to have a very simple myexecutable
script with the following content:

#!/usr/bin/python
from mypackage import myexecutable
myexecutable.run()

And then register this script using distutils'"scripts" keyword argument. 
This has the advantage that I can also create a very simple .bat file for
windows users without code duplication.

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: making symlinks with distutils

2005-02-04 Thread Sylvain Thenault
On Fri, 04 Feb 2005 04:01:25 -0800, Michele Simionato wrote:

>>From what I see in the docs, registering a script just normalize the
> shebang line, but does not install it in /usr/bin, nor make any symbolic
> links, so it is not what I am looking for.

Actually it does install it is $PREFIX/bin.

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: making symlinks with distutils

2005-02-04 Thread Sylvain Thenault
On Fri, 04 Feb 2005 04:59:51 -0800, Michele Simionato wrote:

> Sylvain Thenault:
>> Actually it does install it is $PREFIX/bin.
> 
> Aha! And how do I set $PREFIX? Is it a Unix environment variable or is it
> a keyword argument in setup? Something like setup( prefix="/usr") ?

it's a command line argument of the "install" command:

python setup.py install --prefix=~/

or

python setup.py install --home=~/

(the difference between --home and --prefix is that the former will
install library in $PREFIX/lib/pythonX.Y/site-packages while the latter
will install it in $PREFIX/lib/python/

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pylint 0.7

2005-08-05 Thread Sylvain Thenault
On Thu, 04 Aug 2005 14:50:18 -0400, François Pinard wrote:

> [Sylvain Thénault]
> 
>> I'm pleased to announce a new release of PyLint.
> 
> Bonjour Sylvain.  J'ai la compulsion de dire bonjour, et merci!  (On peut
> me tutoyer sans problème.)

Bonjour ! C'est une compulsion plutôt sympathique ! ;)

> Ce logiciel `pylint', que je viens d'installer et d'essayer pour la
> première fois ce matin (donc, j'écris encore sur l'effet d'une première
> impression), me semble vraiment excellent.

j'espère que l'impression sur le long terme sera la même !

> Plaisir supplémentaire, `logilab.common' semble contenir de bien belles
> choses, intéressantes pour moi, je vais regarder ça de plus près.

Il commence à y avoir pas mal de chose dans cette librairie, qui nous
sert un peu de fourre-tout pour tout le code qui est partagé entre
plusieurs de nos projets. Ça manque un peu de documentation, mais le code
devrait être à peu près propre, et n'hésite pas à nous poser des
questions au besoin.

> Étant moi-même plutôt tatillon sur les questions stylistiques, je suis
> heureux de trouver quelqu'un qui, en plus de parler ma langue, possède
> probablement le même défaut.

Effectivement, je suis un peu (bon d'accord, *très*) maniaque sur ces
questions :)

>> Please send any bugs or comments on the mailing list.
> 
> Dois-je vraiment passer par là?  Les discussions sont nécessairement un
> petit peu plus impersonnelles sur une liste.  Si oui, alors je le ferai,
> bien sûr.  J'imagine qu'il faut alors s'y inscrire aussi?

Effectivement, c'est un peu plus impersonnel mais ça à l'avantage
d'être archivé et la discussion est ainsi partagée avec les autres
utilisateurs de pylint. Si tu préfères écrire en français, il y a
aussi la liste [EMAIL PROTECTED], qui a un très faible trafic. Ces
deux listes (forum-fr et python-projects) demande effectivement un
abonnement, mais ce n'est pas requis pour poster, c'est juste que si tu
n'est pas membre les mails seront modérés, et donc mettront peut-être un
peu plus de temps à arriver. Après, je répond aussi aux mails perso ;)
Et si cela me semble intéressant de faire partager la réponse, je met la
liste en copie.

> De petites choses qui m'ont tout de suite sauté aux yeux:
> 
> * `pylint --version' devrait fournir l'adresse où rapporter les
> problèmes.
> 
> * `pylint --generate-rcfile' engendre un fichier qui possède trop
>   d'espace blanc intempestif, en particulier à la fin de plusieurs
>   lignes, et aussi, à la toute fin du fichier.  Il serait intéressant
>   aussi que le fichier engendré se tienne dans 79 colonnes: pas toujours
>   possible pour le code, j'en conviens, mais au moins faisable pour les
>   commentaires.

tu l'as généré sous windows ? Sous linux ça marche  bien, et les
commentaires sont wrappés correctement sur 80 colonnes. Je pense que
les espaces en trop sont aussi liés à ça. Il me semblait avoir déjà
corrigé ce pb, faudra que je trouve une machine windows pour rejeter un
oeil à ce problème.

> * `pylint --parseable=y' pourrait peut-être, sous option,
éviter
>   les noms de fichiers absolus et garder une notation relative, cela
>   éliminerait passablement de bruit lorsque le répertoire courant est
>   niché profondément.

je met ça dans notre tracker.

> * Malgré son origine française, `pylint' n'est pas sensible à un
> "locale"
>   français.  J'imagine que l'internationalisation n'est pas prévue?

c'est prévu depuis un moment, mais avec une priorité au plus bas :) ça
devrait pas être trop dur à faire, tous les messages étant regroupés
dans un dictionnaire pour chaque checker.

> Merci bien pour PYLINTHOME et PYLINTRC, les variables d'environnement.
> J'en fait déjà bon usage. :-)
> 
> D'une certaine manière dans la même mentalité de `pylint', j'ai
> produit une sorte de redresseur stylistique que j'utilise directement de
> l'intérieur de Vim.  J'ai probablement pensé un peu à Emacs tout
> aussi bien en l'écrivant, mais je n'ai pas utilisé Emacs depuis un bon
> moment.

toi, l'auteur de pymacs, passé à Vim ! Mais rien ne va plus ;)

>  Je désire bientôt replonger dans ce redresseur et le dépoussiérer
> sérieusement, pour un autre gros projet.  Il vaudrait peut-être la
> peine de voir s'il m'est possible d'harmoniser mon outil au tien, et
> vice-versa peut-être, un peu.  Du même jet, il m'intrigue de comparer
> le module `compiler' de Python 2.3, qui ne me satisfait plutôt bien,
> mais pas tout-à-fait, avec le module `astng' de Logilab.

le module astng est en fait une sur-couche du module compiler de la
librairie standard. Il n

Re: [ANN] pylint 0.7

2005-08-05 Thread Sylvain Thénault

On Thu, 04 Aug 2005 14:50:18 -0400, François Pinard wrote:

> [Sylvain Thénault]
> 
>> I'm pleased to announce a new release of PyLint.
> 
> Bonjour Sylvain.  J'ai la compulsion de dire bonjour, et merci!  (On peut
> me tutoyer sans problème.)

Bonjour ! C'est une compulsion plutôt sympathique ! ;)

> Ce logiciel `pylint', que je viens d'installer et d'essayer pour la
> première fois ce matin (donc, j'écris encore sur l'effet d'une première
> impression), me semble vraiment excellent.

j'espère que l'impression sur le long terme sera la même !

> Plaisir supplémentaire, `logilab.common' semble contenir de bien belles
> choses, intéressantes pour moi, je vais regarder ça de plus près.

Il commence à y avoir pas mal de chose dans cette librairie, qui nous
sert un peu de fourre-tout pour tout le code qui est partagé entre
plusieurs de nos projets. Ça manque un peu de documentation, mais le code
devrait être à peu près propre, et n'hésite pas à nous poser des
questions au besoin.

> Étant moi-même plutôt tatillon sur les questions stylistiques, je suis
> heureux de trouver quelqu'un qui, en plus de parler ma langue, possède
> probablement le même défaut.

Effectivement, je suis un peu (bon d'accord, *très*) maniaque sur ces
questions :)

>> Please send any bugs or comments on the mailing list.
> 
> Dois-je vraiment passer par là?  Les discussions sont nécessairement un
> petit peu plus impersonnelles sur une liste.  Si oui, alors je le ferai,
> bien sûr.  J'imagine qu'il faut alors s'y inscrire aussi?

Effectivement, c'est un peu plus impersonnel mais ça à l'avantage
d'être archivé et la discussion est ainsi partagée avec les autres
utilisateurs de pylint. Si tu préfères écrire en français, il y a
aussi la liste [EMAIL PROTECTED], qui a un très faible trafic. Ces
deux listes (forum-fr et python-projects) demande effectivement un
abonnement, mais ce n'est pas requis pour poster, c'est juste que si tu
n'est pas membre les mails seront modérés, et donc mettront peut-être un
peu plus de temps à arriver. Après, je répond aussi aux mails perso ;)
Et si cela me semble intéressant de faire partager la réponse, je met la
liste en copie.

> De petites choses qui m'ont tout de suite sauté aux yeux:
> 
> * `pylint --version' devrait fournir l'adresse où rapporter les
> problèmes.
> 
> * `pylint --generate-rcfile' engendre un fichier qui possède trop
>   d'espace blanc intempestif, en particulier à la fin de plusieurs
>   lignes, et aussi, à la toute fin du fichier.  Il serait intéressant
>   aussi que le fichier engendré se tienne dans 79 colonnes: pas toujours
>   possible pour le code, j'en conviens, mais au moins faisable pour les
>   commentaires.

tu l'as généré sous windows ? Sous linux ça marche  bien, et les
commentaires sont wrappés correctement sur 80 colonnes. Je pense que
les espaces en trop sont aussi liés à ça. Il me semblait avoir déjà
corrigé ce pb, faudra que je trouve une machine windows pour rejeter un
oeil à ce problème.

> * `pylint --parseable=y' pourrait peut-être, sous option,
éviter
>   les noms de fichiers absolus et garder une notation relative, cela
>   éliminerait passablement de bruit lorsque le répertoire courant est
>   niché profondément.

je met ça dans notre tracker.

> * Malgré son origine française, `pylint' n'est pas sensible à un
> "locale"
>   français.  J'imagine que l'internationalisation n'est pas prévue?

c'est prévu depuis un moment, mais avec une priorité au plus bas :) ça
devrait pas être trop dur à faire, tous les messages étant regroupés
dans un dictionnaire pour chaque checker.

> Merci bien pour PYLINTHOME et PYLINTRC, les variables d'environnement.
> J'en fait déjà bon usage. :-)
> 
> D'une certaine manière dans la même mentalité de `pylint', j'ai
> produit une sorte de redresseur stylistique que j'utilise directement de
> l'intérieur de Vim.  J'ai probablement pensé un peu à Emacs tout
> aussi bien en l'écrivant, mais je n'ai pas utilisé Emacs depuis un bon
> moment.

toi, l'auteur de pymacs, passé à Vim ! Mais rien ne va plus ;)

>  Je désire bientôt replonger dans ce redresseur et le dépoussiérer
> sérieusement, pour un autre gros projet.  Il vaudrait peut-être la
> peine de voir s'il m'est possible d'harmoniser mon outil au tien, et
> vice-versa peut-être, un peu.  Du même jet, il m'intrigue de comparer
> le module `compiler' de Python 2.3, qui ne me satisfait plutôt bien,
> mais pas tout-à-fait, avec le module `astng' de Logilab.

le module astng est en fait une sur-couche du module compiler de la
librairie standard. Il n

.pth files

2005-08-09 Thread Sylvain Thenault
Hi there !

I've some questions regarding pth files (which btw are undocumented in the
python reference, is this intentional ?)

I thought that I could use a .pth file to be able to import zope products
from both INSTANCE_HOME/Products and ZOPE_HOME/lib/python/Products from
outside zope:


[EMAIL PROTECTED]:~$ cat cvs_work/Products.pth 
/home/syt/local/Zope-2.8.1-b1/Products
/home/syt/local/Zope-2.8.1-b1/lib/python/Products
[EMAIL PROTECTED]:~$ 
[EMAIL PROTECTED]:~$ python
Python 2.3.5 (#2, Jun 19 2005, 13:28:00) 
[GCC 3.3.6 (Debian 1:3.3.6-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/home/syt/cvs_work', '/home/syt/cvs_work/prive/soft', 
 '/home/syt/local/lib/python2.3/site-packages',
 '/home/syt/local/lib/python', '/usr/lib/python23.zip',
 '/usr/lib/python2.3', '/usr/lib/python2.3/plat-linux2',
 '/usr/lib/python2.3/lib-tk', '/usr/lib/python2.3/lib-dynload',
 '/usr/local/lib/python2.3/site-packages',
 '/usr/lib/python2.3/site-packages',
 '/usr/lib/python2.3/site-packages/Numeric',
 '/usr/lib/python2.3/site-packages/PIL',
 '/usr/lib/python2.3/site-packages/gtk-2.0',
 '/usr/lib/python2.3/site-packages/vtk_python', '/usr/lib/site-python']

But as you can see, 
1. the Products.pth file isn't considered at all, while for example
   PIL.pht in the site-packages is correctly detected
2. I'm not even sure that I can put several paths in a .pth file

Is there a restriction on .pth location ? Is it possible to have multiple
path in a pth file ?

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: .pth files

2005-08-09 Thread Sylvain Thenault
On Tue, 09 Aug 2005 09:37:47 +, Adriano Varoli Piazza wrote:

> Sylvain Thenault ha scritto:
>> Hi there !
>> 
>> I've some questions regarding pth files (which btw are undocumented in
>> the python reference, is this intentional ?)
>> 
>> I thought that I could use a .pth file to be able to import zope
>> products from both INSTANCE_HOME/Products and
>> ZOPE_HOME/lib/python/Products from outside zope:
>> 
>> 
>> [EMAIL PROTECTED]:~$ cat cvs_work/Products.pth
>> /home/syt/local/Zope-2.8.1-b1/Products
>> /home/syt/local/Zope-2.8.1-b1/lib/python/Products [EMAIL PROTECTED]:~$
>> [EMAIL PROTECTED]:~$ python
>> Python 2.3.5 (#2, Jun 19 2005, 13:28:00) [GCC 3.3.6 (Debian 1:3.3.6-6)]
>> on linux2 Type "help", "copyright", "credits" or "license" for more
>> information.
>> 
>>>>>import sys
>>>>>print sys.path
>> 
>> ['', '/home/syt/cvs_work', '/home/syt/cvs_work/prive/soft',
>>  '/home/syt/local/lib/python2.3/site-packages',
>>  '/home/syt/local/lib/python', '/usr/lib/python23.zip',
>>  '/usr/lib/python2.3', '/usr/lib/python2.3/plat-linux2',
>>  '/usr/lib/python2.3/lib-tk', '/usr/lib/python2.3/lib-dynload',
>>  '/usr/local/lib/python2.3/site-packages',
>>  '/usr/lib/python2.3/site-packages',
>>  '/usr/lib/python2.3/site-packages/Numeric',
>>  '/usr/lib/python2.3/site-packages/PIL',
>>  '/usr/lib/python2.3/site-packages/gtk-2.0',
>>  '/usr/lib/python2.3/site-packages/vtk_python', '/usr/lib/site-python']
>> 
>> But as you can see,
>> 1. the Products.pth file isn't considered at all, while for example
>>PIL.pht in the site-packages is correctly detected
>> 2. I'm not even sure that I can put several paths in a .pth file
>> 
>> Is there a restriction on .pth location ? Is it possible to have
>> multiple path in a pth file ?
>> 
>> 
>  From Learning Python, 2nd Ed:
> "a relatively new feature of Python allows users to add valid directories
> to the module search path by simply listing them, one per line, in a text
> file whose name ends in a .pth suffix.
> 
> See also the docs for the site module in the Python Library reference.

ha, so that's where it's documented ! 
so answer are:
1. Products.pth are only considered in standard site-packages and
   site-python directories
2. yes, it's possible

Now, the question become: why can't we use pth files in other path
specified by the PYTHONPATH environement variable ?

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


__getattribute__ for class object

2005-08-12 Thread Sylvain Ferriol
hello
when i define __getattribute__ in a class, it is for the class instances
but if i want to have a __getattribute__ for class attributes

how can i do that ?

sylvain
-- 
http://mail.python.org/mailman/listinfo/python-list


weird behaviour of "0 in [] is False"

2004-11-30 Thread Sylvain Thenault
Hi there !

Can someone explain me the following behaviour ?

>>> l = []
>>> 0 in (l is False)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: iterable argument required
>>> (0 in l) is False
True
>>> 0 in l is False
False


This is really obscur to me...

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: weird behaviour of "0 in [] is False"

2004-11-30 Thread Sylvain Thenault
On Tue, 30 Nov 2004 14:18:30 +0100, Diez B. Roggisch wrote:

>>>>> l = []
>>>>> 0 in (l is False)
>> Traceback (most recent call last):
>>   File "", line 1, in ?
>> TypeError: iterable argument required
> 
> that should be clear - 0 in False can't work.

yes, I forget to mention that it was the third expression which was
bugging me.

>>>>> (0 in l) is False
>> True
>>>>> 0 in l is False
>> False
> 
> It seems to stem from a behaviour python exhibits in expressions like
> this:
> 
> 3 > 2  > 1
> 
> This yields True, while
> 
> (3 > 2 ) > 1
> 
> yields false. Chaining of operators gets translated like this:
> 
> 3 > 2 and 2 > 1
> 
> Look in section 5.9 of the language reference.
> 
> Then your expression gets translated to:
> 
> 0 in l and l is False
> 
> which yields False of course.

thanks, I had missed this part of the language reference !
Not yet found an misbehaviour in python... ;)

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


import with "python -O"

2004-12-30 Thread Sylvain Thenault
Hi there !

I'm usually relying on the fact that pyc file are autogenerated when
necessary (ie usually when the py file has been modified since the pyc
creation). However, it doesn't seems to work correctly when the -O option
is given to the interpreter :

[EMAIL PROTECTED]:test$ python
Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
[GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
.>>> from logilab import pylint
.>>> pylint.__file__
'/home/syt/cvs_work/logilab/pylint/__init__.pyc'
.>>>
[EMAIL PROTECTED]:test$ python -O
Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
[GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
.>>> from logilab import pylint
.>>> pylint.__file__
'/usr/lib/python2.3/site-packages/logilab/pylint/__init__.pyo'

The PYTHONPATH has not changed but the interpreter seems to take the first
pyo it finds, even if there is a more recent .py file before in the python
path. Should this behaviour be considered as normal ?

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: import with "python -O"

2004-12-30 Thread Sylvain Thenault
On Thu, 30 Dec 2004 16:56:17 +0100, Sylvain Thenault wrote:

> Hi there !
> 
> I'm usually relying on the fact that pyc file are autogenerated when
> necessary (ie usually when the py file has been modified since the pyc
> creation). However, it doesn't seems to work correctly when the -O option
> is given to the interpreter :
> 
> [EMAIL PROTECTED]:test$ python
> Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
> [GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> .>>> from logilab import pylint
> .>>> pylint.__file__
> '/home/syt/cvs_work/logilab/pylint/__init__.pyc'
> .>>>
> [EMAIL PROTECTED]:test$ python -O
> Python 2.3.4 (#2, Sep 24 2004, 08:39:09)
> [GCC 3.3.4 (Debian 1:3.3.4-12)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> .>>> from logilab import pylint
> .>>> pylint.__file__
> '/usr/lib/python2.3/site-packages/logilab/pylint/__init__.pyo'
> 
> The PYTHONPATH has not changed but the interpreter seems to take the first
> pyo it finds, even if there is a more recent .py file before in the python
> path. Should this behaviour be considered as normal ?

ok, my fault... The problem was that the logilab subdirectory didn't have
anymore the __init__.py file, but only the __init__.pyc file. Adding it
fix the problem.
Thank you four your attention.

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.6.4

2005-04-14 Thread Sylvain Thénault
Hello all,

I'm pleased to announce a new release of PyLint. This release mainly
fixes multivalued options bug and a systematic crash with python 2.2.
Users should also use the latest logilab's common library (0.9.3).


What's new ?

* allow to parse files without extension when a path is given on the
  command line (test noext)

* don't fail if we are unable to read an inline option  (e.g. inside a
  module), just produce an information message (test func_i0010)

* new message E0103 for break or continue outside loop (close #8883,
  test func_continue_not_in_loop)

* fix bug in the variables checker, causing non detection of some
  actual name error (close #8884, test
  func_nameerror_on_string_substitution)

* fix bug in the classes checker which was making pylint crash if
  "object" is assigned in a class inheriting from it (test 
  func_noerror_object_as_class_attribute)

* fix problem with the similar checker when related options are
  defined in a configuration file

* new --generate-man option to generate pylint's man page (require the
  latest logilab.common (>= 0.9.3)

* packaged (generated...) man page


What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/pylint/ for the complete
check list). The big advantage with Pylint is that it is highly
configurable, customizable, and you can easily write a small plugin to
add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list
--------
mailto://[EMAIL PROTECTED]


-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


connection refused when uploading a package to pypi

2005-04-14 Thread Sylvain Thenault
Hi !
I got a connection refused when I try to upload a package using "python
setup.py register". However login using the web interface works well. Does
anyone has the same problem or is it a problem on my side ?


[EMAIL PROTECTED]:pylint$ python setup.py register
running register
We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]:
Username: logilab
Password:
Server response (500): 

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Coding Standards (and Best Practices)

2005-04-27 Thread Sylvain Thenault
On Tue, 26 Apr 2005 11:02:33 -0700, Trent Mick wrote:

> [Isaac Rodriguez wrote]
>> Hi,
>> 
>> I am fairily new to Python, but I am really liking what I am seeing. My team 
>> is going to re-design some automation projects, and we were going to use 
>> Python as our programming language. One of the things we would like to do, 
>> since we are all new to the language, is to define a set of guidelines and 
>> best practices as our coding standards.
>> 
>> Does anyone know where I can get some information about what the community 
>> is doing? Are there any well defined guidelines established?
> 
> http://www.python.org/peps/pep-0008.html

and you may also be interested by a tool such as pylint[1] which help to
enforce coding standards on your code base. Most of the styles suggested
in pep 8 are checked by pylint, using its default configuration.

[1] http://www.logilab.org/projects/pylint/

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [Pylint-dev] Pylint 1.5.0 / Astroid 1.4.1 released

2015-12-01 Thread Sylvain Thénault
On 01 décembre 01:42, Claudiu Popa wrote:
> Hello,

Hi Claudiu, 

> I'm happy to announce you the release of Pylint 1.5.0,
> respectively Astroid 1.4.1.
> 
> It's been over a year since the last major release
> and the amount of changes that were brought into pylint
> in this time is humongous, with over 30 new checks
> and tons of bug fixes.
> 
> I would like to use this occasion for thanking for their contributions
> the new committers who joined pylint's team in the past months,
> ceridwen and Dmitry, as well as thanking the
> contributors that made this release possible.

Excellent! Congrat to this new core team which have realized a tremendous amount
of work.
 
> Here are some of the major changes of this release:

[...] 

> - We also added a new 'extensions' component, which contains optional
>   checkers that needs to be activated explicitly.
> 
>   These includes 'extensions.check_docs', which verifies a bunch of
>   properties of the docstrings, such as checking that all function,
>   method and constructor parameters are mentioned
>   in the params and types part of the docstring. Also, it checks that
>   there are no naming inconsistencies between the signature and
>   the documentation, i.e. also report documented parameters that are missing
>   in the signature. This is important to find cases where parameters are
>   renamed only in the code, not in the documentation.
> 
>   Activate this checker with:
> 
>   --load-plugins=pylint.extensions.check_docs

To be fair, there is also `pylint.extensions.check_elif` extension
that emit message for 'else: if ' that could be written in 'elif '

Regards,
-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] Pylint 1.2 released

2014-04-22 Thread Sylvain Thénault
Hi there,

Pylint 1.2 has been uploaded to pypi by the end of the last week! More info on 
this heavy release on http://www.logilab.org/blogentry/240019.

As usual, feedback and comments welcome.

Enjoy!
-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
https://mail.python.org/mailman/listinfo/python-list


Astroid 1.0 released

2013-08-02 Thread Sylvain Thénault
Astroid_ is the new name of former logilab-astng library. It's an AST library,
used as the basis of Pylint_ and including Python 2.5 -> 3.3 compatible tree
representation, statical type inference and other features useful for advanced
Python code analysis, such as an API to provide extra information when
statistical inference can't overcome Python dynamic nature (see the
`pylint-brain`_ project for instance).

It has been renamed and hosted to bitbucket to make clear that this is not a
Logilab dedicated project but a community project that could benefit to any
people manipulating Python code (statistical analysis tools, IDE, browser, etc).

Documentation is a bit rough but should quickly improve. Also a dedicated
web-site is now online, visit www.astroid.org (or
https://bitbucket.org/logilab/astroid for development).

You may download and install it from Pypi or from `Logilab's debian
repositories`_.


.. _Pylint: http://www.pylint.org
.. _`Logilab's debian repositories`: http://www.logilab.org/bookmark/4621/follow
.. _Astroid: http://www.astroid.org
.. _`pylint-brain`: https://bitbucket.org/logilab/pylint-brain


Enjoy!

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Pylint 1.0 released

2013-08-06 Thread Sylvain Thénault
Hi there,

at last, Pylint 1.0 is out! See http://www.logilab.org/blogentry/163292
for (much) more info and enjoy!

And many thanks to every one who contributed to this release...
-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] PyLint 0.27 / logilab-astng 0.24.2

2013-02-28 Thread Sylvain Thénault
Hi there,

I'm very pleased to announce the release of pylint 0.27 [1] and
logilab-astng 0.24.2 [2] . There has been a lot of enhancements and
bug fixes since the latest release, so you're strongly encouraged
to upgrade. See ChangeLog for details.

Many thanks to all the people who contributed to this release!

[1] http://www.logilab.org/project/pylint/0.27.0 /
[2] http://www.logilab.org/project/logilab-astng/0.24.2

Enjoy!
-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] PyLint 0.27 / logilab-astng 0.24.2

2013-03-04 Thread Sylvain Thénault
On 01 mars 07:41, Melton Low (devl) wrote:
> Hi Sylvain,

Hi,
 
> Clicking on the download linked from [1] below gives me an error.
> Same with logilab-astng link [2].
> 
> Not Found
> 
> The requested URL /pub/pylint/pylint-0.27.0.tar.gz was not found on
> this server.
> 
> Apache/2.2.16 (Debian) mod_ssl/2.2.16 OpenSSL/0.9.8o Server at
> download.logilab.org Port 80
> 
> Maybe I need to wait for the server to be updated?

sorry, I forgot a step. Fixed now.

thx and sorry for the incovenience
-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
http://mail.python.org/mailman/listinfo/python-list


fixed broken links for the latest pylint/astng release

2013-03-04 Thread Sylvain Thénault
Hi there,

last week I announced the latest and greatest pylint/astng release 
but didn't noticed at that time that the download links on our web site 
were broken, and that the upload to pypi failed.

This is now fixed, for those who tried during the mean time.

Sorry for the convenience,
-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Logging: Formatter: name of the function

2005-12-23 Thread Sylvain Defresne
Le vendredi 23 décembre 2005 à 16:23 +0100, Gregor Horvath a écrit :
> Hi,
> 
> Is there a possibility to format a log message to give the function name 
> where the log appears?
> 
> Example
> 
> import logging
> 
> def aTestFunction():
>logger.debug("This is a message")
> 
> The log should read:
> 
> aTestFunction  This is a message.

You can use the currentframe of the inspect module. For example :

>>> import inspect
>>> def debug(string):
... frame = inspect.currentframe(1)
... print frame.f_code.co_name, string
>>> def a_test_function():
... debug("This is a message")
>>> a_test_function()
a_test_function This is a message

But please take note that this is not recommended. As stated in the
documentation of inspect.currentframe : "[t]his function should be used
for internal and specialized purposes only."
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

-- 
http://mail.python.org/mailman/listinfo/python-list

[ANN] astng 0.14

2006-01-10 Thread Sylvain Thénault
Hi !

I'm pleased to announce the new 0.14 version of astng. This release mainly
provides some major internal and api changes to have a richer model and a 
start for static inference on ast nodes.

What's new ?

* some major inference improvments and refactoring ! The drawback is
  the introduction of some non backward compatible change in the API 
  but it's imho much cleaner and powerful now :)
* new boolean property .newstyle on Class nodes (implements #10073)
* new .import_module method on Module node to help in .resolve
  refactoring 
* .instance_attrs has list of assignments to instance attribute
  dictionary as value instead of one
* added missing GenExprIf and GenExprInner nodes, and implements
  as_string for each generator expression related nodes
* specifically catch KeyboardInterrupt to reraise it in some places
* fix so that module names are always absolute
* fix .resolve on package where a subpackage is imported in the
  __init__ file
* fix a bug regarding construction of Function node from living object
  with realier version of python 2.4
* fix a NameError on Import and From self_resolve method
* fix a bug occuring when building an astng from a living object with
  a property
* lint fixes


What is astng ?
---
The aim of this module is to provide a common base representation of
python source code for projects such as pychecker, pyreverse,
pylint... Well, actually the development of this library is essentialy
governed by pylint's needs.

It extends class defined in the compiler.ast [1] module with some
additional methods and attributes. Instance attributes are added by a
builder object, which can either generate extended ast (let's call
them astng ;) by visiting an existant ast tree or by inspecting living
object. Methods are added by monkey patching ast classes.


Home page
-
http://www.logilab.org/projects/astng

Download

ftp://ftp.logilab.org/pub/astng

Mailing list

mailto://[EMAIL PROTECTED]

LOGILAB provides services in the fields of XML techniques and advanced
computing (implementation of intelligent agents, knowledge management,
natural language processing, statistical analysis, data mining, etc.),
and also trainings on Python, XML, UML, Object Oriented design, design
patterns use and other cutting edge topics. To know more about
Logilab, visit http://www.logilab.com/.

Logilab is also a strong supporter of the Free Software movement, and an
active member of the Python and Debian communities. Logilab's open 
source projects can be found on http://www.logilab.org/.


Enjoy and happy new year !
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] PyLint 0.9

2006-01-10 Thread Sylvain Thénault
Hi !

I'm very pleased to announce the new 0.9 release of PyLint. This release
provides a lot of bug fixes and some new checks and other minor changes.
This release depends on the latest astng and logilab-common release (i.e.
0.14 and 0.13 respectivly), so install them before this one. The good news 
is that the new astng inference capabilities should allow to add powerful
checks to pylint in a new future :o)


What's new ?

2006-01-10  --  0.9.0
* a lot of updates to follow astng 0.14 API changes, so install
  logilab-astng  0.14 or greater before using this version of pylint

* checker number 10 ! newstyle will search for problems regarding old
  style / new style classes usage problems (rely on astng 0.14 new
  style detection feature)

* new 'load-plugins' options to load additional pylint plugins (usable
  from the command line or from a configuration file) (implements
  #10031)

* check if a "pylintrc" file exists in the current working directory
  before using the one specified in the PYLINTRC environment variable
  or the default ~/.pylintrc or /etc/pylintrc

* fixed W0706 (Identifier used to raise an exception is assigned...)
  false positive and reraising a catched exception instance

* fixed E0611 (No name get in module blabla) false positive when accessing
  to a class'__dict__

* fixed some E0203 ("access to member before its definition") false
  positive

* fixed E0214 ("metaclass method frist argument should be mcs) false
  positive with staticmethod used on a metaclass 

* fixed packaging which was missing the test/regrtest_data directory

* W0212 (method could be a function) has been reclassified in the
  REFACTOR category as R0201, and is no more considerer when a method
  overrides an abstract method from an ancestor class

* include module name in W0401 (wildcard import), as suggested by
  Amaury

* when using the '--parseable', path are written relative to the
  current working directory if in a sub-directory of it (#9789)

* 'pylint --version' shows logilab-astng and logilab-common versions

* fixed pylint.el to handle space in file names

* misc lint style fixes


What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/projects/pylint/ for the
complete check list). The big advantage with Pylint is that it is
highly configurable, customizable, and you can easily write a small
plugin to add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list
----
mailto://[EMAIL PROTECTED]


Enjoy and happy new year !
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] logilab-common 0.13

2006-01-10 Thread Sylvain Thénault
Hi !

I'm pleased to announce the 0.13 new release of the logilab-common package.
This release provides some bug fixes and minor enhancements and api changes
which shouldn't break backward compatibility, so users are strongly
encouraged to update.

What's new ?

* testlib: ability to skip a test
* configuration:
  - cleaner configuration file generation
  - refactoring so that we can have more control on file
configuration loading using read_config_file and load_config_file
instead of load_file_configuration
* modutils: fix is_relative to return False when from_file is a file
  located somewhere in sys.path
* compat: make set iterable and support more other set operations...
* removed the astng sub-package, since it's now self-distributed as
  logilab-astng


What is logilab-common ?

logilab-common is a collection of low-level Python packages and modules,
 designed to ease:
  * handling command line options and configuration files
  * writing interactive command line tools
  * manipulation files and character strings
  * interfacing to OmniORB
  * generating of SQL queries
  * running unit tests
  * manipulating tree structures
  * accessing RDBMS (currently postgreSQL and mysql)
  * generating text and HTML reports
  * logging


Home page
-
http://www.logilab.org/projects/common

Download

ftp://ftp.logilab.org/pub/common

Mailing list

mailto://[EMAIL PROTECTED]

LOGILAB provides services in the fields of XML techniques and advanced
computing (implementation of intelligent agents, knowledge management,
natural language processing, statistical analysis, data mining, etc.),
and also trainings on Python, XML, UML, Object Oriented design, design
patterns use and other cutting edge topics. To know more about
Logilab, visit http://www.logilab.com/.

Logilab is also a strong supporter of the Free Software movement, and an
active member of the Python and Debian communities. Logilab's open 
source projects can be found on http://www.logilab.org/.


Enjoy, and happy new year!

-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] APyCoT 0.8

2006-01-10 Thread Sylvain Thénault
Hi !

I'm pleased to announce the new 0.8 release of the APyCoT package. This 
release provides some new minor functionnalities.

What's new ?

* use package's pylintrc if a file named "pylintrc"  is found under
  the checked out directory (implements #10177)
* "${TESTDIR}" in environment variable declared in the tests .ini file
  will be sustitued with the tests execution directory
* run tests with all python versions declared usable in the
  __pkginfo__ file
* added a new "partial" checker status, used by the unittest checker
  when all tests have passed but some have been skipped
* minor fix in html rendering of the synthetized_report



What is iAPyCoT ?
-
This package is designed to run tests on a code repository on a
daily basis. It comes with a set of predefined test, essentially for python 
packages, and a set of predefined reports to display execution results. 
However, it has been designed to be higly extensible, so you could write your 
own test or report using the Python language (i.e. this framework is NOT 
limited to test Python code !).


Home page
-
http://www.logilab.org/projects/apycot

Download

ftp://ftp.logilab.org/pub/apycot

Mailing list

mailto://[EMAIL PROTECTED]

LOGILAB provides services in the fields of XML techniques and advanced
computing (implementation of intelligent agents, knowledge management,
natural language processing, statistical analysis, data mining, etc.),
and also trainings on Python, XML, UML, Object Oriented design, design
patterns use and other cutting edge topics. To know more about
Logilab, visit http://www.logilab.com/.

Logilab is also a strong supporter of the Free Software movement, and an
active member of the Python and Debian communities. Logilab's open 
source projects can be found on http://www.logilab.org/.


Enjoy and happy new year !
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] devtools 0.8

2006-01-10 Thread Sylvain Thénault
Hi !

I'm pleased to announce the new 0.8 release of the devtools package. 
This release provides some bug fixes and major changes into the debian 
package generation. 

What's new ?

* debianize:
* updated to handle site-python installation with architecture
independant package (implements #10119)
* consider the optional debian_uploader variable in package
information 
* fix .examples files generation with debianize
* fix templates: control.standard-version is now 3.6.2, updated FSF
address in debian licenses files

* fix package type detection in preparedistrib (fix #9917)



What is devtools ?
--
Set of tools which aims to help the developpement process, including :
* standard for zope and python packages
* tools to check and build source and/or debian packages
* python coverage tool
* cvs utilities


Home page
-
http://www.logilab.org/projects/devtools

Download

ftp://ftp.logilab.org/pub/devtools

Mailing list

mailto://[EMAIL PROTECTED]

LOGILAB provides services in the fields of XML techniques and advanced
computing (implementation of intelligent agents, knowledge management,
natural language processing, statistical analysis, data mining, etc.),
and also trainings on Python, XML, UML, Object Oriented design, design
patterns use and other cutting edge topics. To know more about
Logilab, visit http://www.logilab.com/.

Logilab is also a strong supporter of the Free Software movement, and an
active member of the Python and Debian communities. Logilab's open 
source projects can be found on http://www.logilab.org/.


Enjoy and happy new year !
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


is it a bug ?

2006-10-23 Thread Sylvain Ferriol
hello
can you explain to me what happened:

class toto(object):
   eq = float.__eq__

t = toto()

getattr(t,'eq')
TypeError: descriptor '__eq__' for 'float' objects doesn't apply to 
'toto' object

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is it a bug ?

2006-10-23 Thread Sylvain Ferriol
Fredrik Lundh a écrit :
> Sylvain Ferriol wrote:
> 
>> can you explain to me what happened:
>>
>> class toto(object):
>>eq = float.__eq__
>>
>> t = toto()
>>
>> getattr(t,'eq')
>> TypeError: descriptor '__eq__' for 'float' objects doesn't apply to 
>> 'toto' object
> 
> 
> I'd say the error message explains it pretty well.  what did you expect 
> this to do?
> 
i just want a class variable named 'eq', i could understand if its name 
was '__eq__'.
class toto(object):
   __eq__ = float.__eq__

why i can not create some class variables like this ?
class toto(object):
   a= float.__eq__
   b= str.__eq__
   ..



> 
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is it a bug ?

2006-10-23 Thread Sylvain Ferriol
Peter Otten a écrit :
> Sylvain Ferriol wrote:
> 
> 
>>can you explain to me what happened:
>>
>>class toto(object):
>>   eq = float.__eq__
>>
>>t = toto()
>>
>>getattr(t,'eq')
>>TypeError: descriptor '__eq__' for 'float' objects doesn't apply to
>>'toto' object
> 
> 
> float.__eq__ is probably implemented in C and its operation will make sense
> only for instances of float or subclasses of float. Try
> 
> 
>>>>class Toto(float):
> 
>  eq = float.__eq__
> 
> 
>>>>Toto().eq(42)
> 
> False
> 
i can not use it because:
class toto(float):
   def __init__(self,a=None):pass

t=toto(a=3)
TypeError: 'a' is an invalid keyword argument for this function
> Peter
-- 
http://mail.python.org/mailman/listinfo/python-list


class method question

2006-10-25 Thread Sylvain Ferriol
hello
can you explain why python does not see difference between instance 
method and class method, having the same name

example
 >>> class toto(object):
... def f(self):
... print('instance method')
... @classmethod
... def f(cls):
... print('class method')
...
 >>> t=toto()
 >>> t.f
>
 >>> t.f()
class method
 >>> toto.f()
class method


if i do the same in ruby:
"""
class Toto
   def meth
 print "instance method\n"
   end

   def Toto.meth
 print "class method\n"
   end
end

i = Toto.new
i.meth
Toto.meth
"""

$> ruby1.9 test_classmethod.rb
instance method
class method

thanks
sylvain
-- 
http://mail.python.org/mailman/listinfo/python-list


a new object definition

2006-09-01 Thread Sylvain Ferriol
hello everybody,

i want to talk with you about a question i have in mind and i do not
find a answer. it 's simple:
why do we not have a beatiful syntax for object definition as we have
for class definition ?

we can define a class in python in 2 ways:
  1. by using the metaclass constructor
my_class = MyMetaClass()
  2. by using the classic definition syntax:
class my_class(object):
   __metaclass__ = MyMetaClass

if i want to instanciate an object, i only have one way to define it:
  my_obj = my_class()

why not a better syntax like class syntax ?

example:
>> instance my_obj:
>>   __class__ = my_class


with this syntax, we are coherent between objects and classes.
why do we have a specific syntax for the class object definition and not
for objects of different type?

so if i want to define a new class object (my_class for example) with a
new object syntax:
>> instance my_class:
>>   __class__ = object
>>   __metaclass__ = MyMetaClass
>>   

thanks

Sylvain Ferriol
Ingénieur de recherche
Laboratoire TIMC/IMAG
http://www-timc.imag.fr/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a new object definition

2006-09-01 Thread Sylvain Ferriol
Michele Simionato a écrit :
> Sylvain Ferriol wrote:
> 
>>hello everybody,
>>
>>i want to talk with you about a question i have in mind and i do not
>>find a answer. it 's simple:
>>why do we not have a beatiful syntax for object definition as we have
>>for class definition ?
> 
> 
> See http://www.python.org/dev/peps/pep-0359  (already rejected by
> Guido).
> 
i do not understand the withdrawal note, what do "different level" mean ?
do you have an example or is it python core implemantation problem ?
>Michele Simionato
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a new object definition

2006-09-01 Thread Sylvain Ferriol
Michele Simionato a écrit :
> Sylvain Ferriol wrote:
> 
>>Michele Simionato a écrit :
>>
>>>See http://www.python.org/dev/peps/pep-0359  (already rejected by
>>>Guido).
>>>
>>
>>i do not understand the withdrawal note, what do "different level" mean ?
>>do you have an example or is it python core implemantation problem ?
> 
> 
> I asked Guido in person at EuroPython. He said the syntax didn't look
> "right" to him. It is as simple as that.
> 
note that we can not use the "make syntax" for a function definition 
because the block is not executed until the function call, while the 
block for a class is executed before the class instanciation
>   Michele Simionato
> 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: a new object definition

2006-09-04 Thread Sylvain Ferriol
> Michele Simionato already pointed you to `PEP 359`_.  One of the reasons 
> that I withdrew it was that people seemed to feel that you could get 
> most of what you want now by defining appropriate metaclasses.  In your 
> case, for example, the appropriate metaclass and its usage might look 
> like::
> 
> >>> def instance(name, bases, dict):
> ... cls = dict.pop('__class__')
> ... dict.pop('__metaclass__')
> ... dict.pop('__module__') # silently added by class statement
> ... return cls(**dict)
> ...
> >>> class C(object):
> ... def __init__(self, a, b):
> ... self.a = a
> ... self.b = b
> ...
> >>> class c:
> ... __metaclass__ = instance
> ... __class__ = C
> ... a = 'foo'
> ... b = 'bar'
> ...
> >>> c.a, c.b
> ('foo', 'bar')
> 
> Sure, it's misleading to use a class statement when you're not actually 
> creating a class, but I guess people felt that wanting to do this was 
> uncommon enough that they weren't worried about it.
>
i know that there is always a solution. But this problem show that 
python and others are not coherent in the syntax (contrary to lisp for 
example).

with the 'make' syntax, it will be really easy to translate a program or 
a data structure defined in XML format into python syntax.

i do not know how many use-cases we need for changing a PEP status :)

another advantage is that we have the same syntax in all definition 
levels: metaclass, class, instance.
and if we just want to use objects and do a sort of 'prototype 
programming', we can with this syntax.
example:
instance my_obj(prototype_obj):
   ...
   ... object specialisation
   ...

sylvain



> .. _PEP 359: http://www.python.org/dev/peps/pep-0359/
> 
> STeVe
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] logilab-astng 0.16.1

2006-09-26 Thread Sylvain Thénault

Hi there !

I'm pleased to announce the 0.16.1 release of Logilab astng package.
This release include some major bug fixes (pylint crashs, 2.5 compatibility)
and have tests passing from python 2.3 to python 2.5 :). You're higly encouraged
to upgrade if you're currently using the 0.16.0 release.

What's new ?

* python 2.5 support, patch provided by Marien Zwart
* fix [Class|Module].block_range method (this fixes pylint's inline
  disabling of messages on classes/modules)
* handle class.__bases__ and class.__mro__ (proper metaclass handling
  still needed though)
* drop python2.2 support: remove code that was working around python2.2
* fixed generator expression scope bug
* patch transformer to extract correct line information


Home page
-
http://www.logilab.org/projects/astng

Download

ftp://ftp.logilab.org/pub/astng

Mailing list

mailto://[EMAIL PROTECTED]

LOGILAB provides services in the fields of XML techniques and advanced
computing (implementation of intelligent agents, knowledge management,
natural language processing, statistical analysis, data mining, etc.),
and also trainings on Python, XML, UML, Object Oriented design, design
patterns use and other cutting edge topics. To know more about
Logilab, visit http://www.logilab.com/.

Logilab is also a strong supporter of the Free Software movement, and an
active member of the Python and Debian communities. Logilab's open 
source projects can be found on http://www.logilab.org/.
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.12.1

2006-09-26 Thread Sylvain Thénault

Hi there !

I'm very pleased to announce the 0.12.1 release of PyLint.
This release includes some bug fixes and have tests passing from python 2.3
to python 2.5 :). You may be surprised by the version number since we have
been missing public annoucements recently, and the 0.12.0 version has not 
really been announced. To quote Alexandre, we got a bit sloppy in the public 
part of our release process, and the mails did not fly... Hopefuly we'll be 
better on this in a near future. Anyway there has been a lot of usability 
changes and a lot of bug fixes making pylint more stable (at least since
the type inference has been introduced...) and nicer to configure and use, so
please upgrade to this version, along with the latest logilab-common and
logilab-astng version (this relelase of pylint actually depends on 
astng >= 0.16.1). I hope you'll enjoy this release and would like to thanks
everybody who contribute to pylint/astng by sending feedback or even better
patch on the mailing list :) Enjoy !

What's new ?

:Changes in 0.12.1
* fixed python >= 2.4 format false positive with multiple lines statement
* fixed some 2.5 issues
* fixed generator expression scope bug (depends on astng 0.16.1)
* stop requiring __revision__

:Changes in 0.12:
* usability changes:
  - parseable, html and color options are now handled by a single 
output-format option
  - enable- and disable-all options are now handled by 
two (exclusive) enable-checker and disable-checker options 
taking a comma separated list of checker names as value
  - renamed debug-mode option to errors-only
* started a reference user manual
* new W0212 message for access to protected member from client code
  (close #14081)
* new W0105 and W0106 messages extracted from W0104 (statement seems
  to have no effect) respectivly when the statement is actually string
  (that's sometimes used instead of comments for documentation) or an
  empty  statement generated by a useless semicolumn
* reclassified W0302 to C0302
* fix so that global messages are not anymore connected to the last
  analyzed module (close #10106)
* fix some bugs related to local disabling of messages
* fix cr/lf pb when generating the rc file on windows platforms

What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/projects/pylint/ for the
complete check list). The big advantage with Pylint is that it is
highly configurable, customizable, and you can easily write a small
plugin to add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list

mailto://[EMAIL PROTECTED]
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] logilab-common 0.19.2

2006-09-26 Thread Sylvain Thénault

Hi there !

I'm pleased to announce the 0.19.2 release of Logilab common package.
This release include some bug fixes and have tests passing from python 2.3
to python 2.5 :). You may be surprised by the version number since we have 
been missing public annoucements recently. To quote Alexandre, we got a bit 
sloppy in the public part of our release process, and the mails did not 
fly... Hopefuly we'll be better on this in a near future. Take a look at
the change log to get information about what's changed in the recent
"discret" versions.


What's new ?

* testlib:
  - fixed a bug in find_test making it returns some bad test names
  - new assertIsInstance method on TestCase
* optik_ext: make it works if mx.DateTime is not installed, in which case
  the date type option won't be available
* test fixes


What is common ?

logilab-common is a collection of low-level Python packages and modules,
 designed to ease:
  * handling command line options and configuration files
  * writing interactive command line tools
  * manipulation files and character strings
  * interfacing to OmniORB
  * generating of SQL queries
  * running unit tests
  * manipulating tree structures
  * accessing RDBMS (currently postgreSQL, mysql and sqlite)
  * generating text and HTML reports
  * logging
  ...

Home page
-
http://www.logilab.org/projects/common

Download

ftp://ftp.logilab.org/pub/common

Mailing list

mailto://[EMAIL PROTECTED]

LOGILAB provides services in the fields of XML techniques and advanced
computing (implementation of intelligent agents, knowledge management,
natural language processing, statistical analysis, data mining, etc.),
and also trainings on Python, XML, UML, Object Oriented design, design
patterns use and other cutting edge topics. To know more about
Logilab, visit http://www.logilab.com/.

Logilab is also a strong supporter of the Free Software movement, and an
active member of the Python and Debian communities. Logilab's open 
source projects can be found on http://www.logilab.org/.
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [IronPython] [ANN] IronPython Community Edition 1.0r2

2006-09-29 Thread Sylvain Hellegouarch
Brilliant Seo. Thanks a lot :)

BTW, if it can be useful and you're happy with the code, don't hesitate to
include my port of the Gzip module. Its a BSD license :)

- Sylvain

> This is the second release of IronPython Community Edition (IPCE),
> 1.0 revision 2, based on IronPython 1.0.
>
> Get it here:
> http://sparcs.kaist.ac.kr/~tinuviel/download/IPCE-1.0r2.zip
>
> Binary is built with Mono 1.1.17.1.
>
> BIG WARNING: it won't work with Mono versions below 1.1.17. Please
> don't mail me or IronPython mailing list before checking your Mono
> version!
>
> IPCE has a new home on SourceForge:
> http://fepy.sourceforge.net/
>
> And here's the license and the summary of applied patches:
> http://fepy.sourceforge.net/license.html
> http://fepy.sourceforge.net/patches.html
>
> Changes in this revision:
>
> * Includes the Python standard library from CPython 2.4.3.
> (Not everything is included -- that would be pointless. Those I tested and
> work reasonably are included.)
>
> * Includes following CPython-compatible wrappers for .NET library:
> md5, pyexpat, select, sha, socket, ssl, unicodedata.
>
> * Includes DB-API wrapper for ADO.NET.
>
> * Includes BeautifulSoup and ElementTree for you to test. (Both work
> great with IronPython!)
>
> * Does not include Doc, Src, Tutorial from the original IronPython
> release.
> You know where to get them... Reduces size by about half.
>
> * Extracts to IPCE-1.0r2. (The first revision extracted to IronPython-1.0
> and it could overwrite existing installation. Thanks to Anthony Baxter
> for pointing this out.)
>
> --
> Seo Sanghyeon
> ___
> users mailing list
> users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.12.2 / astng 0.16.3

2006-11-23 Thread Sylvain Thénault
Hi there !

I'm pleased to announce new bugs fix releases of pylint and astng. Most
bug discussed more or less recently on the python-projects mailing list
should be fixed by those releases, and astng inference capability has
been enhanced for some construction, so upgrade is recommended.

Visit the respective projects'page of our fresh new .org site to get the
latest source distribution :o)
http://www.logilab.org/project/name/pylint
http://www.logilab.org/project/name/logilab-astng

Enjoy !
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: twisted jabber and xmlstream

2005-05-04 Thread Sylvain Thenault
On Tue, 03 May 2005 17:05:46 +, Operation Latte Thunder wrote:

> I am playing around with Jabber with Twisted.  I can receive messages just
> fine, and thats great, however, I am a bit confused about how to actually
> _send_ messages.  From what I've seen, I need to call send() on the
> xmlstream I get when I am auth'd... and thats where I get stuck.  Do I
> need to create the jabber message documents myself, or are there factory
> methods that create message, presence, iq, etc messages for me.

you have to create jabber elements by yourself, using the
twisted.xish.domish package.

> Better yet, does anybody have an example on the web somewhere?

you can find some examples in our fatima project, a jabber bot testing
client, available at http://www.logilab.org/projects/fatima/0.1
You'll find a jabber.py module in the distribution containing jabber
related code.

hope that helps
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org


-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.7

2005-05-27 Thread Sylvain Thénault
Hello all !

I'm pleased to announce a new release of PyLint. I've been promising a
1.0 release some time ago, but it appears I've not enough time yet to
do the polishing I wish, and since the latest (0.6.4) release has a
few really annoying bugs (mainly related to options handling), I
eventually decided to make this intermediate release. It mainly
targets bug fixes but as the main pylint package has moved (it's not
anymore a logilab'subpackage), I've made a 0.7 instead of a
0.6.5. Some others fixes and minor enhancements are included (see
below for a more detailed list), and this release should be really
stable. Please send any bugs or comments on the mailing list.


What's new ?

* WARNING: pylint is no longer a logilab subpackage. Users may have to
  manually remove the old logilab/pylint directory.

* this time, real fix of the "disable-msg in the config file" problem,
  test added to unittest_lint

* fix a bug in the variables checker which may causing some false
  positives when variables are defined and used within the same
  statement (test func_noerror_defined_and_used_on_same_line)

* fix bug with --list-messages and python -OO

* fix possible false positive for W0201

* introduce a new --additional-builtins option to handle user defined
  builtins 

* --reports option has now -r as short alias, and -i for --include-ids


What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/projects/pylint/ for the
complete check list). The big advantage with Pylint is that it is
highly configurable, customizable, and you can easily write a small
plugin to add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/projects/pylint

Download

ftp://ftp.logilab.org/pub/pylint

Mailing list
--------
mailto://[EMAIL PROTECTED]

Enjoy !
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Constructor of object

2007-03-14 Thread Sylvain Defresne
inline wrote:
> Hello!
> I want to assign self to object of parent class in constructor, like
> 
> def my_func():
> ...
> return ParentClass()
> 
> class MyClass (ParentClass):
> def __init__(self):
> self = my_func()
> 
> but it not work, because "object not initialized". What i can do?
> 

You want to override the __new__ function.
-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.13 / astng 0.17

2007-03-01 Thread Sylvain Thénault
Hi there!

I'm very pleased to announce new releases of pylint (0.13) and its underlying
library astng (0.17). 

The PyLint release contains a bunch of bugs fixes, some new checks and command
line changes, and a new checker dedicated to Restricted Python checking. If this
doesn't sound familiar to you, visit the PyPy_ project web site for more
information.

The astng release contains a lot of inference fixes and enhancement, so even if
pylint should still works with the old version you're strongly encouraged to
upgrade.

.. _PyPy: http://codespeak.net/pypy/

What is pylint ?


Pylint is a python tool that checks if a module satisfy a coding
standard. Pylint can be seen as another pychecker since nearly all
tests you can do with pychecker can also be done with Pylint. But
Pylint offers some more features, like checking line-code's length,
checking if variable names are well-formed according to your coding
standard, or checking if declared interfaces are truly implemented,
and much more (see http://www.logilab.org/projects/pylint/ for the
complete check list). The big advantage with Pylint is that it is
highly configurable, customizable, and you can easily write a small
plugin to add a personal feature.

The usage it quite simple :

$ pylint mypackage.mymodule


This command will output all the errors and warnings related to the
tested code (here : mypackage.mymodule), will dump a little summary at
the end, and will give a mark to the tested code.

Pylint is free software distributed under the GNU Public Licence.


Home page
-
http://www.logilab.org/project/name/pylint
http://www.logilab.org/project/name/logilab-astng

Download

ftp://ftp.logilab.org/pub/pylint
ftp://ftp.logilab.org/pub/astng

Mailing list

mailto://[EMAIL PROTECTED]


Enjoy !
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] PyLint 0.11 / astng 0.16

2006-04-20 Thread Sylvain Thénault
Hi there!

I'm please to announce new releases of pylint (0.11) and its underlying 
library astng (0.16). Those releases should fix a number of crashes and false
positive and provide a few new options/features, the most notable one being
the ability to enable/disable messages at block level in the code (I'll post 
an example of this new feature on the python-projects mailing-list).
Thanks to every people helping pylint by their feedback and bug reports, and 
special thanks to Benjamin Niemann for his message control patch...


To get the new releases of more information :

http://www.logilab.org/projects/pylint/
http://www.logilab.org/projects/astng/


Enjoy !
-- 
Sylvain Thénault   LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.14 / logilab-astng 0.17.2

2008-01-14 Thread Sylvain Thénault
Hi there!

I'm pleased to announce a new release of pylint [1] and logilab-astng
[2]. I haven't personally found a lot of time to work on those projects
since the latest releases but others contributors have and so I decided
to publish releases including various contributions and other minor bug
or crash fixes (some of which were pending for a while now). You're
greatly encouraged to upgrade, see projects'changelog for more
information about what changed.

[1] http://www.logilab.org/projects/pylint
[2] http://www.logilab.org/projects/logilab-astng

Many thanks to every people who contributed!

regards,
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science

-- 
http://mail.python.org/mailman/listinfo/python-list


Setuptools & Python 3.0

2009-02-14 Thread Sylvain Rabot

Hi,

I would like to know if the official maintainers of setuptools are working 
on a release for Python 3.0.


Regards. 


--
http://mail.python.org/mailman/listinfo/python-list


[ANN] logilab-astng 0.17.4

2008-11-19 Thread Sylvain Thénault
Hi there!

Back from holidays, I finally took a few hours to fix a few bugs in
astng an publish a 0.17.4 release. It fixes some crashes, the "using
possibly undefined loop variable" false positive reported by Maarteen 
and Skip and add some support for python 2.5 relative imports. See
the ChangeLog or the version's page [1] for more details.

[1] http://www.logilab.org/project/logilab-astng/0.17.4

-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science

--
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Sylvain Thénault

-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science
--
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Sylvain Thénault
oops, forgot the mail content :$ Here it is...


I'm pleased to announce releases of pylint 0.18, logilab-astng
0.19 and logilab-common 0.39.  All these packages should now be
cleanly available through easy install.

Also, happy pylint users will get:

* fixed python 2.6 support (pylint/astng tested from 2.4 to 2.6)
* get source code (and so astng) for zip/egg imports
* some understanding of the property decorator and of unbound methods
* some false positives fixed and others minor improvments

See projects home page and ChangeLog for more information:

http://www.logilab.org/project/pylint
http://www.logilab.org/project/logilab-astng
http://www.logilab.org/project/logilab-common

Please report any problem / question to the python-proje...@lists.logilab.org
mailing-list.

Enjoy!
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science
--
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-25 Thread Sylvain Thénault
Le Wednesday 25 March 2009 11:58:37 andrew cooke, vous avez écrit :
> python 3? :o)

python 3 support is no much far away now that we support the new _ast module.
logilab-common already has its py3k branch in the source repository... So it's 
in the plan, but any helps appreciated of course ;)

-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science
--
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pylint 0.18 / logilab-astng 0.19 / logilab-common 0.39

2009-03-26 Thread Sylvain Thénault
Le Wednesday 25 March 2009 13:43:37 Colin J. Williams, vous avez écrit :
> Sylvain Thénault wrote:
> > Le Wednesday 25 March 2009 11:58:37 andrew cooke, vous avez écrit :
> >> python 3? :o)
> >
> > python 3 support is no much far away now that we support the new _ast
> > module. logilab-common already has its py3k branch in the source
> > repository... So it's in the plan, but any helps appreciated of course ;)
>
> Not Found
>
> The requested URL
> /pub/pylint/pylint-0.18.0.tar.gz was not
> found on this server.
> Apache/2.2.9 (Debian) mod_ssl/2.2.9
> OpenSSL/0.9.8g Server at ftp.logilab.org
> Port 80

damned synchronization script! Should have been fixed yesterday night. Thank 
you for reporting this.

-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
Python et calcul scientifique:   http://www.logilab.fr/science
--
http://mail.python.org/mailman/listinfo/python-list


weird try/finally behaviour

2009-04-10 Thread Sylvain Thénault
Hi there,

I've encountered the following behaviour which I found surprising:

>>> def test():
... for x in ('test', 'tests'):
...  try:
... if True:
...   print 'return'
...   return 1
...  finally:
... print 'break'
... break
... print 'end'
... 
>>> 
>>> test()
return
break
end

As you can see, the 'break' in the finally block makes the 'return 1' beeing 
ignored.
Is this a known caveat or should it be considered as a bug?
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org

--
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.19 / astng 0.19.2

2009-12-18 Thread Sylvain Thénault
Hi,

I'm very pleased to announce the release of pylint 0.19 / astng 0.19.2 release!

More information / download  on http://www.logilab.org/project/pylint/0.19.0.

This is a "community" release, including the work we've done during the pylint
bug day [1] and patches mostly from James Lingard and Vincent Ferotin.

Many thanks to James Lingard which provided two long waited features:

* check of function call arguments
* check string interpolation consistency


So, happy christmas, enjoy!

[1] http://www.logilab.org/blogentry/19260
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pylint 0.19 / astng 0.19.2

2009-12-18 Thread Sylvain Thénault
On 18 décembre 18:24, Jean-Michel Pichavant wrote:
> Sylvain Thénault wrote:
> >Hi,
> >
> >I'm very pleased to announce the release of pylint 0.19 / astng 0.19.2 
> >release!
> >
> >More information / download  on http://www.logilab.org/project/pylint/0.19.0.
> >
> >This is a "community" release, including the work we've done during the 
> >pylint
> >bug day [1] and patches mostly from James Lingard and Vincent Ferotin.
> >
> >Many thanks to James Lingard which provided two long waited features:
> >
> >* check of function call arguments
> >* check string interpolation consistency
> >
> >
> >So, happy christmas, enjoy!
> >
> >[1] http://www.logilab.org/blogentry/19260
> I have troubles after updating pylint:
> 
> easy_install pylint -U --install-dir
> /opt/tools/python/python2.3/site-packages
> 
> > pylint
> 
>  File 
> "/opt/tools/python/python2.3/site-packages/logilab_astng-0.19.2-py2.5.egg/logilab/astng/infutils.py",
> line 28, in 
>from logilab.astng._nodes import Proxy_, List, Tuple, Function,
> If, TryExcept
> ImportError: No module named _nodes
> 
> There is no _nodes.py file within the egg. Has anyone experienced
> the same issue ?

yep someone else on the list have the same pb. I think I've identified it:

  python setup.py register sdist upload

*doesn't* regenerate MANIFEST if one is found... So packages uploaded to pypi 
had some missing files. Should be fixed now, sorry for this pb.
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org

-- 
http://mail.python.org/mailman/listinfo/python-list


pylint bugs day #2 tomorrow

2010-04-15 Thread Sylvain Thénault
Hi there,

just a quick note to remind pylint felows that we will hold
the second pylint bugs day tomorrow, from about 8am to 18pm
UTC+2. See you on our jabber forum or in our paris office!

-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pylint 0.18.1 / astng 0.19.1

2009-08-27 Thread Sylvain Thénault
Hi there,

I'm pleased to announce a new bug fixes release of pylint and astng.
To see what have been fixed and to download it (unless your using 
debian, ubuntu or easy_install of course :), check:

http://www.logilab.org/project/pylint/0.18.1
http://www.logilab.org/project/logilab-astng/0.19.1

-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] (probably) last version of Pylint supporting python 2.3 released

2010-09-28 Thread Sylvain Thénault
Hi there!

As someone stuck with python 2.3 tried to use pylint, we made some fixes
to get python 2.3 supports back. This resulted in the release of pylint 
0.21.3, logilab-astng 0.20.3 and logilab-common 0.52 today.

At the time of porting pylint to py3k, this will much probably be the latest
set of versions to use to get pylint working with python 2.3 code. And maybe,
unless you people think it would be a shame, also for python 2.4, so we
can drop support for the old compiler module.

ciao,
-- 
Sylvain Thénault   LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:   http://www.logilab.fr/services
CubicWeb, the semantic web framework:http://www.cubicweb.org

-- 
http://mail.python.org/mailman/listinfo/python-list