A simply newbie question about ndiff

Neville Franks nospam-readonly at getsoft.com
Sun Apr 21 21:35:17 EDT 2002


Hi David,
Ok this all starts to make some sense now. I did see some docs refer to
ndiff being in difflib but then other difflib doc's which didn't mention it.
I did try executing '/tools/scripts/ndiff' but have to admit I don't really
know what I'm doing just yet and didn't get anywhere. Is there some one to
run this in 2.1.2 or should I just install 2.2?

Thanks for your help.


"David Goodger" <goodger at users.sourceforge.net> wrote in message
news:B8E8DEB0.21E3D%goodger at users.sourceforge.net...
> Neville Franks wrote:
> > I still can't get ndiff to work. If I enter: 'difflib.ndiff' I get
> > 'AttributeError: 'difflib' module has no attribute 'ndiff'
>
> Tim Peters' ndiff.py is a script in the tools/scripts directory.
> Originally, it was self-contained, but at some point Tim migrated the
> SequenceMatcher class into the difflib module.  I extracted the rest of
the
> generic code and turned it into the difflib.Differ class and
difflib.ndiff()
> convenience function, Tim converted it to use generators, and it was
> released with Python 2.2.  You're running Python 2.1.2, so difflib.ndiff
> doesn't exist yet.  You'll have to upgrade to get the full functionality.
> You can't use the Python 2.2 difflib module in Python 2.1, because it uses
> the generator feature, new to Python 2.2.  However, you can get a Python
> 2.0/2.1-compatible version from
> http://docutils.sourceforge.net/test/difflib.py; this is the module after
I
> added Differ and ndiff(), but before Tim converted it to use generators.
>
> --
> David Goodger  <goodger at users.sourceforge.net>  Open-source projects:
>   - Python Docutils: http://docutils.sourceforge.net/
>   - The Go Tools Project: http://gotools.sourceforge.net/
>





More information about the Python-list mailing list