473,657 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Definitive documentation on newstyle classes? (WAS: Pickling andinheritance are making me hurt)

I was reading the "Pickling and inheritance are making me hurt"
thread, and the latest suggestion (as of this posting) was to do with
the __setstate__ and __getstate__ methods. They caught my attention
because I hadn't encountered them before, and it reminded me that in
the past I've never been able to very good, definitive documentation
on newstyle classes. Googling for it gives little python tutorials on
various sites, and even searching this newsgroup returns very specific
questions, as a rule.

Alas, the question: Does there exist a page that enumerates all of the
features of the newstyle classes, and explains what they all do? If
so, can anyone provide me with such a link?

Thanks :-)
--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
Jul 18 '05 #1
2 1340
Daniel Bickett a écrit :
I was reading the "Pickling and inheritance are making me hurt"
thread, and the latest suggestion (as of this posting) was to do with
the __setstate__ and __getstate__ methods. They caught my attention
because I hadn't encountered them before, and it reminded me that in
the past I've never been able to very good, definitive documentation
on newstyle classes.


Well, the fact is that __[get|set]state__() have nothing to do with new
style classes, but with the Pickle protocol:
http://www.python.org/doc/2.3.4/lib/pickle-inst.html

(snip)
Bruno
Jul 18 '05 #2
Bruno Desthuilliers wrote:
Well, the fact is that __[get|set]state__() have nothing to do with new
style classes, but with the Pickle protocol:
http://www.python.org/doc/2.3.4/lib/pickle-inst.html


Thank you for pointing that out, but all the same ;)

--
Daniel Bickett
dbickett at gmail.com
http://heureusement.org/
Jul 18 '05 #3

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

Similar topics

2
2056
by: Christian Tismer | last post by:
Martin v. Löwis wrote: > "Mark Hahn" <mark@hahnca.com> writes: > > >>I don't understand how this could happen with pickle. Isn't it supposed to >>stop when it runs into an object it has already pickled? > > Yes, and it does. >
75
4635
by: Xah Lee | last post by:
http://python.org/doc/2.4.1/lib/module-re.html http://python.org/doc/2.4.1/lib/node114.html --------- QUOTE The module defines several functions, constants, and an exception. Some of the functions are simplified versions of the full featured methods for compiled regular expressions. Most non-trivial applications always use the compiled form UNQUOTE
3
3106
by: Patrick | last post by:
Hi I am currently learning JS and have heard a lot of good about that book even if it's a reference and better suited for intermediate to experienced users. My local bookstore has both the 3rd and 4th edition and the 3rd is at a fraction of the 4th ed. price. Is it a mistake to grab the 3rd ed. instead of the 4th. in order to save money ?
45
3593
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes themselves are an exception to this), and 'bootstrap' your program by instantiating a single application object in main(), would that place any limitations on what you could accomplish with your program? Are there any benefits to doing things that...
2
1492
by: Gil Sudai | last post by:
We have a JavaScript SDK with lots of classes and functions. We would like to generate automatic HTML documentation from it to our users. We look for a free tool, something like Doxygen, that knows how to handle JS code. Do you know of such a tool ?
8
1993
by: Will Pittenger | last post by:
I have a Windows program C# .NET solution where when I update its XML documentation, some tags are not recognized and turned into the corresponding HTML. Those tags include <c>, <code>, <para>, <paramref>, and <exception>. <remarks> works; I have not tried <include>. Is this a bug in Studio or am I using those tags incorrectly? When the tag appears to have an attribute, I have tried <paramref="parameter">paramter name</paramref> and...
6
1317
by: Adie | last post by:
Hi, is there a C# equivalent to Bjarne Stroustrop's "Programming in C++" yet? If so, what is it?
97
4353
by: Cameron Laird | last post by:
QOTW: "Python makes it easy to implement algorithms." - casevh "Most of the discussion of immutables here seems to be caused by newcomers wanting to copy an idiom from another language which doesn't have immutable variables. Their real problem is usually with binding, not immutability." - Mike Meyer Among the treasures available in The Wiki is the current copy of "the Sorting min-howto":
4
2119
by: Chris F Clark | last post by:
Please excuse the length of this post, I am unfortunately long-winded, and don't know how to make my postings more brief. I have a C++ class library (and application generator, called Yacc++(r) and the Language Objects Library) that I have converted over to C#. It works okay. However, in the C# version, one has to build the class library into the generated application, because I haven't structured this one thing right. I would like to...
0
8425
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1736
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.