by: Nicholas Wieland |
last post by:
I'm using the shelve module for a program I'm writing, and reading the
source I've noted that shelve doesn't use new style classes.
Well, this is the first time I use *seriously* new style classes...
|
by: Dragos Chirila |
last post by:
Hi
I have the following class:
class PropTest:
def __init__(self):
self.prop1 = 1
self._prop2 = 2
self.__prop3 = 3
|
by: Chris |
last post by:
Is there any way to make the class Z behave the same way as class Y?
Chris
class Y:
value = 42
def __hasattr__(self, name):
if name == '__int__':
return True
def __getattr__(self, name):
|
by: Brian Roberts |
last post by:
I'm confused about the use of hasattr/getattr, or possibly
namespaces. I know how to do this:
class UnderstandThis(object):
def do_foo(self): pass
def do_bar(self): pass
def doit(self, cmd):...
|
by: marduk |
last post by:
I commonly use code like this
try:
# call optional method
myobj.method()
except AttributeError:
# no biggie
pass
|
by: Thomas Heller |
last post by:
I'm trying to implement __iter__ on an abstract base class while I don't
know whether subclasses support that or not.
Hope that makes sense, if not, this code should be clearer:
class Base:
def...
|
by: Gil Tal |
last post by:
Hi,
I use urllib2 to download a redirected url and I get an exception from
the bowels of urllib2. It seems that urllib2 implements some super
sophisticated self check and tries to control the...
|
by: PTY |
last post by:
Which is better?
lst =
while lst:
lst.pop()
OR
while len(lst) 0:
|
by: Joel Hedlund |
last post by:
Hi!
The question of type checking/enforcing has bothered me for a while, and
since this newsgroup has a wealth of competence subscribed to it, I
figured this would be a great way of learning...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|