On 30 June 2013 07:06, Chris Angelico wrote:
> There's a bit of a discussion on python-ideas that includes a function
> that raises StopIteration. It inspired me to do something stupid, just
> to see how easily I could do it...
>
> On Sun, Jun 30, 2013 at 3:45 PM, Nick Coghlan wrote:
> Re: [Pytho
On Sun, Jun 30, 2013 at 12:11 AM, Terry Reedy wrote:
> On 6/30/2013 1:46 AM, Ian Kelly wrote:
>
>> On a related note, I think that generator functions should in some way
>> be explicitly marked as such in the declaration, rather than needing
>> to scan the entire function body for a yield statemen
On 6/30/2013 1:46 AM, Ian Kelly wrote:
On a related note, I think that generator functions should in some way
be explicitly marked as such in the declaration, rather than needing
to scan the entire function body for a yield statement to determine
whether it's a generator or not.
I agree that o
There's a bit of a discussion on python-ideas that includes a function
that raises StopIteration. It inspired me to do something stupid, just
to see how easily I could do it...
On Sun, Jun 30, 2013 at 3:45 PM, Nick Coghlan wrote:
Re: [Python-ideas] "Iteration stopping" syntax
def stop():
> .
On Sun, Jun 30, 2013 at 3:46 PM, Ian Kelly wrote:
> On a related note, I think that generator functions should in some way
> be explicitly marked as such in the declaration, rather than needing
> to scan the entire function body for a yield statement to determine
> whether it's a generator or not.
On Sat, Jun 29, 2013 at 10:32 PM, Terry Reedy wrote:
> On 6/29/2013 5:21 PM, Ian Kelly wrote:
>> Or simply an explicit declaration of scope at the beginning of the
>> function definition.
>
> One of the reasons I switched to Python was to not have to do that, or
> hardly ever. For valid code, an n
On Sun, Jun 30, 2013 at 2:32 PM, Terry Reedy wrote:
> On 6/29/2013 5:21 PM, Ian Kelly wrote:
>>
>> On Sat, Jun 29, 2013 at 2:53 PM, Terry Reedy wrote:
>>>
>>> # The alternative for either program or people is a 1-pass + backtracking
>>> process where all understandings are kept provisional until
On 6/29/2013 5:21 PM, Ian Kelly wrote:
On Sat, Jun 29, 2013 at 2:53 PM, Terry Reedy wrote:
# The alternative for either program or people is a 1-pass + backtracking
process where all understandings are kept provisional until the end of the
body and revised as required. 2 passes are simpler.
O
On Sat, 29 Jun 2013 14:42:58 -0500, Tim Chase wrote:
> On 2013-06-29 19:19, Steven D'Aprano wrote:
>> Nobody ever asks why Python doesn't let you sort an int, or take the
>> square of a list...
>
> just to be ornery, you can sort an int:
>
i = 314159265
''.join(sorted(str(i)))
> '11234
On Wed, Jun 26, 2013 at 9:40 PM, Roy Smith wrote:
> For further hack value, require that all pull requests to the project be
> done entirely in iambic pentameter:
>
> for host in hosts:
>deploy(the_code).remote()
For further hack delight, require a patch
Submitted for this code restrict itsel
In order to get the ball rolling, and because after hours of futzing I
still can't get the diff to work (yeah, fine, I'm incompetent), I've
started sketching out how a PEP for http://bugs.python.org/issue2292,
"Missing *-unpacking generalizations" might look.
It's attached if anyone cares to look.
On 06/29/2013 01:20 PM, cts.private.ya...@gmail.com wrote:
> exactly that. Without wanting to analyze it in too much depth now, I
> would want a local keyword to allow me to know I was protecting my
> variables, and a way to specify other scopes, without so much implied
> scoping in non-intuitive
On 06/29/2013 01:19 PM, Steven D'Aprano wrote:
> Python's basic data types are not necessarily immutable. Lists and dicts
> are not immutable. Being a high-level language, the idea of "primitives"
> like int, double, float, etc from C doesn't really apply. A Python dict
> is not made up from Pyt
No, actually, it's okay that it's local by default, after all. TCL's got that
capability of explicitly specifying the scope (up n or something like that?).
That's okay for tcl, not sure if it would seem so elegant for python. But you
can't tell me that the scenarios that I presented in the be
On Sat, Jun 29, 2013 at 2:53 PM, Terry Reedy wrote:
> # The alternative for either program or people is a 1-pass + backtracking
> process where all understandings are kept provisional until the end of the
> body and revised as required. 2 passes are simpler.
Or simply an explicit declaration of s
On 2013-06-29, Steven D'Aprano wrote:
> On Sat, 29 Jun 2013 19:13:47 +, Martin Schöön wrote:
>
>> $PYTHONPATH points at both the code and the test directories.
>>
>> When I run blablabla_test.py it fails to import blablabla.py
>
> What error message do you get?
>
>
>> I have messed around f
On 6/29/2013 3:47 PM, Ian Kelly wrote:
On Sat, Jun 29, 2013 at 1:33 PM, Steven D'Aprano
wrote:
On Sat, 29 Jun 2013 12:20:45 -0700, cts.private.yahoo wrote:
Huh? What language are you programming in? Python doesn't have implied
scoping in non-intuitive ways.
def f(x):
def g(y):
The game has a homepage now so you can follow the game there,
see http://www.zeldadungeon.net/wiki/The_adventure_of_Link_2
There's also lots of screenshots on that page.
TW
--
http://mail.python.org/mailman/listinfo/python-list
On 29 June 2013 18:00, Mark Lawrence wrote:
> On 29/06/2013 17:05, Joshua Landau wrote:
>>
>
> Why this when the approach to Nick the Incompetant Greek has been to roll
> out the red carpet?
I am my own person, and should not be judged by the actions of others.
--
http://mail.python.org/mailman
On 29 June 2013 20:42, Tim Chase wrote:
> On 2013-06-29 19:19, Steven D'Aprano wrote:
>> Nobody ever asks why Python doesn't let you sort an int, or take
>> the square of a list...
>
> just to be ornery, you can sort an int:
>
i = 314159265
''.join(sorted(str(i)))
> '112345569'
To be ye
On Sat, Jun 29, 2013 at 1:33 PM, Steven D'Aprano
wrote:
> On Sat, 29 Jun 2013 12:20:45 -0700, cts.private.yahoo wrote:
>> Without wanting to analyze it in too much depth now, I
>> would want a local keyword to allow me to know I was protecting my
>> variables, and a way to specify other scopes, wi
On 06/28/2013 10:28 PM, Steven D'Aprano wrote:
I'm willing to concede that, just maybe, something like argparse could
default to "catch exceptions and exit" ON rather than OFF.
On this we can agree. :)
--
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-06-29 19:19, Steven D'Aprano wrote:
> Nobody ever asks why Python doesn't let you sort an int, or take
> the square of a list...
just to be ornery, you can sort an int:
>>> i = 314159265
>>> ''.join(sorted(str(i)))
'112345569'
And I suppose, depending on how you define it, you can square
Touchy aren't we ...
:)
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 29 Jun 2013 19:13:47 +, Martin Schöön wrote:
> $PYTHONPATH points at both the code and the test directories.
>
> When I run blablabla_test.py it fails to import blablabla.py
What error message do you get?
> I have messed around for oven an hour and get nowhere. I have done
> unitt
On Sat, 29 Jun 2013 12:20:45 -0700, cts.private.yahoo wrote:
> exactly that.
Exactly what? Who are you replying to? Your post has no context.
> Without wanting to analyze it in too much depth now, I
> would want a local keyword to allow me to know I was protecting my
> variables, and a way to
In article ,
Martin Schöön wrote:
> I know the answer to this must be trivial but I am stuck...
>
> I am starting on a not too complex Python project. Right now the
> project file structure contains three subdirectories and two
> files with Python code:
>
> code
>blablabla.py
> test
>b
exactly that. Without wanting to analyze it in too much depth now, I would
want a local keyword to allow me to know I was protecting my variables, and a
way to specify other scopes, without so much implied scoping in non-intuitive
ways...
Now everybody is gonna tell me how wrong I am, but you
On Sat, Jun 29, 2013 at 11:02 AM, Antoon Pardon
wrote:
> Op 29-06-13 16:02, Michael Torrie schreef:
>
>>
>> The real problem here is that you don't understand how python variables
>> work. And in fact, python does not have variables. It has names that
>> bind to objects.
>
>
> I don't understand
On Sat, 29 Jun 2013 12:35:54 -0600, Michael Torrie wrote:
> Python's
> basic data types are immutable. At best we could say they are read-only
> variables.
Python's basic data types are not necessarily immutable. Lists and dicts
are not immutable. Being a high-level language, the idea of "primi
I know the answer to this must be trivial but I am stuck...
I am starting on a not too complex Python project. Right now the
project file structure contains three subdirectories and two
files with Python code:
code
blablabla.py
test
blablabla_test.py
doc
(empty for now)
blablabla_test.p
On Sunday, June 30, 2013 12:21:35 AM UTC+5:30, Steven D'Aprano wrote:
> On Sat, 29 Jun 2013 19:02:01 +0200, Antoon Pardon wrote:
> > We might as well say that C doesn't have variables, it has names
> > pointing to memory locations or value containers or something like that.
> >
> > AFAICS there is
On 06/29/2013 12:51 PM, Steven D'Aprano wrote:
> You are absolutely correct in principle. But in practice, there are ten
> bazillion C, Pascal, COBOL, and BASIC programmers who understand the word
> "variable" to mean a named memory location, for every Smalltalk or Lisp
> programmer who understa
On Sat, 29 Jun 2013 18:45:30 +, Steven D'Aprano wrote:
> Python require declarations for local names, but if it did it would
> probably use "local".
Oops, I meant *doesn't* require declarations. Sorry for the error.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 29 Jun 2013 11:37:55 -0700, cts.private.yahoo wrote:
> :) Thank you guys for saying what I was biting my tongue about (thanks
> everybody for the help, BTW!).
>
> This "python-think" stuff was starting to get on my nerves - but then it
> occurred to me that - although having many powerfu
On 06/29/2013 12:37 PM, cts.private.ya...@gmail.com wrote:
> :) Thank you guys for saying what I was biting my tongue about
> (thanks everybody for the help, BTW!).
Sometimes it's best to state the actual problem you're trying to solve
and see if there's a pythonic solution that fits it rather th
On Sat, 29 Jun 2013 19:02:01 +0200, Antoon Pardon wrote:
> Op 29-06-13 16:02, Michael Torrie schreef:
>>
>> The real problem here is that you don't understand how python variables
>> work. And in fact, python does not have variables. It has names that
>> bind to objects.
>
> I don't understand
On Sat, 29 Jun 2013 04:21:46 -0700, cts.private.yahoo wrote:
> Thank you. You reminded me of the (weak) workaround of using arrays
I think you mean lists, rather than arrays. Python does have an array
type, but it is much more restricted.
If you want an indirect reference to a value, the simp
:) Thank you guys for saying what I was biting my tongue about (thanks
everybody for the help, BTW!).
This "python-think" stuff was starting to get on my nerves - but then it
occurred to me that - although having many powerful features - it has so many
weird restrictions that it requires a spe
On 06/29/2013 07:56 AM, Michael Torrie wrote:
> x = [ 34, ]
>
> def test_func( out ):
> out[0] += 12
>
> test_func(x)
>
> print (x)
Well, actually
print (x[0])
--
http://mail.python.org/mailman/listinfo/python-list
On 06/29/2013 11:02 AM, Antoon Pardon wrote:
> Op 29-06-13 16:02, Michael Torrie schreef:
>>
>> The real problem here is that you don't understand how python variables
>> work. And in fact, python does not have variables. It has names that
>> bind to objects.
>
> I don't understand why members o
I have a certain GUI program that I built using Python 2.7 and PyQt4.
I want to convert it into a standalone windows executable.
I went through the docs for Pyinstaller-2.0 and tried several times but I think
that I might be on the wrong approach.
Here is the structure of my Program.
[Resource
On Saturday, June 29, 2013 10:32:01 PM UTC+5:30, Antoon Pardon wrote:
> Op 29-06-13 16:02, Michael Torrie schreef:
> > The real problem here is that you don't understand how python variables
> > work. And in fact, python does not have variables. It has names that
> > bind to objects.
>
> I don't
Op 29-06-13 16:02, Michael Torrie schreef:
The real problem here is that you don't understand how python variables
work. And in fact, python does not have variables. It has names that
bind to objects.
I don't understand why members of this list keep saying this. Sure the
variables in python
On 29/06/2013 17:05, Joshua Landau wrote:
On 29 June 2013 03:07, charles benoit wrote:
1) You haven't asked a question.
2) You posted your code twice. That makes it look a lot harder and
longer than it really is.
3) Give us a *minimal* reproducible test case. I currently just get:
%~> pytho
On Sat, 29 Jun 2013 04:29:23 -0700, fobos3 wrote:
> Hi,
>
> I am trying to use a program called MeCab, which does syntax analysis on
> Japanese text. The problem I am having is that it returns a byte string
> and if I try to print it, it prints question marks for almost all
> characters. However,
On 29/06/2013 12:29, fob...@gmail.com wrote:
Hi,
I am trying to use a program called MeCab, which does syntax analysis on
Japanese text. The problem I am having is that it returns a byte string and if
I try to print it, it prints question marks for almost all characters. However,
if I try to
On 29 June 2013 03:07, charles benoit wrote:
1) You haven't asked a question.
2) You posted your code twice. That makes it look a lot harder and
longer than it really is.
3) Give us a *minimal* reproducible test case. I currently just get:
%~> python2 /tmp/nd.py
Traceback (most recent call la
There now is a graph connected roomsystem which provides for a master room with
elevators and ropes to climb on. A room in a master room can be easily made out
of the file maproomcastleX.py. This is about 10 lines of code.
On my blog you can see some pictures http://thediaryofelvishhealer.blogs
On 29/06/2013 06:28, Steven D'Aprano wrote:
On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote:
On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
[rant]
I think it is lousy design for a framework like argparse to raise a
custom ArgumentError in one part of the code, only to catch it
elsewher
On 6/29/2013 11:32 AM, Terry Reedy wrote:
I am trying to use a program called MeCab, which does syntax analysis
on Japanese text.
It is generally nice to give a link when asking about 3rd party
software. https://code.google.com/p/mecab/
In this case, nearly all the non-boilerplate text is Jap
On 6/29/2013 10:02 AM, Dave Angel wrote:
On 06/29/2013 07:29 AM, fob...@gmail.com wrote:
Hi,
Using Python 2.7 on Linux, presumably? It'd be better to be explicit.
I am trying to use a program called MeCab, which does syntax analysis
on Japanese text.
It is generally nice to give a link w
I love the title. Reminds me of Ivanhoe ... great time travel.
--
http://mail.python.org/mailman/listinfo/python-list
On 29/06/2013 13:26, cts.private.ya...@gmail.com wrote:
"PS: If you're reading this and love the French language -- I am deeply sorry
for the pain I'm causing you..."
It's obviously a team effort...
My French ain't so hot, either. I had to google your "tout chez" until I ran
into the explanat
On 29/06/2013 14:44, Dave Angel wrote:
On 06/28/2013 11:35 PM, Titiksha wrote:
Since you're using the arrogant and buggy GoogleGroups, this
http://wiki.python.org/moin/GoogleGroupsPython.
Please don't make comments like this, you'll upset the Python Mailing
List Police.
--
"Steve is going
On 2013.06.29 09:12, Roy Smith wrote:
> What is the tracker issue number or url?
http://bugs.python.org/issue9938
--
CPython 3.3.2 | Windows NT 6.2.9200 / FreeBSD 9.1
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Terry Reedy wrote:
> > So a library that behaves like an app is OK?
>
> No, Steven is right as a general rule (do not raise SystemExit), but
> argparse was considered an exception because its purpose is to turn a
> module into an app. With the responses I have seen here, I agree
On 06/29/2013 07:29 AM, fob...@gmail.com wrote:
Hi,
Using Python 2.7 on Linux, presumably? It'd be better to be explicit.
I am trying to use a program called MeCab, which does syntax analysis on
Japanese text. The problem I am having is that it returns a byte string and if
I try to print
On 06/29/2013 05:21 AM, cts.private.ya...@gmail.com wrote:
> Thank you. You reminded me of the (weak) workaround of using arrays
> and confirmed my suspicion that I although I can read the variable, I
> won't be able to write to it. I still don't understand why not,
> though...
The real problem
On 06/29/2013 05:44 AM, cts.private.ya...@gmail.com wrote:
> Alas, one reason it's a weak workaround is that it doesn't work - at least,
> not how I wish it would:
>
>
> $ cat ptrs
>
> x = 34
>
> def p1 (a1):
>
> a1[0] += 12
>
> p1 ([x])
>
> print (x)
>
> $ python ptrs
> 34
you'll
On 2013-06-29, fob...@gmail.com wrote:
> Hi,
>
> I am trying to use a program called MeCab, which does syntax analysis on
> Japanese text. The problem I am having is that it returns a byte string
> and if I try to print it, it prints question marks for almost all
> characters. However, if I try to
On 06/28/2013 11:35 PM, Titiksha wrote:
On Friday, June 28, 2013 8:20:28 PM UTC-5, Titiksha wrote:
m=['631138', '601034', '2834', '2908', '64808']
['LAKEFLD 3227,631138\n', 'NOBLES 3013,601034\n']
Since you're using the arrogant and buggy GoogleGroups, this
On 05:28 Sat 29 Jun , Steven D'Aprano wrote:
> On Fri, 28 Jun 2013 18:36:37 -0700, Ethan Furman wrote:
>
> > On 06/27/2013 03:49 PM, Steven D'Aprano wrote:
> >>
> >> [rant]
> >> I think it is lousy design for a framework like argparse to raise a
> >> custom ArgumentError in one part of the cod
"PS: If you're reading this and love the French language -- I am deeply sorry
for the pain I'm causing you..."
It's obviously a team effort...
My French ain't so hot, either. I had to google your "tout chez" until I ran
into the explanation:
hallo :) also ich gucke super gerne two and a half
cts.private.ya...@gmail.com wrote:
> As for python 3 ... "nonlocal"? I see I'm not alone in picking obnoxious
> names ...
tous chez...
> Alas, one reason it's a weak workaround is that it doesn't work - at
> least, not how I wish it would:
> $ cat ptrs
>
> x = 34
>
> def p1 (a1):
>
> a1
Alas, one reason it's a weak workaround is that it doesn't work - at least, not
how I wish it would:
$ cat ptrs
x = 34
def p1 (a1):
a1[0] += 12
p1 ([x])
print (x)
$ python ptrs
34
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I am trying to use a program called MeCab, which does syntax analysis on
Japanese text. The problem I am having is that it returns a byte string and if
I try to print it, it prints question marks for almost all characters. However,
if I try to use .decide, it throws an error. Here is my cod
Well, it would have been French if I had spelled it right - since you force me
overcome my laziness, I see I should have spelled it lieu ...
Thank you. You reminded me of the (weak) workaround of using arrays and
confirmed my suspicion that I although I can read the variable, I won't be able
t
cts.private.ya...@gmail.com wrote:
> I'd like to use closures to set allow a subroutine to set variables in its
> caller, in leu of pointers.
"leu"? Must be a Fench word ;)
> But I can't get it to work. I have the
> following test pgm, but I can't understand its behaviour:
>
> It uses a functi
On 29 Jun 2013 10:38, wrote:
>
> Hi,
>
> I'd like to use closures to set allow a subroutine to set variables in
its caller, in leu of pointers. But I can't get it to work. I have the
following test pgm, but I can't understand its behaviour:
>
> It uses a function p2() from the module modules.clo
Hi,
I'd like to use closures to set allow a subroutine to set variables in its
caller, in leu of pointers. But I can't get it to work. I have the following
test pgm, but I can't understand its behaviour:
It uses a function p2() from the module modules.closure1b:
def p2 (proc):
proc ("d
> On 26/06/2013 9:19 AM, Mark Janssen wrote:
>>
>> Did you ever hear of the Glass Bead Game?
>
> Which was Hesse's condemnation of the
> pure-academic-understanding-unbound-by-pragmatic-use approach as mental
> masturbation,
It was not. He was conflicted. On the one hand he knew the
enterprise w
On Thu, Jun 27, 2013 at 12:13 PM, Antoon Pardon
wrote:
> So what do you think would be a good approach towards people
> who are behaving in conflict with this wish of yours? Just
> bluntly call them worse than the troll or try to approach them
> in a way that is less likely to antangonize them?
I
73 matches
Mail list logo