<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.python.general">
    <title>gmane.comp.python.general</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736167"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736166"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736165"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736164"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736163"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736162"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736161"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736160"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736159"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736158"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736157"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736156"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736155"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736154"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736153"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736152"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736151"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736150"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736149"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.python.general/736148"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736167">
    <title>Re: Problem with the "for" loop syntax</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736167</link>
    <description>&lt;pre&gt;



Snipplr says that link doesn't exist.




I don't see anything obviously wrong with that code.  Are you sure that's
a real blank space, and not some weird character that *looks* like a space?

&lt;/pre&gt;</description>
    <dc:creator>John Gordon</dc:creator>
    <dc:date>2013-06-19T21:30:57</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736166">
    <title>Re: Problem with the "for" loop syntax</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736166</link>
    <description>&lt;pre&gt;
If you want us to read it, put it in your message.  Show at least a few 
lines before and after the syntax error, and show the error itself, as 
text of course.  Use copy/paste.

Of course that assumes you're using a proper console/shell, and know how 
to use it.  So if you have to ask about that, start there.

In addition, specify the python version, and if appropriate, the OS and 
its version.

Generally, you can find your own problem.  Syntax errors that seem 
confusing are frequently really on the line before the line in which 
they're "discovered."


&lt;/pre&gt;</description>
    <dc:creator>Dave Angel</dc:creator>
    <dc:date>2013-06-19T21:32:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736165">
    <title>Problem with the "for" loop syntax</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736165</link>
    <description>&lt;pre&gt;Hello guys...
I´m a begginer in Python, I'm doing a Hangman game, but I'm having trouble with this blank space. I would be greatful if you help me. :)

Here's my code:

http://snipplr.com/view/71581/hangman/

When I run the code it says: Invalid Syntax and this is the error:

http://i.imgur.com/jKYOPMY.png

http://i.imgur.com/ySoOZFR.png


Thank you guys :)
&lt;/pre&gt;</description>
    <dc:creator>arturo balbuena</dc:creator>
    <dc:date>2013-06-19T21:14:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736164">
    <title>Re: Don't feed the troll...</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736164</link>
    <description>&lt;pre&gt;
No, "blame" implies assumption of a particular point of
view.  From a troll's viewpoint, newsgroup participants that
*don't* respond are to blame because they deprive the troll
of his fun.

Our viewpoint is that of newsgroup participants.  We assume
they have volition, else this whole thread is pointless.
Since they have a choice of how to respond, then if they 
chose to respond in a way that produces an undesirable outcome, 
then it is fair "blame" them.

The troll is outside the volition of the group and so his
appearance is effectively an act of nature.


I am not "drawing the line for them", I am drawing it for
me.  I think you see a non-existent conflict because you are 
assume there is only one line.  I do not make that assumption.

If you think Nikos has crossed your line, then I acknowledge 
your right not to help him.  I even acknowledge your right
to flame him and encourage others to do so. 

My argument is that if you exercise your right (the flamage
part) the results on the newsgroup, when consi&lt;/pre&gt;</description>
    <dc:creator>rurpy&lt; at &gt;yahoo.com</dc:creator>
    <dc:date>2013-06-19T21:13:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736163">
    <title>Re: python game</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736163</link>
    <description>&lt;pre&gt;

Should this be moveRight instead of moveDown?

&lt;/pre&gt;</description>
    <dc:creator>Denis McMahon</dc:creator>
    <dc:date>2013-06-19T20:43:41</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736162">
    <title>Re: python game</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736162</link>
    <description>&lt;pre&gt;

Try changing this to draw the bears first, then the player.

&lt;/pre&gt;</description>
    <dc:creator>Denis McMahon</dc:creator>
    <dc:date>2013-06-19T20:41:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736161">
    <title>Re: Newbie: The philosophy behind list indexes</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736161</link>
    <description>&lt;pre&gt;
Thanks everyone for taking the time to offer some very insightful replies. Learning a new language is so much more fun with a group of friendly and helpful people around!
&lt;/pre&gt;</description>
    <dc:creator>ian.l.cameron&lt; at &gt;gmail.com</dc:creator>
    <dc:date>2013-06-19T20:46:53</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736160">
    <title>python game</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736160</link>
    <description>&lt;pre&gt;I made this game where you move a player over bears, but the bears keep loading over the plaeyer making it hard to see it, also when i move down the player goes down to the right

here is my code:

import pygame, sys, random
from pygame.locals import *
from threading import Timer

