by: Michal Vitecek |
last post by:
hello everyone,
today i've come upon a strange exception, consider the following file
test.py:
--- beginning of test.py ---
class A(object):
def method1(parA):
print "in A.method1()"
|
by: Robin Becker |
last post by:
A colleague wanted to initialize his class __new__ and tried code resembling this
#######################1
class Metaclass (type):
def __init__(cls, name, bases, *args, **kwargs):...
|
by: Neil Zanella |
last post by:
Hello,
In Python, classes are objects. But there is no way to custom print a class
object. This would require some syntax such as the one commented out below:
With the current "foo =...
|
by: Tobiah |
last post by:
#!/usr/bin/python
# Hi,
#
# I noticed something interesting when trying to define
# the __getitem__() method in a class that inherits from
# (dict). If within the __getitem__ method I attempt...
|
by: simon |
last post by:
What i'm trying to do is tie special methods of a "proxy" instance
to another instance:
def test1():
class Container:
def __init__( self, data ):
self.data = data
self.__getitem__ =...
|
by: ron |
last post by:
Why doesn't this work?
>>> def foo(lst):
.... class baz(object):
.... def __getitem__(cls, idx): return cls.lst
.... __getitem__=classmethod(__getitem__)
.... baz.lst = lst
.... ...
|
by: C Gillespie |
last post by:
Hi,
Does anyone know of any examples on how (& where) to use staticmethods and
classmethods?
Thanks
Colin
|
by: Nicolas Fleury |
last post by:
Hi everyone,
I was wondering if it would make sense to make staticmethod objects
callable, so that the following code would work:
class A:
@staticmethod
def foo(): pass
bar = foo()
I...
|
by: james_027 |
last post by:
hi,
python's staticmethod is the equivalent of java staticmethod right?
with classmethod, I can call the method without the need for creating
an instance right? since the difference between...
|
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: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|