Hello,
does anyone know a way to set the __doc__ string of a new style class?
Any attempt I tried results in the following error:
Python 2.4 (#1, Dec 30 2004, 08:00:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright" , "credits" or "license" for more information. class Foo(object) :
.... pass
.... Foo.__doc__ = "bar"
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: attribute '__doc__' of 'type' objects is not writable
I can understand someone arguing that "changing a doc string is during
programm execution and should therefore be forbidden!" But, I cannot
even find out a way to set the doc string, when I CREATE a class using
type(name,bases ,dict) ... At least this should be possible, IMHO.
- harold -
--
If you make people think they're thinking, they'll love you;
but if you really make them think they'll hate you. 3 1342
harold fellermann <ha************ ***@upf.edu> wrote:
... But, I cannot even find out a way to set the doc string, when I CREATE a class using type(name,bases ,dict) ... At least this should be possible, IMHO. x=type('x',(),d ict(__doc__='hi there')) x.__doc__
'hi there'
Alex
harold fellermann wrote: programm execution and should therefore be forbidden!" But, I cannot even find out a way to set the doc string, when I CREATE a class using type(name,bases ,dict) ... At least this should be possible, IMHO.
That's what the dict parameter is for: T = type("T", (object,), dict(__doc__="w hat you want")) T.__doc__
'what you want'
Peter
On 11.01.2005, at 19:35, Alex Martelli wrote: harold fellermann <ha************ ***@upf.edu> wrote: ... But, I cannot even find out a way to set the doc string, when I CREATE a class using type(name,bases ,dict) ... At least this should be possible, IMHO.
x=type('x',(),d ict(__doc__='hi there')) x.__doc__
'hi there'
yes, you're right ... a subsequent question, that puzzles me:
where can I apply for the "most-stupid-question"-award, now *g*
thanks anyway,
- harold -
--
The opposite of a correct statement is a false statement.
But the opposite of a profound truth may be another profound truth.
-- Niels Bohr This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Barry |
last post by:
I'm looking for a control to us on our web site that will take our reports
that are generated in PDF and convert them to DOC format all on the server.
We are using win2k3 web servers if that helps.
Does anyone have any suggestions?
Thanks,
Barry
|
by: John Morgan |
last post by:
I am using the following link to download a file of about 50k
<a target= "_blank"
href="http://www.bsecs.org.uk/ExecDocs/documentStore/elfridaWord.doc">open
file</a>
If I save the file to hard disk there is no problem/
if, in response to the menu which appears before downloading, I opt to
open the doc file immediately then I get a problem.
|
by: Stu |
last post by:
Hi,
I have a Word document that is stored outside of the virtual server and I
need to send it to the browser. I have tried using the code below (which
seemed a little too simplistic!). The browser pops open a dialogue asking to
save a word doc but the doc is empty.
Dim f As File
f.Open("c:\test.doc", FileMode.Open)
|
by: monomaniac21 |
last post by:
This one has been bugging me for months everytime i've tried i've had
to give up and do something else. Anyone know how to do this, any help
would be much appreciated.
I think that I need to use a blob field is that correct? But from then
on im stuck.
Kind regards
Marc
|
by: kbperry |
last post by:
Hi all,
Background:
I need some help. I am trying to streamline a process for one of our
technical writers. He is using Perforce (version control system), and
is constantly changing his word documents, and then converts them to
both .pdf and "Web page" format (to publish to the web). He has a
licensed copy of Adobe Acrobat Professional (7.x).
Questions:
| |
by: gslim |
last post by:
I am trying to implement the busybox sample from
// From Mark Wagner
// http://blogs.crsw.com/mark/articles/642.aspx
When I get to this line I get an access denied error. Could someone
give me an idea why this might be?
Here is the entire function
|
by: LtCommander |
last post by:
Hi all,
I am trying to extract text from an uploaded DOC file so that I can do
some regex on the text in order to fill up some textboxes on the ASP
page. I know that Writely (www.writely.com) does this but I think the
use C# or something special to preserve the formatting of the uploaded
DOC file.
My questions:
|
by: arun raut |
last post by:
On Apr 10, 10:32 pm, Rich <R...@discussions.microsoft.comwrote:
help
not
compilation
write
all
easier. But
Rich,
Without being sure completely, if you want to use HTML as help
|
by: patrick.waldo |
last post by:
Hi Everyone,
I had previously asked a similar question,
http://groups.google.com/group/comp.lang.python/browse_thread/thread/2953d6d5d8836c4b/9dc901da63d8d059?lnk=gst&q=convert+doc+txt#9dc901da63d8d059
but at that point I was using Windows and now I am using Linux.
Basically, I have some .doc files that I need to convert into txt
files encoded in utf-8. However, win32com.client doesn't work in
Linux.
|
by: setori88 |
last post by:
Hi guys
this script i downloaded from here, http://win32com.goermezer.de/index.php?option=com_content&task=view&id=193&Itemid=274
I copied this script and setup and instance of open office writer.
created a .doc file and a copied it making a change to that file.
here is the code
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |