[OT] nntp references, was re: pickling a dict

Dan Perl danperl at rogers.com
Wed Nov 3 07:25:35 EST 2004


"andrea valle" <andrea.valle at unito.it> wrote in message 
news:mailman.5862.1099468587.5135.python-list at python.org...

>> First of all, your posting shows up as part of the "Newbie question"
>> thread
>> and not as a new thread.  You probably replied or followed up to a
>> posting
>> in that thread and you only changed the subject line.  Please don't do
>> that.
>>
>
> Yes, it's true. I'm really sorry. I didn't know about this fact. (Where
> is these info about thread recorded??)

Good question.  I'm actually not familiar with NNTP, but looking at the 
properties of a message and at RFC 1036 (Standard for Interchange of USENET 
Messages, http://www.ietf.org/rfc/rfc1036.txt) I figure that that 
information is kept in the References field (an optional field) in the 
header:
"This field lists the Message-ID's of any messages prompting the submission 
of this message. It is required for all follow-up messages, and forbidden 
when a new subject is raised. Implementations should provide a follow-up 
command, which allows a user to post a follow-up message. This command 
should generate a "Subject" line which is the same as the original message, 
except that if the original subject does not begin with "Re:" or "re:", the 
four characters "Re:" are inserted before the subject. If there is no 
"References" line on the original header, the "References" line should 
contain the Message-ID of the original message (including the angle 
brackets). If the original message does have a "References" line, the 
follow-up message should have a "References" line containing the text of the 
original "References" line, a blank, and the Message-ID of the original 
message.

The purpose of the "References" header is to allow messages to be grouped 
into conversations by the user interface program. This allows conversations 
within a newsgroup to be kept together, and potentially users might shut off 
entire conversations without unsubscribing to a newsgroup. User interfaces 
need not make use of this header, but all automatically generated follow-ups 
should generate the "References" line for the benefit of systems that do use 
it, and manually generated follow-ups (e.g., typed in well after the 
original message has been printed by the machine) should be encouraged to 
include them as well.

It is permissible to not include the entire previous "References" line if it 
is too long. An attempt should be made to include a reasonable number of 
backwards references."

>> BTW, does your save( ) function also take minutes?  If it takes much
>> less
>> than the open( ) function, my guess would be that pickle is not the
>> problem.
>
> You're guessing fine: it takes much less. So effectively it should
> depend on my other functions. I hadn't considered that.

Make sure that those functions are the problem.  Use the profiler 
(http://www.python.org/doc/lib/profile.html) or insert some statements 
showing the time like the ones I described before and find out where most of 
the processing time is spent.  You should actually use the profiler at least 
eventually, when it will come to improving the performance of your 
functions.

Dan 





More information about the Python-list mailing list