On Wed, 05 Mar 2014 22:23:46 +0200, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> There is no metaphysical implication from Python's "is" operator. If
>> the operator had precisely the same behaviour, but was called "same",
>> as in:
>
On Wed, 05 Mar 2014 21:31:51 -0500, Roy Smith wrote:
> In article <[email protected]>,
> Steven D'Aprano wrote:
>
>> Physics is the fundamental science, at least according to the
>> physicists, and Real Soon Now the
On Wed, 05 Mar 2014 20:19:56 -0800, Beowulf wrote:
> Once you master one language it is easy to understand other.
Depends on the languages. Learning Forth doesn't make it easier to learn
Perl. Learning Pascal doesn't make Smalltalk easier.
--
Steven
--
https://mail.pytho
accidentally running a script intended for Python2.6
under Python3.2 instead.
execfile is removed from 3.2, so you need to either edit the script to
update it for 3.2, or you need to make sure you are running it under 2.6.
Do you need help with that?
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
e just accepted as if they
were correct, no questions asked.
You should read this guy's blog post on when to use assert:
http://import-that.dreamwidth.org/676.html
It's pretty damn good, if I do say so myself...
*whistles innocently*
--
Steven D'Aprano
http://import-that.dr
On Fri, 07 Mar 2014 16:15:36 -0800, Dan Stromberg wrote:
> On Fri, Mar 7, 2014 at 3:11 AM, Steven D'Aprano
> wrote:
>
>
>> Assertions are not bad! They're just misunderstood and abused.
>
>> You should read this guy's blog post on when to use asser
use is much improved: Python has *many* strings (every
function, method and class uses many strings in their implementation) and
the memory savings can be considerable. Depending on your application and
what you do with those strings, that may even lead to time savings as
well as memory savings.
u say that whether list.append operates in place or creates a new
list is an implementation detail? Whether str.upper() creates a new
string or modifies the existing one in place? Mutability versus
immutability is part of the interface, not implementation, not
withstanding that
But when people are just talking informally in a hand-wavy manner, they
usually say "O(foo)" when they actually mean "for typical data under
typical conditions, the algorithm runs with a complexity of the order of
foo". And that's perfectly okay, just like it's perfectly okay to
describe the Earth as a sphere even though a pedant will call it a
wrinkly asymmetrical oblate spheroid.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
o "The Relativity Of Wrong":
http://chem.tufts.edu/answersinscience/relativityofwrong.htm
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 10 Mar 2014 08:16:43 +0200, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> Proof: I create a hash table that accepts unsigned bytes as keys, where
>
> The O(f(n)) notation has no meaning when n is limited.
It has obvious meaning: O(1) means that look-ups take c
On Mon, 10 Mar 2014 02:35:36 -0600, Ian Kelly wrote:
> On Sun, Mar 9, 2014 at 8:37 PM, Steven D'Aprano
> wrote:
>> On Sun, 09 Mar 2014 17:42:42 -0600, Ian Kelly wrote:
>>
>>> On Sun, Mar 9, 2014 at 4:03 PM, Gregory Ewing
>>> wrote:
>>
>
some arguments, gathers some more values
interactively, processes the lot, and then returns a result. With an
automated test, I can provide the arguments, and check the result, but
what are my options for *automatically* supplying input to raw_input?
--
Steven
--
https://mail.python.org
er has an amazing talent for
pessimising code when they think they are optimising it.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
anteed O(1)
lookups, insertions and deletions.
http://en.wikipedia.org/wiki/Perfect_hash_function
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 10 Mar 2014 17:57:19 +0100, Peter Otten wrote:
> Steven D'Aprano wrote:
>> what are my options for *automatically* supplying input to raw_input?
>
> https://pypi.python.org/pypi/mock
>
> In Python 3 this is part of the standard library:
Nice!
Thanks
look at the docs is because I always forget
whether & is intersection and | is union, or the other way around. But
having remembered which is which, going from & to &= was easy.
> You mean set.intersection_update? The in-place set methods are not hard
> to remember, because
case. Evaluating the right hand side may have side-
effects that change what the left hand side evaluates to. This is not the
case with the augmented assignment.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
onvention that returning
the special object None signals the intention to return nothing at all.
Hence your example below:
>>>> c = a.append(b)
>>>> print c
> None
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
r it, but the only
one I can find was apparently fixed more than a decade ago:
http://bugs.python.org/issue451309
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 11 Mar 2014 17:06:43 -0600, Ian Kelly wrote:
> On Tue, Mar 11, 2014 at 10:46 AM, Steven D'Aprano
> wrote:
>>> There are a number of possible solutions. One possibility would be to
>>> copy the Circle as an Ellipse and return the new object instead of
>&
gt; raise ValueError('invoices %r missing from batch' %
> missing)
Raising an exception directly inside the test function should only occur
if the test function is buggy. As Terry has already suggested, this
probably communicates your intention much better:
self.assertEqual(missing, [])
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
sumably will include
Python running the tests).
This at least will allow you to see whether or not memory is the concern.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 13 Mar 2014 07:44:27 -0400, Roy Smith wrote:
> In article <[email protected]>,
> Steven D'Aprano wrote:
>
>> Because Python doesn't have true procedures
>
> What do you mean by "true procedure"? Are
On Thu, 13 Mar 2014 14:27:48 +0200, Marko Rauhamaa wrote:
> Roy Smith :
>
>> Steven D'Aprano wrote:
>>
>>> Because Python doesn't have true procedures
>>
>> What do you mean by "true procedure"? Are you just talking about
>> subr
keeping the two in sync, will be faster than a pure Python implementation
of an AVL tree. But of course only testing it will make that clear.
http://code.activestate.com/recipes/576693-ordered-dictionary-for-py24/
Modifying the above recipe to keep items in something other than
insertion order
On Fri, 14 Mar 2014 10:55:44 +1100, Chris Angelico wrote:
> On Fri, Mar 14, 2014 at 10:41 AM, Steven D'Aprano
> wrote:
>> Are you trolling again?
>>
>> I'm sure that you know quite well that Python doesn't have a procedure
>> type. It uses a single
ive methods are not what people
consider *returning* from a sub-routine.
Unless they're trolling :-)
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
ction is intended to be called for it's side-
effects (a procedure), it should return None.
> Wear vanilla programmer hat:
> The concept (Pascal) procedure is simulated by function-returning-None
Yes, agreed on this one.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
at the end of whatever other processing,
> sorting is great. It's (still) O(nlogn), but it's got a terrific
> constant.
Exactly!
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
err_code:
> print (err_code)
> else:
> line_count = 0
> while True:
> linein = fh.readline()
> if (linein!=''):
> lineout = linein.strip('\n')
> length = len(lineout)
>
itemize, itemise]
2: determine the number or amount of; "Can you count the books
on your shelf?"; "Count your change" [syn: count, number,
enumerate, numerate]
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
t; Question blah blah blah?
> Another question?
See here for more details:
http://en.wikipedia.org/wiki/Posting_style
Thanks in advance,
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
value=Num(n=2j))])'
py> ast.dump(ast.parse("1+2j"))
'Module(body=[Expr(value=BinOp(left=Num(n=1), op=Add(),
right=Num(n=2j)))])'
and in recent versions, the peephole optimizer optimizes them:
py> from dis import dis
py> dis("1+2j")
1 0 LOAD_CONST 2 ((1+2j))
3 RETURN_VALUE
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
accept spaces around the + or -, as
it already accepts leading and trailing spaces. But it's not a big deal.
[...]
> Also, philosophically, C ignores white space; python does not.
C does not ignore whitespace.
forwhile
is not the same as
for while
The first is a valid identifier, the second is a syntax error. Oh
somebody please tell me it's not a valid C expression! *wink*
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 18 Mar 2014 17:47:51 +1100, Ben Finney wrote:
> "Frank Millman" writes:
>
>> I feel that I have just not grasped the basics yet, so any assistance
>> that puts me on the right path is appreciated.
>
> Here is “Hg Init”, a tutorial for Mercurial http://hginit.com/>.
>
> (“source control
On Tue, 18 Mar 2014 08:04:44 +0100, Christian Gollwitzer wrote:
> Am 15.03.14 17:26, schrieb Jayanth Koushik:
>> This is regarding the inbuilt 'complex' function. The python docs say:
>> "Note: When converting from a string, the string must not contain
>> whitespace around the central + or - opera
On Tue, 18 Mar 2014 19:08:17 +1100, Chris Angelico wrote:
> On Tue, Mar 18, 2014 at 6:55 PM, Steven D'Aprano
> wrote:
>> I don't think that *version* control is the right model to describe
>> what hg and git do, although it may be appropriate for subversion. hg
>
htly different dict, with the
collisions in a different order:
py> e = {x: 100}
py> e[100] = 200
comparing x with 100
py> e[y] = 300
comparing x with y
comparing y with 100
comparing y with 100
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
ehaviour negligible for any amount of data big enough to
really matter.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
t: graph the log of the time rather
than time itself.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 19 Mar 2014 10:49:33 +0200, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> If you are in a position to randomize the data before storing it in the
>> tree, an unbalanced binary tree is a solid contender.
>
> Applications that can assume randomly distribute
On Thu, 20 Mar 2014 22:30:57 +0200, Marko Rauhamaa wrote:
> To avoid nausea, I write sys.stdout.write() in all Python3 code.
Now that's funny.
I-know-I-shouldn't-respond-to-obvious-trolling-but-I-can't-help-myself-ly
yrs,
--
Steven D'Aprano
--
https://mail.pyth
nt
language. Or use a different name altogether:
steve@orac:~$ alias snake=python
steve@orac:~$ snake
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
This has not
scripts across a network of mixed Linux distros including
some that are Arch-Linux, it's difficult to see exactly what pain they
could be causing even in principle.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
worth the benefit. I was glad to be able to drop support for 2.3, 2.4,
> and 2.5, and now only support 2.6-3.4 in coverage.py.
Sounds like your experience agrees with mine.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
three different places
ought to be managed by a function. Printing a newline at the end of a
line of output is *incredibly* common. Any language which fails to
provide a print-with-newline function is, frankly, sub-standard.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
use they didn't
hard-code the version number. I haven't seen scripts broken because "env"
has moved, but I guess that's only a matter of time. Frankly, hash-bang
lines are a dirty hack, and like all dirty hacks, they work really well
until they suddenly don't.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
st:
30 + 40 % 26
=> 30 + 14
=> 54
What you probably want is to calculate the % last, not first. That means
you need to perform the addition first. Use round brackets (parentheses)
for that:
(30 + 40) % 26
=> 70 % 26
=> 18
Does that help?
--
Steven D'Aprano
http://import-that.
If x were a global, it would be astonishing. The fact that x comes from a
closure instead makes it no less surprising. Unroll the loop, and the
magic is obvious.
Now I'm not sure precisely how Haskell implements this trick, but it
suggests to me that it creates a different closure each time
the body of a function created with lambda is limited to a
single expression, not a block;
- the function object created with lambda has a generic name.
So unless the surprising behaviour about lambda that you're about to tell
us about relates to one of those three things, I *guarantee* t
The
customers are the advertisers.
[...]
> If I were in charge of the software used for this list, I would replace
> Mark with a custom addition to return mis-formated posts (more blank
> lines than not) with instructions on how to fix them. But I am not.
Wouldn't it be less obnox
mp/io.txt')
=> #
irb(main):002:0> f.read()
=> "hello"
irb(main):003:0> f.read()
=> ""
[steve@ando ~]$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> fp = io.open('/tmp/io.txt', 'r')
> print(fp:read("*all"))
he
On Sun, 23 Mar 2014 02:09:20 +1100, Chris Angelico wrote:
> On Sun, Mar 23, 2014 at 1:50 AM, Steven D'Aprano
> wrote:
>> Line endings are terminators: they end the line. Whether you consider
>> the terminator part of the line or not is a matter of opinion (is the
>>
On Sun, 23 Mar 2014 12:37:43 +1100, Chris Angelico wrote:
> On Sun, Mar 23, 2014 at 12:07 PM, Steven D'Aprano
> wrote:
>> On Sun, 23 Mar 2014 02:09:20 +1100, Chris Angelico wrote:
>>
>>> On Sun, Mar 23, 2014 at 1:50 AM, Steven D'Aprano
>>> wrote:
&
On Mon, 24 Mar 2014 00:52:52 -0500, Mark H Harris wrote:
> On 3/22/14 4:46 AM, Steven D'Aprano wrote:
>> On Fri, 21 Mar 2014 23:51:38 -0500, Mark H Harris wrote:
>>
>>> Lambda is a problem, if only because it causes confusion. What's the
>>> problem?
ing_L
Four lines of code to do what lambda lets you do in one. And people still
insist that lambda is pointless. Maybe they're being paid by the line.
> Or do you just shortcut the whole thing by inlining it?
>
> L.sort(key=lambda item:item[1].index)
Exactly.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
O_USE_FOR_INDEXING_WHEN_SORTING_L = 1
#
# key func used when sorting L, returns item's 1th elem index method
#
#
#_get_oneth_element_index_to_use_as_keyfunc_when_sorting_L
#
# Steven D'Aprano
# 2014-03-25
# 2014-03-25
# 1
# item to be sorted
# index method of the oneth element
# NameError # FIXME c
place method; you can use the re module to use regexes;
you can slice them with some_string[start:end] syntax, etc. But it looks
to me like you might be better off using a higher-level protocol rather
than using socket. What sort of data are you expecting back?
--
Steven D'Aprano
t;
> *ducks for cover*
Ha ha, very funny :-P
http://code.activestate.com/recipes/577676-dirt-simple-mapreduce/
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 24 Mar 2014 14:47:11 -0500, Mark H Harris wrote:
> On 3/24/14 4:49 AM, Steven D'Aprano wrote:
>> There's no doubt that lambda is less-often useful than is the def
>> statement. But not only is it still useful, but there is a continual
>> stream of people ask
level?
I'm pretty sure Joy and Factor should. Perhaps not Forth or Postscript.
Some of these language may offer variable assignment, but using it is
entirely optional. It's a convenience, nothing more.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
guous) symbols.
Personally, I think that it would be good to start accepting, but not
requiring, Unicode in programming languages. We can already write:
from math import pi as π
Perhaps we should be able to write:
setA ⊂ setB
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
get a © than typing "copyright".
So, if applications could standardise on a single interface for at least
the common Unicode characters [er, common for who? English speakers?
Japanese people? Arabs? Dutch?] then things would be more like 1984 on a
Mac...
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
> >>> Π = pi
That's the product operator.
py> from unicodedata import name
py> name('Π')
'GREEK CAPITAL LETTER PI'
You want lower-case pi, π.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
complain that it does the wrong thing. If you have late binding, then
people who want early binding will complain that it does the wrong thing.
Even when they are the same people.
And *none of this has anything to do with lambda*. Functions created with
def exhibit the exact same behaviour.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
s. Nor is Python alone in spelling out lambda: Scheme and
> Common Lisp spell it the same way. As far as I know the \ for λ is
> unique to Haskell.
At least they don't spell it "fun".
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
aviour, and you replace the lambda with
def, you will still be confused. You'll have gone from a nice, concise
expression to a bulky statement, and be no better off. You'll be worse
off.
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
"
greet()
Would you expect to see "Hello Fred"?
The problem here is that Python is consistent, but people *want* it to be
inconsistent. When it doesn't magically read their mind, they get
"confused" that it isn't working the way they "expected".
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 24 Mar 2014 20:56:19 -0700, Rustom Mody wrote:
> Paren vs tuples: why do we need to write (x,) not (x)
You don't. You can write x, without the brackets:
py> t = 23,
py> type(t)
It's the comma that makes tuples, not the brackets.
--
Steven
--
https://mail
on you Chris! Don't you know the One True Way to write unambiguous
dates is the ISO data format?
2014-03-25
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 25 Mar 2014 19:23:45 +1100, Chris Angelico wrote:
> I was trying to avoid nit-picking
What, on comp.lang.python? What's wrong with you?
:-)
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
it? Firstly, convert your string read from a file
into numbers, then build your array. Here's one way:
py> values = [float(s) for s in data.split()]
py> print values
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0]
py> array_lines = np.array(values)
py> array_lines = a
to borrow the symbols used too.
I'd like to sum the squares of the integers from n=1 to 10. In the old
Python, I'd write sum(n**2 for n in range(1, 11)), but with the brave new
world of maths symbols, I'd like to write this:
http://timmurphy.org/examples/summation_large.jpg
How do I enter that, and what text editor should I use?
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
than sets.
I'm sure it is awfully impressive that mathematicians can derive the laws
of integer maths starting only from the empty set ∅, but as far as
programming goes that's not a very useful thing. Dicts are much more
important, and they are much more commonly used.
--
Steven
on
> Star Trek?
1986, when I last saw Star Trek IV.
The Star Trek universe also predicts that money will be obsolete. How's
that prediction working out?
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
I can see the appeal of certain Unicode symbols, I really wouldn't
like to have to deal with code that looks like this:
x∫2*y+∬e**3∺z≹(x+1)≽y⋝w
If I wanted line-noise, I know where to get Perl :-)
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
ke Python. Of course one could *write* a
Mathematica-like system in Python, and I expect that Sage may even have
something like this (if it doesn't, it could) but one shouldn't hammer
the specialised round peg of complex mathematical notation into the
square peg of a general pu
hat's your first job. Then identify the parts of code you want to take
from my example and put it into your example.
Good luck, and have fun!
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
ke
Lisp and Forth. You will note that they have a certain reputation for
being, um, different, and although both went through periods of
considerable popularity, both have faded in popularity since. While they
have their strengths, and their defenders, nobody argues that they are
readily
On Tue, 25 Mar 2014 19:55:39 -0400, Terry Reedy wrote:
> On 3/25/2014 11:18 AM, Steven D'Aprano wrote:
>
>> The thing is, we can't just create a ∑ function, because it doesn't
>> work the way the summation operator works. The problem is that we would
>> wa
.
It's that second requirement -- specifically the "lossless" part -- that
leads to such annoyances as µ and μ.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 26 Mar 2014 00:30:21 -0400, Terry Reedy wrote:
> On 3/25/2014 8:12 PM, Steven D'Aprano wrote:
>> On Tue, 25 Mar 2014 19:55:39 -0400, Terry Reedy wrote:
>>
>>> On 3/25/2014 11:18 AM, Steven D'Aprano wrote:
>>>
>>>> The thing is
ther languages, such as Java, and occasionally creeps into even the
Python docs.
I've often ranted about this, and won't repeat it now, only point out
that the preferred and most common terminology in Python circles is
"attribute", or "instance attribute" if yo
ame as having that language
feature.
Beyond a certain minimum feature set, all languages are Turing complete,
and so in one sense are of equivalent power. But they're not all of equal
expressiveness. Python is awesome, it is very expressive, but there are
certain things you can't write directly
positive or negative: we'll say "1 day and 6 hours from now"
or "1 day and 6 hours ago". But when we specify the sign:
py> divmod(-30, 24)
(-2, 18)
If an event happened 30 hours ago, it is correct to say that it occurred
"18 hours after 2 days ago", but who talks that way?
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
s not evaluated unless the first is true.)
Or they read the docs of the Sum function. Or both.
> The article included
>
> real procedure Sum(k, l, u, ak)
>value l, u;
>integer k, l, u;
>real ak;
>comment k and ak are passed by name;
&g
of the file?
I can't help you with the first. But the second: try running this:
# line2 and pat as defined above
filename = sys.argv[1]
with open(filename) as f:
for line in f:
print(len(line), line==line2, repr(line))
print(repr(pat.match(line)))
which will show you what you have and whether or not it matches
what you think it has. I expect that the file contents is not what
you think it is, because the regex is matching the sample line.
Good luck!
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
levant: http://bugs.python.org/issue1569623
Alas, the discussion appears to have been on #python-dev, which
(probably) means it is not archived anywhere.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
e
difficulty typing √ in their source code, they certainly don't count!
It's good enough that *you* have a solution to that problem, you can type
alt-v, and anyone who can't simply doesn't matter.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
non-expert non-programmer programmers? Apart
from wishful thinking, of course.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 27 Mar 2014 20:29:17 -0400, Roy Smith wrote:
> In article <[email protected]>,
> Steven D'Aprano wrote:
>
>> On Thu, 27 Mar 2014 08:52:24 -0400, Roy Smith wrote:
>>
>> > In article ,
>> > Chris Angel
On Fri, 28 Mar 2014 08:30:11 -0400, Roy Smith wrote:
> In article <[email protected]>,
> Steven D'Aprano wrote:
>
>> > Yes. The whole idea of OOD is to decouple internal representation
>> > from external behavior.
>>
ds
py> L = [[1]]*10
py> with Stopwatch():
... x = reduce(add, L)
...
time taken: 41.344467 seconds
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
Mark, please stop posting to the newsgroup comp.lang.python AND the
mailing list [email protected]. They mirror each other. Your posts
are not so important that we need to see everything twice.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/ma
> than typing; *every* character would require holding down a good number
> of keys. (Or you could go the other way and have exactly two keys: 1 and
> 0. Press either 21 times to enter a single character.)
http://like-a-boss.org/wp-content/uploads/2011/10/supercoder.jpg
--
Steven
t the keys appear.
Shuffling the order that Latin letters ABC...Z appear on the keyboard is
not in any way "the right idea" for entering non-Latin languages, nor
does a Dvorak language help enter arbitrary Unicode characters.
--
Steven D'Aprano
http://import-that.dreamwidth.org/
--
https://mail.python.org/mailman/listinfo/python-list
heir" own keytop too? geeze
They're welcome to try. Without support from the operating system, what
good do you think it will do?
Apple used to have an Apple key. Later they changed it to ⌘ (Command),
but everyone knows that ⌘ is only available on Apple keyboards.
--
Steven
On Fri, 28 Mar 2014 23:40:01 -0500, Mark H Harris wrote:
> On 3/28/14 10:51 PM, Steven D'Aprano wrote:
>> You are being patronising to the 94% of the world that is not from the
>> USA. Do you honestly think that people all over the world have been
>> using computers for
which are None?
Nearly always when people test for == to None, they don't really mean it.
They actually want to use an identity test. I'm going to assume the same
holds here.
if not (a is b is None): ...
Or if you prefer:
if a is not b is not None: ...
--
Steven D'Aprano
htt
6601 - 6700 of 15564 matches
Mail list logo