#set up pygame
pygame.init()
mainClock = pygame.time.Clock()

#set up the window
WINDOW_WIDTH = 400
WINDOW_HEIGHT = 400
windowSurface = pygame.display.set_mode((WINDOW_WIDTH,
WINDOW_HEIGHT),0)
pygame.display.set_caption('Get the Bears')

#set up color constants
BLACK = (0,0,0)
BLUE = (0, 0, 255)
#set winning text
textFont = pygame.font.SysFont("impact", 60)
text = textFont.render("YOU WIN!", True, (193, 0, 0))

#set up the player and bear data structures
bearCounter = 0
NEW_BEAR = 40
BEAR_SIZE = 64
playerImage = pygame.image.load('hunter.png')
bearImage = pygame.image.load('bear.png')

player = pygame.Rect(300, 100, 40, 40)
bears = []
for i in range(20):
    bears.append(pygame.Rect(random.randint(0, WINDOW_WIDTH - BEAR_SIZE),
    &lt;/pre&gt;</description>
    <dc:creator>jacksonkemp1234&lt; at &gt;gmail.com</dc:creator>
    <dc:date>2013-06-19T20:18:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736159">
    <title>Re: Default Value</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736159</link>
    <description>&lt;pre&gt;
This code:

does the same as this code:

M=[]
def f(a, L=M):
     L.append(a)
     return L

where it's slightly more obvious that the list is created once, and 
modified with each call to the function (or rather with each call to the 
function that does not supply its own value for L).

Gary Herron




&lt;/pre&gt;</description>
    <dc:creator>Gary Herron</dc:creator>
    <dc:date>2013-06-19T19:57:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736158">
    <title>Re: Why is regex so slow?</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736158</link>
    <description>&lt;pre&gt;

It's been a while since I looked at boyer-moore in detail.  Looking at Objects/stringlib/fastsearch.h from the 2.7.4 source, it occurs to me that:

        /* create compressed boyer-moore delta 1 table */

        /* process pattern[:-1] */
for (i = 0; i &amp;lt; mlast; i++) {
            STRINGLIB_BLOOM_ADD(mask, p[i]);
            if (p[i] == p[mlast])
                skip = mlast - i - 1;
        }
        /* process pattern[-1] outside the loop */
        STRINGLIB_BLOOM_ADD(mask, p[mlast]);

is essentially (well, sort-if) the same as the compile() step of a regex.  For the (presumably) common use case of searching many strings for the same substring (which is what we're doing here), it seems like it would be a win to cache the mask and reuse it if the search string id is the same as the last search string id.  The overhead on cache misses would be a single pointer comparison.  Has anybody looked at doing that?
&lt;/pre&gt;</description>
    <dc:creator>Roy Smith</dc:creator>
    <dc:date>2013-06-19T19:55:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736157">
    <title>Re: Default Value</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736157</link>
    <description>&lt;pre&gt;
By the evil hands of an illogical consistency.

Have you ever heard the old adage: "The road to hell is
paved in good intentions"? Well, apparently the original
designers of the language called in sick the day that class
was taught. It's unfortunate because the same functionality
that this "intention" claims to solve can be reproduced
easily, and in a less astonishing manner, by the programmer
himself.

  http://en.wikipedia.org/wiki/Principle_of_least_astonishment
  
&lt;/pre&gt;</description>
    <dc:creator>Rick Johnson</dc:creator>
    <dc:date>2013-06-19T19:38:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736156">
    <title>Re: Default Value</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736156</link>
    <description>&lt;pre&gt;

Functions are objects with their own attributes. The default values
are computed and stored when the def statement is executed.

dir(f) will show the attributes of f. Their names start and end with a
double underscore, __. This indicates that they are not usually used
explicitly. Still, f.__defaults__ seems to be where the default value
is kept between (and during) calls.
&lt;/pre&gt;</description>
    <dc:creator>Jussi Piitulainen</dc:creator>
    <dc:date>2013-06-19T19:35:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736155">
    <title>Re: A Beginner's Doubt</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736155</link>
    <description>&lt;pre&gt;
On Wednesday, June 19, 2013 12:57:06 PM UTC-5, Terry Reedy wrote:

Actually Terry, a GUI window is a GUI window -- whether or
not the window displays "user window management controls" is
irrelevant. Consider this example using Tkinter:

## BEGIN SCRIPT ##
import Tkinter as tk

MSG = """\
Your Screwed: Muhahahaha!

Well, not really, you can destroy the window
since i provided a secret exit. But you cannot
maximize or minimize!!!

Muhahahahaha!

...Oh just get out of here already!"""

class App(tk.Tk):
    def __init__(self):
        tk.Tk.__init__(self)
        self._createWidgets()
    
    def _createWidgets(self):
        _ = 'Create User Controllable Window'
        w = tk.Button(self, text=_, command=self._cb1)
        w.pack(padx=5, pady=5)
        _ = 'Create User Pwned Window'
        w = tk.Button(self, text=_, command=self._cb2)
        w.pack(padx=5, pady=5)
    
    def _cb1(self):
        win = tk.Toplevel(self)
        win.title('User Controllable')
        win.geometry('500x500+20+20')
       &lt;/pre&gt;</description>
    <dc:creator>Rick Johnson</dc:creator>
    <dc:date>2013-06-19T19:25:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736154">
    <title>Default Value</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736154</link>
    <description>&lt;pre&gt;I'm reading the Python.org tutorial right now, and I found this part rather strange and incomprehensible to me&amp;gt;

Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes
def f(a, L=[]):
    L.append(a)
    return L

print(f(1))
print(f(2))
print(f(3))

This will print
[1]
[1, 2]
[1, 2, 3]

How the list is retained between successive calls? And why?
&lt;/pre&gt;</description>
    <dc:creator>Ahmed Abdulshafy</dc:creator>
    <dc:date>2013-06-19T19:17:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736153">
    <title>Re: Don't feed the troll...</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736153</link>
    <description>&lt;pre&gt;On Wed, Jun 19, 2013 at 4:57 AM, Antoon Pardon
&amp;lt;antoon.pardon&amp;lt; at &amp;gt;rece.vub.ac.be&amp;gt; wrote:

Count me among those who feel this way.


No, I don't agree with that at all.  Trolls are to be expected because
there will always be those out in the world who want to have a little
fun and have no regard for either the list or those who use it.  There
is nothing to be done about that.  On the other hand, the flamers
responding to the trolls are regular contributers to the list who
presumably do care about keeping the list courteous, respectful,
welcoming and enjoyable to participate in.  Toward that end, I do not
think it is at all unreasonable to expect posters not to throw those
principles out the window just because a troll showed up.


Ultimately there is no enforcement on this list, and all of us must
draw our own lines.  The question then is: will one draw the line
somewhere that is respectful of the list and promotes positive
contributions, or somewhere that will push others toward kill-filing
one and/or giving up &lt;/pre&gt;</description>
    <dc:creator>Ian Kelly</dc:creator>
    <dc:date>2013-06-19T18:40:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736152">
    <title>Re: A Beginner's Doubt</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736152</link>
    <description>&lt;pre&gt;
One of those questions is too easy :P.

But, no, I'd actually point out that Python might *not* be the best
language for the job! *GASP!* *HERETIC* *I'M TELLING!*

If you just want a GUI interface program, I'd recommend JavaScript.
Heck, if you don't mind the compiler troubles I'd use CoffeeScript.

"Why?!" You scream! Well, it's definitely not the language. The GUI
toolkit, HTML, however, is ace for really small
compatibility-don't-really-matter scripts. A couple old examples from
before I "went Python" are attached, not to show off the somewhat lame
code but just to point out that even as a new programmer these things
were *concise*. That made them so many billions of times easier.

&amp;lt;Beside the Point&amp;gt;
Be careful not to mistake the libraries I used for the code I wrote,
too. The amount of code *I* wrote for each numbers very few lines
(just the main two html files).
About half in total was HTML/CSS, so doesn't even count as code. I
wrote these for me, so pretend they're licensed strictly. Anything I
can gi&lt;/pre&gt;</description>
    <dc:creator>Joshua Landau</dc:creator>
    <dc:date>2013-06-19T18:34:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736151">
    <title>Re: Timsort in Cpython</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736151</link>
    <description>&lt;pre&gt;
That's not exactly correct.  The arguments are listed in that order,
but in fact the arguments to list.sort are keyword-only and cannot be
supplied positionally.  So the "args" argument is expected to be an
empty tuple, and the "kwds" argument is a dict that contains both the
"key" and "reverse" arguments, if they were supplied.


It's a pointer to a struct that contains information like the class
and reference count of the object.


That's a pointer to a larger struct that shares the same header as the
PyObject* struct (which is basically how you do inheritance in C).  It
adds information like the length and capacity of the list, plus a
pointer to an array of PyObject* that stores the contents of the list.


To answer that question, you should really delve into the source and
see what these structs actually look like.  But the first is going to
contain an array of five PyObject* values, each of which references an
int, while the second is going to contain an array of three PyObject*
values, each of which r&lt;/pre&gt;</description>
    <dc:creator>Ian Kelly</dc:creator>
    <dc:date>2013-06-19T18:20:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736150">
    <title>Re: A Beginner's Doubt</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736150</link>
    <description>&lt;pre&gt;
Do you literally mean a full screen *window*, like a browser maximized, 
with frame and title bar with Minimize, Restore/Maximize, and Close 
buttons? or a full-screen app without the frame, like full-screen games?

Tkinter, Wx, etc, are meant for the former, Pygame, etc, for the latter.

  -&amp;gt; Title and brief introductory text -&amp;gt; 3 Buttons (Credits) 
(Instructions) and (Start)

If you open Idle and click Help / About IDLE, you will see a dialog box 
with title, text, and two groups of 3 buttons that open plain text, 
including Credits, in a separate window with a close (return) button. It 
you decide to use tkinter, this would give you a start. The code is in 
Lib/idlelib/aboutDialog.py. I do not know how to make the 'dialog' be a 
main window instead, nor how to replace a main window with a new set of 
widgets (as opposed to opening a new window), but I presume its 
possible. If so, I am sure Rick could tell us how.


Is this really required, as opposed to a normal top menu?


I am not sure what you mean b&lt;/pre&gt;</description>
    <dc:creator>Terry Reedy</dc:creator>
    <dc:date>2013-06-19T17:57:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736149">
    <title>Re: A Beginner's Doubt</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736149</link>
    <description>&lt;pre&gt;
Speaking with the prejudice of teaching programming for 25 years :-)
heres my take on this difference-of-opinion:

Imagine your program as a final finished product of say 2000 lines of
python.
So you have to log-up that 2000 lines one by one.  Do you prefer to
use an adder or a multiplier?
If you only do 'add-1' youve to take two thousand steps, if you allow
mul-2 and mul-5 you can reach in 7.
Chris solution -- get good before you start your actual work --
amounts to the second, Joshua's -- just start! -- to the first.

Clearly the second is preferable right?? WRONG! You could get stuck in
a multiply-by-zero loop!
So you need the right combo of plodding along (Joshua) and self-
improvement (Chris).
&lt;/pre&gt;</description>
    <dc:creator>rusi</dc:creator>
    <dc:date>2013-06-19T17:29:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736148">
    <title>Re: Timsort in Cpython</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736148</link>
    <description>&lt;pre&gt;
The second argument takes the tuple which determines which varialble(key) to use the comparator on. And the third determines whether to return the list in ascending or descending order. But how do these PyObject* look in C?

How does a PyListObject* look declared in CPython. How would something like this list = [2, 1, 5, 6, 10] look in CPython. Or what about something more complicated -- mlist = [('A',1),('B',2),('C',3)].

Thanks for the help.
&lt;/pre&gt;</description>
    <dc:creator>sean.westfall&lt; at &gt;gmail.com</dc:creator>
    <dc:date>2013-06-19T17:18:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.python.general/736147">
    <title>Re: Writing Extensions for Python 3 in C</title>
    <link>http://permalink.gmane.org/gmane.comp.python.general/736147</link>
    <description>&lt;pre&gt;
You need to tell what youve read, what youve tried, where stuck.
Yes the extending and embedding stuff http://docs.python.org/2/extending/
and
http://docs.python.org/2/c-api/index.html is more difficult than much
other than other python docs.

That is intrinsic to the problem -- you are not in the python world
but the C world and C is a much harder and headachey-er than python.
And building the python infrastructure on top of that is still harder.

If you have to use it, you really need to get the data-structure
invariants right: eg http://docs.python.org/2/c-api/intro.html#objects-types-and-reference-counts.

However as Terry suggests, using something like Cython to avoid this
should always be first explored.  Heres a list

1. 'Classic' extending/embedding
2. SCXX
3. PyCXX
4. Boost
5. Ctypes
6. Swig
7. Sip
8. cython

Explore in reverse order!
&lt;/pre&gt;</description>
    <dc:creator>rusi</dc:creator>
    <dc:date>2013-06-19T17:11:30</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.python.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.python.general</link>
  </textinput>
</rdf:RDF>
