by: Steven D'Aprano |
last post by:
I came across this unexpected behaviour of getattr for new style classes.
Example:
>>> class Parrot(object):
.... thing =
....
>>> getattr(Parrot, "thing") is Parrot.thing
True
>>>...
|
by: szport |
last post by:
There is an interesting skewness in python:
class A(object): pass
17
But I can't write
|
by: Hole |
last post by:
Hi There!
I'm trying to use Zope and the product OpenFlow.
I got the following error while I was using the built-in function
getattr() to retrieve an OpenFlow object:
attribute name must be...
|
by: Emin |
last post by:
Dear experts,
I got some unexpected behavior in getattr and copy.deepcopy (see
transcript below). I'm not sure if this is actually a bug in
copy.deepcopy or if I'm doing something too magical...
|
by: Paulo da Silva |
last post by:
Hi!
In a class C, I may do setattr(C,'x',10).
Is it possible to use getattr/setattr for variables not inside
classes or something equivalent? I mean with the same result as
exec("x=10").
...
|
by: Nathan Harmston |
last post by:
Hi,
I m trying to implement an object which contains lazy" variables. My
idea is to alter the getattr and the setattr methods. However I keep
on getting a recursion error.
My idea is that the...
|
by: Donn Ingle |
last post by:
Hi,
Here's some code, it's broken:
class Key( object ):
def __init__(self):
self.props = KeyProps()
def __getattr__(self, v):
return getattr( self.props,v )
def __setattr__(self,var,val):
|
by: numberwhun |
last post by:
Hello everyone! I am presently going through the "Dive Into Python" tutorial which I obtained from their website. No, this is not for any class, I am self-learning the Python language.
I am in...
|
by: Gregor Horvath |
last post by:
Hi,
class A(object):
test = "test"
class B(object):
a = A()
In : B.a.test
|
by: maestro |
last post by:
Why are these functions there? Is it somehow more idiomatic to use
than to do obj.field ?
Is there something you can with them that you can't by obj.field
reference?
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: 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: 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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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,...
|