473,320 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

pychecker - sets.Set need to be overridden

Hello all,

if I have this code:

import sets

class Foo:
x = sets.Set()

then pychecker says:

test.py:4: Methods (__cmp__, __hash__) in sets.Set need to be overridden in a subclass

I don't get this message. What is it trying to say, and why?

Istvan.
Jul 18 '05 #1
5 1448
mport sets

class Foo:
def __init__(self):
self.x = sets.Set()

x = Foo()
print x, getattr(x, 'x')

gives for me:
<__main__.Foo instance at 0x00C578A0> Set([])
on 2.4. on WinXP. What environment do you run in?

Jul 18 '05 #2
wi******@hotmail.com wrote:
<__main__.Foo instance at 0x00C578A0> Set([])
on 2.4. on WinXP. What environment do you run in?


I'm running it on cygwin,

but still don't get it, why the warning?

Istvan.
Jul 18 '05 #3
Istvan Albert wrote:
if I have this code:

import sets

class Foo:
x = sets.Set()

then pychecker says:

test.py:4: Methods (__cmp__, __hash__) in sets.Set need to be overridden
in a subclass

I don't get this message. What is it trying to say, and why?


The minimal example is actually

import sets
sets.Set()

The Set class has implementations for __cmp__() and __hash__() that
unconditionally raise an exception. pychecker assumes that these methods
are "abstract", i. e. meant to be overriden by a subclass, and warns that
you are instantiating an abstract base class, while the intention of the
Set class author was to make Sets "uncomparable" and unhashable by
overriding the corresponding superclass methods.

Peter

Jul 18 '05 #4
I don't know pychecker, maybe there's something wrong with it as your
code seems valid to me.

Jul 18 '05 #5
Peter Otten wrote:
The Set class has implementations for __cmp__() and __hash__() that
unconditionally raise an exception. pychecker assumes that these methods
are "abstract", i. e. meant to be overriden by a subclass, and warns that
you are instantiating an abstract base class, while the intention of the


I see. Thanks!

Istvan.
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: achrist | last post by:
The pychecker site says that pychecker works with versions 1.5 through 2.2. Any reason to expect that 2.3 breaks it? Anyone tried it to see? TIA Al
0
by: Pedro Werneck | last post by:
Hi, I don't know if I should ask this here or on an emacs group/list. If I choose wrong, please forgive me. I am trying to run pychecker on the current buffer on python-mode using the...
1
by: Neal Norwitz | last post by:
A new version of PyChecker is (finally) available for your hacking pleasure. It's been quite a while since the last release--11 months. I wish there was more progress, but such is life. Many bug...
10
by: Kylotan | last post by:
Is there a practical way to use Pychecker in Windows? It doesn't work under IDLE. (In fact, it seems to end up breaking everything, and every subsequent statement and expression I execute gets...
4
by: beliavsky | last post by:
If I run PyChecker on the following program, stored in xtry.py, m = 10000000 k = 0 for i in xrange(m): k = k + i print k x = range(3) print x
8
by: Frans Englich | last post by:
Hello, I take PyChecker partly as an recommender of good coding practice, but I cannot make sense of some of the messages. For example: runner.py:878: Function (main) has too many lines (201)...
21
by: Philippe Fremy | last post by:
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...
1
by: Neal Norwitz | last post by:
Special thanks to Ken Pronovici. He did a lot of work for this release and helped ensure it occurred. Version 0.8.15 of PyChecker is available. It's been over a year since the last release. ...
4
by: Anthony Greene | last post by:
Howdy, I had the impression that pychecker caught and reported such dynamic syntactical errors. #!/usr/bin/env python def add(i): i += 10 status = 3
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.