On 09/03/2016 12:02, BartC wrote:
On 09/03/2016 08:40, Mark Lawrence wrote:
Here's another: you have a program in Python that you'd quite like to
port to another dynamic language. Transcribing actual Python code is
straightforward. Until you come to an import of a module that you
On 09/03/2016 23:14, BartC wrote:
On 09/03/2016 21:13, Mark Lawrence wrote:
On 09/03/2016 12:02, BartC wrote:
On 09/03/2016 08:40, Mark Lawrence wrote:
Here's another: you have a program in Python that you'd quite like to
port to another dynamic language. Transcribing actual Pyth
On 10/03/2016 00:58, BartC wrote:
On 09/03/2016 23:35, Mark Lawrence wrote:
On 09/03/2016 23:14, BartC wrote:
(The byte-code compiler for the current version is written in itself. It
can compile itself (some 25Kloc) in about 1 second (that's running
interpreted, dynamic byte-code on
act that it
takes hours to download and install, even with a high speed broadband
link. Steve Dower is attempting to get his Microsoft colleagues to
produce a bare minimum that could be used to build Python.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do fo
3. I'd
recommend starting with the latter if that's possible.
fo.close()
Not needed if you use the 'with' keyword as discussed above.
Many thanks
No problem as I'm leaving you to put it all together :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 10/03/2016 11:50, BartC wrote:
On 10/03/2016 07:30, Mark Lawrence wrote:
On 10/03/2016 00:58, BartC wrote:
You think a bloody great compiler is a microbenchmark?!
I have no interest in the speed of the compiler, I am interested in the
run time speed of the applications that it produces
ept in your code that catches poplib.error_proto?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 10/03/2016 12:47, BartC wrote:
On 10/03/2016 12:15, Mark Lawrence wrote:
On 10/03/2016 11:50, BartC wrote:
Suppose you were on the development team that writes the optimising
stages of a C compiler. You need to test the performance of the code it
produces so that you can compare one
tion has
been asked before.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
peed/PerformanceTips
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
[1] - http://stackoverflow.com/q/4555932
I suggest that you reread the stackoverflow link that you've quoted, and
take great notice of the response from Lennart Regebro, even if it has
been downvoted.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you ca
u, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
ways 21 and the name
is always 'Cool Dude'. So you can vary the age and name you'd need:-
class person():
def __init__(self, age, name):
self.age = age
self.name = name
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can
context manager via the 'with' keyword, or you leave the one
line as is and forego the context manager.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
ather than two lists. Off of the top of my head a counter or a
defaultdict.
names.append(name) # new entry
totals.append(value)
for i in range(len(names)):
print (names[i],totals[i])
Always a code smell when range() and len() are combined.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 11/03/2016 01:45, BartC wrote:
On 11/03/2016 01:21, Mark Lawrence wrote:
On 11/03/2016 00:05, BartC wrote:
def last(a):
return a[-1]
def init(a): # all except last element
return a[0:len(a)-1]
What is wrong with a[0:1] ?
The returns the head of the list. I
t what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
equivalent to a python file, correct?)
Correct.
TIA for any thoughts.
cts
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
for your OS.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
hon.org/3/library/csv.html#csv.Dialect.doublequote
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
you *NEVER, EVER*
create strings like this. Given that you've admitted earlier today that
you couldn't get a simple slice to work, how much, if anything, do you
actually know about Python?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our
makes them not interchangable, but given we're only
interested in the current dict...
Dict, don't you mean collection? Or, to put it another way, what
exactly were you originally asking?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our
call last):
File "", line 1, in
AttributeError: 'str' object has no attribute 'hasattr'
Since they behave differently, perhaps the question ought to be "which
does what you want to do?"
The BartC answer would be that it doesn't matter provided it runs
On 11/03/2016 22:24, BartC wrote:
On 11/03/2016 21:59, Mark Lawrence wrote:
On 11/03/2016 18:57, BartC wrote:
def test():
s=""
for i in range(1000):
s+="*"
print (len(s))
test()
The minor snag that you might like to correct with your micro
On 12/03/2016 10:31, BartC wrote:
On 12/03/2016 10:06, alister wrote:
On Fri, 11 Mar 2016 22:24:45 +, BartC wrote:
On 11/03/2016 21:59, Mark Lawrence wrote:
On 11/03/2016 18:57, BartC wrote:
def test():
s=""
for i in range(1000):
s+="*"
A string
CALL_FUNCTION 1
You might be right: doing an unnecessary global name lookup and
executing a function call are unlikely to have any impact on performance...
Function calls are hugely expensive in Python.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
at our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
Python. I'll leave you to quote a few as
you are such an expert in the Python programming language.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 13/03/2016 01:20, Steven D'Aprano wrote:
On Sun, 13 Mar 2016 04:02 am, Mark Lawrence wrote:
So I am clearly not the only programmer in the world who couldn't care
less about speed.
For somebody who couldn't care less, you sure do keep going on and on and on
and on and o
brary/itertools.html#itertools.zip_longest
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
emc.uwaterloo.ca/nl/ (which is in Dutch)
You can always ask your questions here of course (in English).
Good luck!
Irmen de Jong
Such a wonderful response has made my day :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
r/
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 14/03/2016 17:53, BartC wrote:
On 14/03/2016 17:17, Mark Lawrence wrote:
On 13/03/2016 20:12, Marko Rauhamaa wrote:
BartC :
Exactly why having ready-made solutions is preferable to everyone
hacking their own solutions to switch.
A developer friend of mine once said insightfully that the
)
so that it displays "two" "one".
Global.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
atest entry into the race,
BartCPython, all vapourware. At least rr knows something about
tkinter/IDLE, whereas the latter appears to know squat about anything.
You can fool all of the programmers, all of the time?
--
My fellow Pythonistas, ask not what our language can do for you, ask
wha
On 14/03/2016 22:07, BartC wrote:
On 14/03/2016 21:23, Mark Lawrence wrote:
Python 2.8, RickedPython, and the latest entry into the race,
BartCPython, all vapourware.
I'm not creating a new version of Python or CPython (you should have
used an underscore).
But I do have conside
hich to pull tongue from
cheek.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 14/03/2016 22:40, BartC wrote:
On 14/03/2016 22:20, Mark Lawrence wrote:
On 14/03/2016 22:07, BartC wrote:
On 14/03/2016 21:23, Mark Lawrence wrote:
Python 2.8, RickedPython, and the latest entry into the race,
BartCPython, all vapourware.
I'm not creating a new version of Pyth
On 14/03/2016 23:56, BartC wrote:
On 14/03/2016 23:19, Mark Lawrence wrote:
On 14/03/2016 22:40, BartC wrote:
Was that in Python? It was /supposed/ to be dreadful. I was making a
case for it to be supported directly.
You mean the huge great long list of hard coded function calls. They
are
ck :)
E.g.
x = "apple"
x-list = ["apple", "banana", "peach"]
If x == x-list:
print('Comparison is True')
else:
print('Comparison is False')
if x in x-list:
...
--
My fellow Pythonistas, ask not what our language can
On 15/03/2016 00:25, Chris Angelico wrote:
On Tue, Mar 15, 2016 at 11:17 AM, rurpy--- via Python-list
wrote:
On 03/14/2016 05:19 PM, Mark Lawrence wrote:
On 14/03/2016 22:40, BartC wrote:
[...a polite and reasonable comment...]
Drivel. Any establised member of this community, or any other
can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 15/03/2016 00:56, Chris Angelico wrote:
On Tue, Mar 15, 2016 at 11:47 AM, Mark Lawrence wrote:
Same old story. BartC spouts drivel, just like the RUE, or Nick "The
Webmaster" Greek, I'm in trouble for pointing it out. When he provides some
*EVIDENCE* to back up his claims
On 15/03/2016 01:10, BartC wrote:
On 15/03/2016 00:28, Mark Lawrence wrote:
On 14/03/2016 23:56, BartC wrote:
Anything so terrible about that that Python needs to keep well clear of
or that you think its users should be deprived of?
Yes, it is not even valid Python. Switch has been
On 15/03/2016 02:01, Steven D'Aprano wrote:
On Tue, 15 Mar 2016 10:19 am, Mark Lawrence wrote:
There is no need to optimise python, it is fast enough.
I should of course have said on the end " for (say) 99% of purposes".
Somebody should tell the core developers like B
u, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
e
http://code.activestate.com/recipes/269708-some-python-style-switches/
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
ot what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
than:-
x.makeNoise()
?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 16/03/2016 08:13, Christian Gollwitzer wrote:
Am 16.03.16 um 05:26 schrieb Mark Lawrence:
So you would rather write something like:-
switch (x):
case COW:
moo()
break
case DUCK:
quack()
break
default IDUNNO:
panic()
than:-
x.makeNoise()
No sane person
On 16/03/2016 09:35, Antoon Pardon wrote:
Op 16-03-16 om 09:47 schreef Mark Lawrence:
Same with switch. You can use a hash table etc. to simulate switches,
but only if the codeblocks are independent. Otherwise, if-elif chains
are the way to go. Command line parsing is a case where switch
On 16/03/2016 10:52, Antoon Pardon wrote:
Op 16-03-16 om 10:51 schreef Mark Lawrence:
On 16/03/2016 09:35, Antoon Pardon wrote:
Op 16-03-16 om 09:47 schreef Mark Lawrence:
Same with switch. You can use a hash table etc. to simulate switches,
but only if the codeblocks are independent
On 16/03/2016 11:16, BartC wrote:
On 16/03/2016 11:07, Mark Lawrence wrote:
I don't want to discourage you too much, but I think that adding a
switch statement comes *very* low on the list of improvements we would
like to make in Python 3.5.
We should probably focus on speed ...
OK, y
quot; mode.
I believe it is more along the lines of "In Rome, do as the Romans".
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
n do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 16/03/2016 13:15, [email protected] wrote:
What hath I wrought?
The Comfy Chair :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
Can you do better in perl?
I neither know, nor do I care. Why not ask on a perl list?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 19/03/2016 04:05, Ian Kelly wrote:
On Fri, Mar 18, 2016 at 3:19 PM, Mark Lawrence wrote:
I have no idea at what the above can mean, other than that you are agreeing
with the RUE.
Mark, are you aware that this is a rather classic ad hominem of guilt
by association? "I didn'
guage.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
download numpy-1.11.0rc1+mkl-cp35-cp35m-win32.whl.
I don't know when the full release of numpy1.11 is due out.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 16/03/2016 13:38, Antoon Pardon wrote:
Op 16-03-16 om 12:07 schreef Mark Lawrence:
Raise the item on the python-ideas mailing list for the umpteenth time
then, and see how far you get.
I don't care enough. I do care about people using valid arguments.
Arguments have been made fo
On 16/03/2016 19:41, BartC wrote:
On 16/03/2016 09:51, Mark Lawrence wrote:
On 16/03/2016 09:35, Antoon Pardon wrote:
So I guess those who would like a case statement in Python can
only hope a core developer gets bitten by a nasty bug while using
one of those ways of simulating switches
hat you are
agreeing with the RUE.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
ing a fib, IIRC it was 0 1. Sales and marketing did not get the
joke about it being a "two bit company".
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 19/03/2016 21:40, [email protected] wrote:
What was the final answer for the create class bankaccount question?
42.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman
care? I swear blind that you stated a few days back that
you, and hence your newly published language, couldn't care about
unicode. Have I got it wrong?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail
On 20/03/2016 08:01, Rustom Mody wrote:
On Wednesday, March 16, 2016 at 5:51:21 PM UTC+5:30, Marko Rauhamaa wrote:
BartC :
On 16/03/2016 11:07, Mark Lawrence wrote:
but I still very much doubt we'll be adding a switch statement --
it's a "sexy" language design issue
I
On 18/03/2016 17:04, Qurrat ul Ainy wrote:
help required !!!
For what, house cleaning?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 16/03/2016 15:27, Antoon Pardon wrote:
Op 16-03-16 om 15:02 schreef Mark Lawrence:
On 16/03/2016 13:38, Antoon Pardon wrote:
Op 16-03-16 om 12:07 schreef Mark Lawrence:
Raise the item on the python-ideas mailing list for the umpteenth time
then, and see how far you get.
I don't
-
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
https://docs.python.org/3/library/string.html#string-formatting
https://docs.python.org/3/library/string.html#template-strings
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
use of switch is shown below [not Python].
A tokeniser along those lines in Python, with most of the bits filled
in, is here:
http://pastebin.com/dtM8WnFZ
I got to line 22, saw the bare except, and promptly gave up.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 21/03/2016 01:35, Chris Angelico wrote:
On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence wrote:
I got to line 22, saw the bare except, and promptly gave up.
Oh, keep going, Mark. It gets better.
def readstrfile(file):
try:
data=open(file,"r").read()
On 21/03/2016 02:04, BartC wrote:
On 21/03/2016 01:35, Chris Angelico wrote:
On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence
wrote:
I got to line 22, saw the bare except, and promptly gave up.
Oh, keep going, Mark. It gets better.
def readstrfile(file):
try:
data=open(file,&q
roblems
instead of limiting yourself to just one???
I'm not quite sure why you've replied to a five year old thread, but I'd
suggest that the employers' main concern is Total Cost of Ownership.
--
My fellow Pythonistas, ask not what our language can do for you, as
.)
Once again, you forget that there are not 256 characters - there are
1114112. (Give or take.)
ChrisA
Head. Wall. Bang.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python
le numbers just like * and /, so should have the same
precedence.)
Python is not C. This is not a bug. The rules are here
https://docs.python.org/3/reference/expressions.html#operator-precedence
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for
onistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0]
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
elements of the sublists also changes. I dunno why...
https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org
On 21/03/2016 19:43, BartC wrote:
On 21/03/2016 02:02, Mark Lawrence wrote:
On 21/03/2016 01:35, Chris Angelico wrote:
On Mon, Mar 21, 2016 at 12:28 PM, Mark Lawrence
wrote:
I got to line 22, saw the bare except, and promptly gave up.
Oh, keep going, Mark. It gets better.
def readstrfile
r language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
://docs.python.org/3/library/stdtypes.html#typememoryview
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
Please state your OS and Python version, the code that you've tried and
exactly what went wrong, including the full traceback if there is one.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.pytho
other objects. The abstraction is that you pass
objects around, not references to objects.
The devil is in the mutables...
Whereby these mysterious "pointers" suddenly leap into action I take it?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
work well
(duplicating the rest of the string roughly every other character).
It would work perfectly. How would it duplicate the rest of the string
roughly every other character?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark L
fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
On 23/03/2016 16:24, Random832 wrote:
On Wed, Mar 23, 2016, at 12:08, Mark Lawrence wrote:
And doing it 'Pythonically' can lead to suggestions such as the
following the other day:
c, psource = psource[0], psource[1:]
(where psource is a very long string), which even I could
On 23/03/2016 23:55, Steven D'Aprano wrote:
On Thu, 24 Mar 2016 03:24 am, Random832 wrote:
On Wed, Mar 23, 2016, at 12:08, Mark Lawrence wrote:
And doing it 'Pythonically' can lead to suggestions such as the
following the other day:
c, psource = psource[0], psource[1:]
(w
our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
e who
have died laughing.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
It's just fantastic, you don't have to bother about the
source code that you write, all you have to bother about is the
underlying byte code.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mai
x27;B' doesn't care provided it is quick.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https://mail.python.org/mailman/listinfo/python-list
1801 - 1900 of 5534 matches
Mail list logo