Hi,
we got an interesting problem. We need to monkeypatch Django's reverse
function:
First approach:
urlresolvers.reverse = patched_reverse
Problem: some of Django's internal modules import urlresolvers.reverse
before we can patch it for some reasons.
Second approach:
urlresolvers.rev
On 16.03.2016 11:28, Joaquin Alzola wrote:
If len(my_iterable) is not 0:
for x in my_iterable:
# do
else:
# do something else
I am sorry, I should have been more precise here.
my_iterable is an iterator that's exhausted after a complete iteration
and cannot be restored.
I
Hi,
a colleague of mine (I write this mail because I am on the list) has the
following issue:
for x in my_iterable:
# do
empty:
# do something else
What's the most Pythonic way of doing this?
Best,
Sven
--
https://mail.python.org/mailman/listinfo/python-list
On Tuesday, March 15, 2016 at 9:55:27 PM UTC-4, jj0ge...@gmail.com wrote:
> You have apparently mistaken me for someone who's worried. I don't use
> Python, I was just curious as to why a construct that is found, not only to
> be useful in 95% of other languages, but is generally considered more
On 12.03.2016 00:18, Fillmore wrote:
Playing with ArgumentParser. I can't find a way to override the -h and
--help options so that it provides my custom help message.
I remember everything being a lot easier using argh instead of argparse.
https://pypi.python.org/pypi/argh#examples
The doc
On 09.03.2016 19:19, Sven R. Kunze wrote:
ps: there are two error's when i ran tests with test_xheap.
Damn. I see this is Python 2 and Python 3 related. Thanks for bringing
this to my attention. I am going to fix this soon.
Fixed.
--
https://mail.python.org/mailman/listinfo/python-list
On 06.03.2016 14:59, Sven R. Kunze wrote:
Using the original xheap benchmark
<http://srkunze.blogspot.de/2016/02/the-xheap-benchmark.html>, I could
see huge speedups: from 50x/25x down to 3x/2x compared to heapq.
That's a massive improvement. I will publish an update soon.
An
.80x) 4.41 (
0.78x) 43.86 ( 0.77x)')
So as the results are not much effected apart of __init__, i think you
should consider this.
Looks promising. I will
On 06.03.2016 19:51, Tim Chase wrote:
So it looks like one needs to either
results = reversed(list(zip(...)))
or, more efficiently (doing it with one less duplication of the list)
results = list(zip(...))
results.reverse()
Nice idea. :) Unfortunately, I used it while drafting som
On 06.03.2016 19:53, Peter Otten wrote:
Sven R. Kunze wrote:
what's the reason that reversed(zip(...)) raises as a TypeError?
Would allowing reversed to handle zip and related functions lead to
strange errors?
In Python 3 zip() can deal with infinite iterables -- what would you expect
Hi,
what's the reason that reversed(zip(...)) raises as a TypeError?
Would allowing reversed to handle zip and related functions lead to
strange errors?
Best,
Sven
--
https://mail.python.org/mailman/listinfo/python-list
Hi python-list, hi Srinivas,
I managed to implement the mark&sweep approach for fast removal from
heaps. This way, I got three pleasant results:
1) a substantial speed up!
2) an improved testsuite
3) discovery and fixing of several bugs
@Srinivas I would be honored if you could have a look at
On Friday, February 26, 2016 at 9:57:21 AM UTC-5, Wingware wrote:
> Hi,
>
> Wingware has released version 5.1.10 of Wing IDE, our cross-platform
> integrated development environment for the Python programming language.
>
> Wing IDE features a professional code editor with vi, emacs, visual
> st
On Friday, February 26, 2016 at 2:36:26 PM UTC-5, Anita Goyal wrote:
> This course will help you to expertise the usage of Python in Data Science
> world.
>
> Carter your Python Knowledge so that it can be utilized to get the Insights
> of Data using Methodologies and Techniques of Data Science.
On 01.03.2016 13:13, Steven D'Aprano wrote:
On Tue, 1 Mar 2016 09:38 am, Larry Martell wrote:
But what is reality?
Reality is that which, when you stop believing in it, doesn't go away.
Just like that.
--
https://mail.python.org/mailman/listinfo/python-list
On Saturday, February 27, 2016 at 4:39:12 AM UTC-5, Steven D'Aprano wrote:
> The author of Requests, Kenneth Reitz, discusses his recent recovery from a
> MentalHealthError exception.
>
> http://www.kennethreitz.org/essays/mentalhealtherror-an-exception-occurred
>
> Although the connection to Pyt
On 28.02.2016 07:34, Steven D'Aprano wrote:
I think that's out-and-out wrong, and harmful to the developer community. I
think that we're stuck in the equivalent of the pre-WYSIWYG days of word
processing: you can format documents as nicely as you like, but you have to
use a separate mode to see i
On 27.02.2016 12:48, Terry Reedy wrote:
On 2/27/2016 4:44 AM, Steven D'Aprano wrote:
On Sat, 27 Feb 2016 07:55 pm, Terry Reedy wrote:
In other words, when that doc says *list*, it means a *list*.
"To create a heap, use a list initialized to [], or you can transform a
populated list into a hea
On 27.02.2016 00:07, eryk sun wrote:
On Fri, Feb 26, 2016 at 4:08 PM, Sven R. Kunze wrote:
Python sometimes seems not to hop back and forth between C and Python code.
Can somebody explain this?
Normally a C extension would call PySequence_SetItem, which would call
the type's sq_ass
On 26.02.2016 23:37, Ian Kelly wrote:
On Fri, Feb 26, 2016 at 3:08 PM, Sven R. Kunze wrote:
Python sometimes seems not to hop back and forth between C and Python code.
C code as a rule tends to ignore dunder methods. Those are used to
implement Python operations, not C operations.
Ah, good
Hi everybody,
I recognized the following oddity (background story:
http://srkunze.blogspot.com/2016/02/lets-go-down-rabbit-hole.html).
Python sometimes seems not to hop back and forth between C and Python code.
Can somebody explain this?
class MyList(list):
count = 0
def __setitem__
On 20.02.2016 07:53, Christian Gollwitzer wrote:
If you have difficulties wit hthe overall concept, and if you are open
to discussions in another language, take a look at this video:
https://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-39-await-co-routines
MS has added coroutine suppo
On 23.02.2016 18:37, Ian Kelly wrote:
It's not entirely clear to me what the C++ is actually doing. With
Python we have an explicit event loop that has to be started to manage
resuming the coroutines. Since it's explicit, you could easily drop in
a different event loop, such as Tornado or curio,
On 23.02.2016 01:48, Ian Kelly wrote:
On Mon, Feb 22, 2016 at 3:16 PM, Sven R. Kunze wrote:
Is something like shown in 12:50 ( cout << tcp_reader(1000).get() ) possible
with asyncio? (tcp_reader would be async def)
loop = asyncio.get_event_loop()
print(loop.run_until_complete(tcp_reade
On 20.02.2016 07:53, Christian Gollwitzer wrote:
If you have difficulties wit hthe overall concept, and if you are open
to discussions in another language, take a look at this video:
https://channel9.msdn.com/Shows/C9-GoingNative/GoingNative-39-await-co-routines
MS has added coroutine suppo
Hi everybody,
I've finally had the time to do the benchmarks and here you go:
http://srkunze.blogspot.com/2016/02/the-xheap-benchmark.html
The benchmark compares heapq, Heap, OrderHeap, RemovalHeap and XHeap
regarding their operation heapify, push and pop.
As expected wrapping results in so
On 18.02.2016 07:59, Paul Rubin wrote:
Steven D'Aprano writes:
I suppose that it is objectively correct that it is harder to learn
than Python 2. But I don't think the learning curve is any steeper. If
anything, the learning curve is ever-so-slightly less steep.
I think py3 has more learning c
On 16.02.2016 14:05, Sven R. Kunze wrote:
Hi Srinivas,
I think the tuple assignment you showed basically nails it.
First, the rhs is evaluated.
Second, the lhs is evaluated from left to right.
Completely wrong?
Best,
Sven
As you mentioned swapping. The following two statements do the same
Hi Srinivas,
On 16.02.2016 13:46, srinivas devaki wrote:
Hi,
a = b = c
as an assignment doesn't return anything, i ruled out a = b = c as
chained assignment, like a = (b = c)
SO i thought, a = b = c is resolved as
a, b = [c, c]
at-least i fixed in my mind that every assignment like operation
I would create a RAM disk
(http://www.cyberciti.biz/faq/howto-create-linux-ram-disk-filesystem/),
generate all the path/files I want with any, or my own algorithm, run the
tests, unmount it, destroy it, be happy ... Whats wrong with that?? AFAIK, RAM
disks do not get logged, and even if they do
Hi Cem,
On 08.02.2016 02:37, Cem Karan wrote:
My apologies for not writing sooner, but work has been quite busy lately (and
likely will be for some time to come).
no problem here. :)
I read your approach, and it looks pretty good, but there may be one issue with
it; how do you handle the s
On 08.02.2016 23:13, Marko Rauhamaa wrote:
As I stated in an earlier post, a normal subroutine may turn out to be
blocking. To make it well-behaved under asyncio, you then dutifully tag
the subroutine with "async" and adorn the blocking statement with
"await". Consequently, you put "await" in fro
r i in range(n)]
random.shuffle(items)
heap = RemovalHeap(items)
random.shuffle(items)
for i in items:
heap.remove(i)
print(X.c)
X.c = 0
(note to myself: never copy PyCharm formatting strings to this list).
On 05.02.2016 17:27, Sven R. Kunze wrote:
Hi srinivas,
Hi srinivas,
I wrote this simple benchmark to measure comparisons:
import random
from xheapimport RemovalHeap
class X(object):
c =0 def __init__(self, x):
self.x = x
def __lt__(self, other):
X.c +=1 return self.x < other.x
n =10 for jjin range(5):
items = [X(i
On 05.02.2016 15:48, Bernardo Sulzbach wrote:
On 02/05/2016 12:42 PM, Sven R. Kunze wrote:
PS: I do competitive programming, I use these modules every couple of
days
when compared to other modules. so didn't give much thought when
posting to
the mailing list. sorry for that.
Compet
On 05.02.2016 02:26, srinivas devaki wrote:
as I come to think of it again, it is not subheap, it actually heap cut at
some level hope you get the idea from the usage of _siftup. so even though
the `pos` children are valid the _siftup brings down the new element (i.e
the element which is at first
On 05.02.2016 01:12, Steven D'Aprano wrote:
On Fri, 5 Feb 2016 07:50 am, srinivas devaki wrote:
_siftdown function breaks out of the loop when the current pos has a valid
parent.
but _siftup function is not implemented in that fashion, if a valid
subheap is given to the _siftup, it will bring
On 04.02.2016 19:35, Random832 wrote:
On Thu, Feb 4, 2016, at 11:18, Sven R. Kunze wrote:
On 04.02.2016 00:47, Random832 wrote:
On Wed, Feb 3, 2016, at 16:43, Sven R. Kunze wrote:
Actually a nice idea if there were no overhead of creating methods for
all heap instances separately. I'll
On 04.02.2016 00:47, Random832 wrote:
On Wed, Feb 3, 2016, at 16:43, Sven R. Kunze wrote:
Actually a nice idea if there were no overhead of creating methods for
all heap instances separately. I'll keep that in mind. :)
What about changing the class of the object to one which is inherited
On 03.02.2016 22:34, Bernardo Sulzbach wrote:
Did Peter's suggestion work?
Somewhat for a single Heap class.
However, it breaks inheritance.
--
https://mail.python.org/mailman/listinfo/python-list
On 03.02.2016 22:15, Peter Otten wrote:
The technical reason is that functions written in C don't implement the
descriptor protocol. The bound method is created by invoking the __get__
method of the class attribute:
Good to know. :-/
It's sad. These functions just look so method-like.
Bes
On 03.02.2016 22:19, Peter Otten wrote:
You could try putting
self.heappush = functools.partial(heapq.heappush, self)
into the initializer.
Actually a nice idea if there were no overhead of creating methods for
all heap instances separately. I'll keep that in mind. :)
--
https://mail.pytho
On 03.02.2016 22:14, Bernardo Sulzbach wrote:
Thanks for quoting, for some reason my client always replies to the
person and not the list (on this list only).
I did what I could. I could show you a lambda function there, but it
doesn't solve anything. If there is a way to avoid a wrapper, I don'
On 03.02.2016 22:06, Bernardo Sulzbach wrote:
I may say something wrong, but this is what I see going on:
When you get "replace = heapreplace" you are creating a data attribute
called replace (you will access it by self.replace or
variable.replace) that is an alias for heapreplace.
When you cal
On 03.02.2016 21:40, Bernardo Sulzbach wrote:
I am not entirely sure about what your question is.
Are you talking about the "heapreplace expected 2 arguments, got 1"
you get if you set replace = heapreplace?
Yes, I think so.
I might ask differently: why do I need to write wrapper method when
Hi,
as you might have noticed, I am working on
https://github.com/srkunze/xheap right now.
In order to make it even faster and closer to heapq's baseline
performance, I wonder if there is a possibility of creating fast
wrappers for functions.
Please compare
https://github.com/srkunze/xhe
On 02.02.2016 01:48, srinivas devaki wrote:
On Feb 1, 2016 10:54 PM, "Sven R. Kunze" <mailto:srku...@mail.de>> wrote:
>
> Maybe I didn't express myself well. Would you prefer the sweeping
approach in terms of efficiency over how I implemented xheap currently?
&g
On 31.01.2016 02:48, Steven D'Aprano wrote:
On Sunday 31 January 2016 09:47, Sven R. Kunze wrote:
@all
What's the best/standardized tool in Python to perform benchmarking?
timeit
Thanks, Steven.
Maybe, I am doing it wrong but I get some weird results:
>>> min(timeit.Ti
it is
brilliant of you to simply use __setitem__
Thanks. :)
On Sun, Jan 31, 2016 at 4:17 AM, Sven R. Kunze wrote:
Hi again,
as the topic of the old thread actually was fully discussed, I dare to open
a new one.
I finally managed to finish my heap implementation. You can find it at
Hi again,
as the topic of the old thread actually was fully discussed, I dare to
open a new one.
I finally managed to finish my heap implementation. You can find it at
https://pypi.python.org/pypi/xheap + https://github.com/srkunze/xheap.
I described my motivations and design decisions at
Hi again,
as the topic of the old thread actually was fully discussed, I dare to
open a new one.
I finally managed to finish my heap implementation. You can find it at
https://pypi.python.org/pypi/xheap + https://github.com/srkunze/xheap.
I described my motivations and design decisions at
On 29.01.2016 23:49, Ben Finney wrote:
"Sven R. Kunze" writes:
On 29.01.2016 01:01, Fillmore wrote:
How was the Python 2.7 vs Python 3.X solved? which version should I
go for?
Python 3 is the new and better one.
More importantly: Python 2 will never improve; Python 3 is the onl
Hi,
On 29.01.2016 01:01, Fillmore wrote:
I look and Python and it looks so much more clean
add to that that it is the language of choice of data miners...
add to that that iNotebook looks powerful
All true. :)
Does Python have Regexps?
"import re"
https://docs.python.org/3.5/li
I think you'd do better using the pyparsing library
On Friday, January 22, 2016 at 9:02:00 AM UTC-5, inhahe wrote:
> I hope this is an appropriate mailing list for BeautifulSoup questions,
> it's been a long time since I've used python-list and I don't remember if
> third-party modules are on to
Just get better Laura...
--
https://mail.python.org/mailman/listinfo/python-list
Hi Gert,
just upgrade to 5.03.
Best,
Sven
On 13.01.2016 18:38, Gert Förster wrote:
Ladies, Gentlemen,
using the PyCharm Community Edition 4.5.4, with Python-3-5-1-amd64.exe,
there is constantly a “Repair”-demand. This is “successful” when executed.
Without execution, there results an “Error
On 13.01.2016 12:20, Cem Karan wrote:
On Jan 12, 2016, at 11:18 AM, "Sven R. Kunze" wrote:
Thanks for replying here. I've come across these types of
wrappers/re-implementations of heapq as well when researching this issue. :)
Unfortunately, they don't solve the unde
On 12.01.2016 03:48, Cem Karan wrote:
Jumping in late, but...
If you want something that 'just works', you can use HeapDict:
http://stutzbachenterprises.com/
I've used it in the past, and it works quite well. I haven't tested its
asymptotic performance though, so you might want to check int
On 09.01.2016 19:32, Paul Rubin wrote:
"Sven R. Kunze" writes:
Basically a task scheduler where tasks can be thrown away once they
are too long in the queue.
I don't think there's a real nice way to do this with heapq. The
computer-sciencey way would involve separate bala
r email.
I'm using minimum number has highest priority convention.
I like Web technology, so no problem here. :)
On Fri, Jan 8, 2016 at 10:15 PM, Sven R. Kunze wrote:
Thanks for your suggestion.
On 08.01.2016 14:21, srinivas devaki wrote:
You can create a single heap with primary key as
Thanks for your reply.
On 08.01.2016 14:26, Peter Otten wrote:
Sven R. Kunze wrote:
Hi everybody,
suppose, I need items sorted by two criteria (say timestamp and
priority). For that purpose, I use two heaps (heapq module):
heapA # items sorted by timestamp
heapB # items sorted by priority
Hi Saski,
Python's dataset processing machine is *pandas*.
Have a look at this cookbook entry here:
http://nbviewer.ipython.org/github/jvns/pandas-cookbook/blob/v0.1/cookbook/Chapter%204%20-%20Find%20out%20on%20which%20weekday%20people%20bike%20the%20most%20with%20groupby%20and%20aggregate.ipyn
thrown away once they are
too long in the queue.
On Fri, Jan 8, 2016 at 4:22 AM, Sven R. Kunze wrote:
Hi everybody,
suppose, I need items sorted by two criteria (say timestamp and priority).
For that purpose, I use two heaps (heapq module):
heapA # items sorted by timestamp
heapB # items
Hi everybody,
suppose, I need items sorted by two criteria (say timestamp and
priority). For that purpose, I use two heaps (heapq module):
heapA # items sorted by timestamp
heapB # items sorted by priority
Now my actual problem. When popping an item of heapA (that's the oldest
item), I need
On Tue, Nov 17, 2015 at 10:18 AM, Seymore4Head wrote:
> On Tue, 17 Nov 2015 10:09:27 +0530, Abhiram R
> wrote:
>
> >On Tue, Nov 17, 2015 at 9:59 AM, Seymore4Head
>
> >wrote:
> >
> >> http://www.practicepython.org/exercise/2014/03/12/06-string-lists.h
rint str1
> --
>
>
The question asks to get an input from the user and print if it's a
palindrome or not.
It should be just
strA=raw_input()
if strA==strA[::-1]:
print "Palindrome"
else:
print "Not"
Right? Am I missing something? Why are you generat
>
> I will give the team viewer ID of my machine so can you please install
the pywin32 module to me.
>
Hi ,
It's best if you install it yourself. It isn't really complicated. :) and
you'll learn it in the process as well
Steps you could possibly Google -
1) installation of Python 3.5 (which i bel
Hmm, why not. :D
On 22.09.2015 20:43, Python_Teacher via Python-list wrote:
you have 10 minutes😂 Good luck!!
1. What is PEP8 ?
A PEP.
2. What are the different ways to distribute some python source code ?
unison, rsync, scp, ftp, sftp, samba, http, https, mail, git,
2 Lists
Let's
Hi Joseph,
the basic wiring instances together is done via the assignment operator:
"=". Like: queue._api = foo. Now, the "queue" knows about its API instance.
Question now is, when do you do "="?
On 18.09.2015 23:43, Joseph L. Casale wrote:
This is where I am going, but how do you perform d
On 18.09.2015 17:28, Joseph L. Casale wrote:
So a design pattern I use often is to create Python objects to represent
objects returned from what ever api I am abstracting. For example I
might create named tuples for static data I dont intend to change or
for an object I can both query for and cre
On 17.09.2015 23:26, Tim Chase wrote:
On 2015-09-17 22:46, Sven R. Kunze wrote:
Btw. ASCII art is also art. So, why does Python not have ASCII
art to define graphs and diagrams?
Nowadays it would have to support Unicode art. Mustn't
leave out all the world's non-English-speaking art
On 17.09.2015 23:38, Marko Rauhamaa wrote:
Random832 :
It being *easier to implement* to have comparison operators be a
single class and have chaining apply equally to all of them may be an
excuse for the language to allow it, but it's certainly not an excuse
for *actually* using it from a stan
Well, I would be interested in seeing such a module as well.
Most modules and frameworks, I know, providing REST and interacting with
REST are more like traditional SOAP-like web services. You got your
functions which have a 1-to-1 correspondence with some resource URLs and
that's it.
Actual
On 17.09.2015 08:39, Gregory Ewing wrote:
Sven R. Kunze wrote:
Btw. ASCII art is also art. So, why does Python not have ASCII art to
define graphs and diagrams?
Nowadays it would have to support Unicode art. Mustn't
leave out all the world's non-English-speaking artists!
How
On 16.09.2015 23:30, Mark Lawrence wrote:
Barry John art is also art. So, why does Python not have Barry John
art to define graphs and diagrams?
Too colorful for a grammer?
--
https://mail.python.org/mailman/listinfo/python-list
On 16.09.2015 21:47, Grant Edwards wrote:
On 2015-09-16, Sven R. Kunze wrote:
On 16.09.2015 19:46, Grant Edwards wrote:
On 2015-09-16, Steven D'Aprano wrote:
node = left <= ptr => right
Exactly. I've no clue what that means. ;)
Modern art. ;)
Ah, well I know that _tha
On 16.09.2015 22:55, Random832 wrote:
On Wed, Sep 16, 2015, at 16:38, Mark Lawrence wrote:
On 16/09/2015 18:41, Sven R. Kunze wrote:
On 16.09.2015 19:33, Steven D'Aprano wrote:
And with operator overloading, < <= > and => could have any meaning you
like:
graph = a =&
On 16.09.2015 19:46, Grant Edwards wrote:
On 2015-09-16, Steven D'Aprano wrote:
node = left <= ptr => right
Exactly. I've no clue what that means. ;)
Modern art. ;)
Best,
Sven
--
https://mail.python.org/mailman/listinfo/python-list
On 16.09.2015 19:39, Steven D'Aprano wrote:
node = left <= ptr => right
Wow. I have absolutely no idea what this is supposed to mean. Do you
care to elaborate?
Best,
Sven
--
https://mail.python.org/mailman/listinfo/python-list
On 16.09.2015 19:36, Random832 wrote:
I just had another thought on *why* the other cases make me so uneasy.
The reason this is reasonable for simple cases like a > b > c or a < b
<= c is that, in their normal meanings, these operations are transitive.
a > b and b > c implies a > c. a < b and b
On 16.09.2015 19:33, Steven D'Aprano wrote:
On Thu, 17 Sep 2015 01:40 am, Random832 wrote:
"in" suggests a relationship between objects of different types (X and
"something that can contain X") - all the other comparison operators are
meant to work on objects of the same or similar types.
`is`
On 16.09.2015 18:57, Random832 wrote:
I think that chaining should be limited to:
A) all operators are "="
B) all operators are "is"
C) all operators are either >= or >
D) all operators are either <= or <
That certainly would be a fine guideline. Only use it with all operators
the same.
Eve
On 16.09.2015 18:16, Marko Rauhamaa wrote:
Chris Angelico :
Far as I can see, the only operator that you might want to disallow
chaining on is 'in' (and its mate 'not in', of course). It isn't
common, but "x is y is z is None" is a perfectly reasonable way to
ascertain whether or not they're al
Oops, missing print:
On 10.09.2015 20:45, Sven R. Kunze wrote:
On 10.09.2015 20:34, Sven R. Kunze wrote:
You are right. I turned out to me harder that I first thought.
My initial guess was like: use AST. But now I see, it would be hard
to get the source code.
So, what actually could work
On 10.09.2015 20:34, Sven R. Kunze wrote:
You are right. I turned out to me harder that I first thought.
My initial guess was like: use AST. But now I see, it would be hard to
get the source code.
So, what actually could work, would be faking the interactive
interpreter wrapping it up and
On 10.09.2015 20:14, Ben Finney wrote:
"Sven R. Kunze" writes:
http://stackoverflow.com/questions/2356399/tell-if-python-is-in-interactive-mode
I'm pretty sure Steven knows full well the answer to that question,
which is not anything like the one he asked. Would you care to re
On 10.09.2015 20:12, Ben Finney wrote:
First thing in the morning I will purchase a head of cabbage and store
it in a warm place to make it rot, on the off chance you find some
obscure way to achieve your benighted goal, just so I can be first in
line to throw it as you pass.
Well, go ahead. An
is the reason for this special behavior?
On 10.09.2015 20:03, Sven R. Kunze wrote:
http://stackoverflow.com/questions/2356399/tell-if-python-is-in-interactive-mode
On 10.09.2015 19:54, Steven D'Aprano wrote:
I have a function which is intended for use at the interactive
interpreter,
bu
http://stackoverflow.com/questions/2356399/tell-if-python-is-in-interactive-mode
On 10.09.2015 19:54, Steven D'Aprano wrote:
I have a function which is intended for use at the interactive interpreter,
but may sometimes be used non-interactively. I wish to change it's output
depending on the con
On 09.09.2015 21:00, Chris Angelico wrote:
Suppose it's possible, somehow, to design the perfect language. (It
isn't, because the best language for a job depends on the job, but
suppose it for the nonce.) It is simultaneously more readable than
Python, more ugly than Perl, more functional than Ha
On 09.09.2015 19:55, Steven D'Aprano wrote:
On Wed, 9 Sep 2015 11:09 am, Mario Figueiredo wrote:
You know, it is a pointless exercise to try and downplay programming
languages (any programming language) that has proven its worth by being
generally adopted by the programming community. Adoption
On 06.09.2015 22:06, Ned Batchelder wrote:
As a developer of a Python package, I don't see how this would be better.
The developer would still have to get their software into some kind of
uniform configuration, so the central authority could package it. You've
moved the problem from, "everyone h
Hi folks,
currently, I came across http://pythonwheels.com/ during researching how
to make a proper Python distribution for PyPI. I thought it would be
great idea to tell other maintainers to upload their content as wheels
so I approached a couple of them. Some of them already provided wheels.
On 04.09.2015 18:55, t...@freenet.de wrote:
From knowing e.g Java as OO language I had no need to set
such a keyword "global" to get write access to class members.
It is true and I really dislike Java for having this. Please consider this
class MyClass:
@classmethod
def method(cls):at
On 04.09.2015 05:36, random...@fastmail.us wrote:
You haven't demonstrated that the RHS is affected by anything. The
sample code in the original post of this thread behaves identically if
the RHS is a simple tuple of (2, 1) [or (1, 2)] respectively. If you
have another sample that shows differe
On 03.09.2015 03:17, random...@fastmail.us wrote:
The question is what does "assign it to the left side at once" even
*mean* in the presence of subscripts? Build up a list of
object-subscript pairs (evaluating all the subscripts, including if any
may have side effects) before executing any __set
On 03.09.2015 00:25, t...@freenet.de wrote:
It is the good idea of Python about modules which are singletons
and therefore have already its state (so in some way they are already somehow
like classes - except the bad annoying thing with the "global" statement).
So, what you really want is a bet
On 03.09.2015 14:20, ast wrote:
Hello,
At the end of the last line of the following program,
there is a comma, I dont understand why ?
Thx
from cx_Freeze import setup, Executable
# On appelle la fonction setup
setup(
name = "salut",
version = "0.1",
description = "Ce programme vous d
On 02.09.2015 19:42, Terry Reedy wrote:
On 9/2/2015 6:01 AM, Antoon Pardon wrote:
a = [1, 2, 3, 4, 5]
b = 1
b, a[b] = a[b], b
a
[1, 2, 1, 4, 5]
a = [1, 2, 3, 4, 5]
b = 1
a[b], b = b, a[b]
a
[1, 1, 3, 4, 5]
I think I understand how it gets these results
but I'm not really happy with them. I
On 02.09.2015 20:47, t...@freenet.de wrote:
I agree with Skybuck Flying.
I am aware if a var is a module function var or a module global var.
If I want read or write a global var.
Using the keyword global inside each(!) function only
to mark the global var writeable in each of the functions
is r
101 - 200 of 1188 matches
Mail list logo