hat the average uneducated person believed in a flat earth.
But we don't really know for sure.
And there is more to the world than just Europe. In China, belief in a flat
earth cosmology was virtually unchallenged until the 17th century.
https://en.wikipedia.org/wiki/Flat_Earth
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
entally dumped a trailer load of
soil by the side of the road in Kanvas, and within a day some enterprising
entrepreneur had set up a thriving roadside business offering
mountain-climbing tours to the locals.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
en
e Foo method
> would override the other one.
It doesn't.
Perhaps you are unclear about the difference between methods of a class and
functions in modules?
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
nek/flat/flateart.htm
(To answer my rhetorical question in the subject header: yes, apparently we
can.)
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
d obvious.
if obj: ...
# implicitly calls obj.__bool__ or equivalent, by the bool protocol
# versus
if bool(obj): ...
# implicitly calls obj.__bool__ or equivalent
Apart from the extra six characters, I see no difference. What am I missing?
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
our main thread and the thread playing the sound. I guess you'll have to
try it and see.
If threading doesn't work for you, try the multiprocessing library instead.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https:/
On Thu, 15 Sep 2016 11:45 pm, Grant Edwards wrote:
> On 2016-09-15, Steve D'Aprano wrote:
>> On Thu, 15 Sep 2016 06:19 am, breamore...@gmail.com wrote:
>>
>>> It is so blantantly obvious that the world is not flat I find this
>>> discussion flabbergasti
On Thu, 15 Sep 2016 04:02 pm, Random832 wrote:
> On Wed, Sep 14, 2016, at 23:12, Steve D'Aprano wrote:
>> Yes it does. Even an infinitely large flat plane has a horizon almost
>> identical to the actual horizon.
>
> Your link actually doesn't support the latter cl
On Fri, 16 Sep 2016 05:19 am, Random832 wrote:
> On Thu, Sep 15, 2016, at 15:06, Steve D'Aprano wrote:
>> No, the horizon would still be horizontal. It merely wouldn't *look*
>> horizontal, an optical illusion.
>
> I guess that depends on your definition of w
things are undefined.
My **guess** is that cv2.line() will take an argument to set the line
colour. You should read the documentation for cv2.line().
Before asking any more questions, please read this:
http://sscce.org/
--
Steve
“Cheer up,” they said, “things could be worse.” So I che
don't see in
> which section ',' is documented. Could anybody let me know? Thanks.
As well as the other suggestions you have been given, try "Sequence
Unpacking".
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
ere is no built-in command for this, but it would be an interesting
project for an advanced user to write a pre-processor that inserts calls to
print after every line.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://
pydoc --help
for details.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 18 Sep 2016 07:19 am, Thomas 'PointedEars' Lahn wrote:
> AFAIK, “ä”, “ö”, and “ü” are not accented characters in any natural
> language, but characters of their own (umlauts).
Are you saying that English is not a natural language?
--
Steve
“Cheer up,” they said,
efore it had classes.
You're right about Python having functions first:
steve@runes:~$ python0.9.1
>>> def f():
... pass
...
>>> class A:
Parsing error: file , line 1:
class A:
^
Unhandled exception: run-time error: syntax error
However it only gained closures
e, and a mouseclick
event generated by software. They're ALL generated by software, and the
application cannot tell them apart.
(2) It works even if the application doesn't offer an OLE, COM or scripting
interface.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered
jects)?
Can you seralise *one* Sound object?
If not, then you can't serialise an array of Sound objects either.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
First, work through the calculation by hand. How do you do it by hand, using
pen and paper?
Now write some code to do the same thing!
Good luck!
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
Whether you
agree with that opinion or not is up to you.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
return key
raise ValueError('not found')
# Version 3: use a dict the way dicts are meant to be used
hostnames = {1: 'hostname1', 2: 'hostname2', 842: 'hostname842'}
def get_hostname(id):
return hostnames[id]
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
e names for each host from all three directories, and compare the
files.
I leave the rest of the exercise to you, but remember the principle of
Divide And Conquer. Divide the problem into smaller problems which are easy
to solve, solve each small problem, and the big problem solves itself.
--
global count
count += 1
return _iter(obj)
assert list(tree) == sorted(data)
print(count)
# - cut -
which prints 2, as expected: for each node, iter() gets called twice.
So I don't understand where your O(N log N) behaviour is coming from.
--
Steve
“Ch
On Wed, 21 Sep 2016 12:44 pm, Random832 wrote:
> On Tue, Sep 20, 2016, at 22:34, Steve D'Aprano wrote:
>> I'm afraid I don't understand this. This is a standard binary tree
>> inorder traversal. Each node is visited once, and there are N nodes,
>> so I make tha
. "Hi there" is a str
(short for string). True is a bool (short for Boolean value, which is a
technical term for special True/False values).
Perhaps if you can ask a more clear question, I can give a more clear
answer.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
calling stack.
You can re-write to_list as:
def to_list(node):
result = []
for value in node: # calls __iter__ method above
result.append(node)
return result
One of us is badly missing something.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 21 Sep 2016 12:47 pm, Chris Angelico wrote:
> On Wed, Sep 21, 2016 at 12:34 PM, Steve D'Aprano
> wrote:
>> "since values from the leaves of the tree have to be yielded
>> multiple times to the top of the tree"
>>
>> Each leaf is yield
handle it:
Look Before You Leap (an explicit test using if)
Easier to Ask Forgiveness than Permission (try...except)
https://docs.python.org/3/glossary.html#term-lbyl
https://docs.python.org/3/glossary.html#term-eafp
Use whichever is appropriate for the situation. There is no need to always
use o
u need to identify
which "cryptography" module it relies on, and install it. Start by reading
the paramiko documentation and especially look for "requirements"
or "dependencies".
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough,
On Thu, 22 Sep 2016 01:51 am, marco.naw...@colosso.nl wrote:
> And here is a straightforward one without any helpers:
Please don't do people's homework for them.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got wors
which is a bool, any
more than we should think of 1+1 as being a different value to 2.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
will always print.
> else:
> print("Ok please ammend your entries")
That can never occur, since both the if... clause and the elif... clause
will always evaluate as True. So this is dead code.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
se and 1 (or sometimes -1) for true. In
the early days, Python was the same.
See https://www.python.org/dev/peps/pep-0285/ for more details.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
ery thirty seconds or so.)
Anybody know anything like that?
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 22 Sep 2016 11:40 pm, Sayth Renshaw wrote:
> True it failed, just actually happy to get it to fail or pass successfully
> on int input.
But it doesn't. It raises ValueError no matter what you enter.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered u
ule before I split it into
submodules purely on the basis of size.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
thor says:
"One of my clients gets address data from Europe, but most of their systems
cannot handle Latin-1 characters. With all due respect to the umlaut,
scharfes s, cedilla, and all the other fine accented characters of Europe,
all I needed to do was to prepare addresses for a shippin
f you picked one (spaces) or the other (tabs) and ONLY
used that. Other wise you will just confuse yourself.
But you won't confuse the interpreter.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
#x27;s only three dicts:
new_dict = d1.copy()
new_dict.update(d2, **d3)
Or if you prefer:
new_dict = dict(d1) # same as copying
new_dict.update(d2, **d3)
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/
t value in from_strings
- change the conversion function from float to int in from_strings
Not to mention that each parameter is named seven times.
How can I improve this code to reduce the number of times I have to repeat
myself?
--
Steve
“Cheer up,” they said, “things could be worse.
rship testing.
The union of A and B is the set of all elements in A plus those in B; the
intersection of A and B is the set of all elements in both A and B.
> but membership inclusion checks are definitely up there among primary
> purposes of sets.)
I can't think of a set operation (apa
chain of function calls.
>
> Procedural programming under another name...
Only in the sense that procedural programming is unstructured programming
under another name. What is a procedure call but a disguised GOSUB, and
what is GOSUB but a pair of GOTOs?
--
Steve
“Cheer up,” they said,
On Wed, 28 Sep 2016 11:05 pm, Jussi Piitulainen wrote:
> Steve D'Aprano writes:
>
>> On Wed, 28 Sep 2016 08:03 pm, Lawrence D’Oliveiro wrote:
>>
>>> On Wednesday, September 28, 2016 at 9:53:05 PM UTC+13, Gregory Ewing
>>> wrote:
>>>> Es
es x", "tres y", "tres z"]
4: ["cuatro", ("iv", "extra beta")]
5: ["five", ("v", "extra gamma")]
and then you can extract the separate columns from each value.
You might find it easier to have *all* the iterators yield (key, tuple)
pairs, where data1 and data2 yield a 1-tuple and data3 yields a 2-tuple.
If you look on ActiveState, I'm pretty sure you will find a recipe from
Raymond Hettinger for a merge sort or heap sort or something along those
lines, which you can probably adapt for an arbitrary number of inputs.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
as "pure
> function" and "function" in other contexts?
Honestly Chris, what's hard to understand about this? Monads are burritos.
http://blog.plover.com/prog/burritos.html
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, thi
ge(data1, data2, data3), keyfunc):
for x in stuff:
DISPATCH[id](key, *x)
you can do:
for key, (process, stuff) in groupby(merge(data1, data2, data3), keyfunc):
for x in stuff:
process(key, *x)
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and s
t; idioms" vs "languages with no functional programming support". Python
> is squarely in the second camp, with features like list
> comprehensions, map/reduce, etc, but never forcing you to use them.
List comps, map/reduce etc are the highest profile and least useful parts of
functional programming. The most useful is learning to avoid depending on
mutable state in your functions' environment, i.e. global variables,
instance attributes, etc. List comps etc are just a means to an end.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
e of the iterator:
def gen():
if random.random() < 0.5:
yield 1
it = gen()
Is it exhausted or not?
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 30 Sep 2016 05:18 am, Lawrence D’Oliveiro wrote:
> On Thursday, September 29, 2016 at 11:46:59 PM UTC+13, Ned Batchelder
> wrote:
>> This is just getting rude. Let's please drop it.
>
> Do you have anything substantive to contribute?
Infinitely more than you
type (including a union of multiple
types) which has at least one falsey value.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
AL. I'm not aware of any sensible language that
does anything like this.
No, wait a minute, I tell a lie, I recall Chris Angelico mentioning that one
of his favourite languages, Pike or REXX, does it. I forget which.
--
Steve
“Cheer up,” they said, “things could be worse.” So I
or even unavoidable, decisions.
[1] "When I design my killer language, the identifiers `foo` and `bar` will
be reserved words, never used, and not even mentioned in the reference
manual. Any program using one will simply dump core without comment.
Multitudes will rejoice." - Tim
ed. With 'for', especially one
> inside a list-comp, often you just need some throwaway index variable
> without worrying if it will clash with an existing local.
>
> But it's not useful enough I think to bother changing now. Or even when
> the language was designed.
Indeed
On Sat, 1 Oct 2016 10:46 am, Gregory Ewing wrote:
> Steve D'Aprano wrote:
>> Giving for-loops their own namespace is a grossly unintuitive and a very
>> weird thing to do.
>>
>> It would be terribly inconvenient and surprising for if...else blocks to
>> b
indings in a
namespace rather than fixed addresses, there is no difference between
updating an existing binding and creating a new one.
In a language like Python, the only distinction we can make between name
bindings is, which namespace is the binding in? In other words, what is the
current block of code's scope?
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
{
printf("%d:", i);
i = 0;
}
}
Solution: don't do that.
[1] Apparently useful error messages are one of those things C programmers
eschew, like type safety, memory safety, and correctness.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
, then cut your code down to the
smallest possible amount that shows the problem:
http://sscce.org/
and I'll read it again.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
main
development machine, but as a temporary measure, I thought I could compile
3.6 on this VM, then copy the python binary to my usual desktop machine.
What sort of challenges am I likely to find? Both machines are Linux, but
different distros.
--
Steve
“Cheer up,” they said, “things could be
he explanatory mechanisms of why/whither/what etc should
> at best be secondary 5. is workaroundable with a [... for newvar in [rhs]]
>Possible and clunky
I don't know what this means.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
.
Does gcc support static linking? Even if I end up with a much bigger binary,
at least I know it will have everything it needs to run and I won't have to
deal with DLL hell.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 1 Oct 2016 09:33 pm, Gregory Ewing wrote:
> Steve D'Aprano wrote:
>
>> # create a new binding
>> x: address 1234 > [ box contains 999 ]
>> x: address 5678 > [ a different box, containing 888 ]
>
> In the context of CPython and nes
prehension-ified
If your students think in terms of map, then fine, but I think it would
confuse more people than it would help. Your mileage may vary.
There are certainly a number of ways to get the desired behaviour. If you
prefer to work with map, go right ahead.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 2 Oct 2016 09:31 am, Paul Rubin wrote:
> Steve D'Aprano writes:
>> However I do have access to another machine (actually a VM) which can
>> compile Python 3.6. It's not practical for me to use it as a my main
>> development machine, but as a tempo
y the same way,
neither by value nor by reference.
http://import-that.dreamwidth.org/1130.html
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
ing.
tabulate() has a single scope, fabulate() has multiple scopes because it
has inner functions that take i as argument, making them local to the inner
functions. Um, yeah, of course they are different. They're different
because you've written them differently. What's your point?
As far
On Sun, 2 Oct 2016 12:30 am, Zachary Ware wrote:
> On Oct 1, 2016 06:25, "Steve D'Aprano" wrote:
>>
>> Long story short: I have no working systems capable of compiling the
> latest
>> Python 3.6, and no time to upgrade my usual machines to something which
o build CPython 3.6, and the most
recent any of my systems support is 4.4.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 2 Oct 2016 11:44 am, Gregory Ewing wrote:
> Steve D'Aprano wrote:
>> When you say:
>>
>> x = 0
>> x = 1
>>
>> inside a function, and the interpreter does the name binding twice,
>> there's no way of telling whether it write
On Sun, 2 Oct 2016 04:06 pm, Chris Angelico wrote:
> On Sun, Oct 2, 2016 at 3:19 PM, Steve D'Aprano
> wrote:
>> In IronPython, you could have the following occur in a function locals,
>> just as it could happen CPython for globals:
>>
>> - delete the nam
t we're in a rather murky part of Python's behaviour here,
one where a clean name lookup model has been most definitely put aside in
favour of speed, but it isn't quite clear whether this is defined language
behaviour, reference behaviour that all implementations are require
had introduced it was an explanation
like:
"Here is a proof of concept that shows that Python could give for loops
their own scope. If this Python code [nested for-loops] were translated
mechanically by the compiler [nested while loops with iterators] then each
loop would have their own scope."
On Sun, 2 Oct 2016 04:45 pm, Paul Rubin wrote:
> Steve D'Aprano writes:
>> Yes, this. You need gcc 4.8 or better to build CPython 3.6, and the most
>> recent any of my systems support is 4.4.
>
> Building gcc takes a while but it's reasonably simple. Just start i
rfaces* go, I'd like to see the research that proves that babies
don't intuitively know how to suckle from a nipple.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 3 Oct 2016 04:15 pm, Jussi Piitulainen wrote:
> Steve D'Aprano writes:
>> Why shouldn't people say that binding and assignment are the same
>> thing in Python? What's the difference?
>
> Outside Python, (lambda x : f(x)) is said to "bind" x.
understand what distinction you are trying to make.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
seconds,
then print 2. Is that right?
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 5 Oct 2016 06:10 am, Marko Rauhamaa wrote:
> Steve D'Aprano :
>
>> On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote:
>>
>>> Haskell defines let (it's version of multiple mutually recursive
>>> bindings) in terms of the least fix point of a
On Wed, 5 Oct 2016 04:12 am, Rustom Mody wrote:
> On Tuesday, October 4, 2016 at 10:06:00 PM UTC+5:30, Steve D'Aprano wrote:
>> On Tue, 4 Oct 2016 09:32 pm, Rustom Mody wrote:
>>
>> > Are not the contents of the scope and the shape of the scope different
>>
methods are decorated too
>
> @staticmethod
> def funct3(a, b):
> ...
>
> The 1st argument is not supposed to be automatically filled
> So what the decorator used for ?
> Just to distinguish funct3 from an instance method ?
Correct.
--
Steve
“Cheer up,” they said, “t
om ?
It doesn't. The descriptor protocol only gets called by classes, so when you
call a function directly, the special __get__ method isn't used.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Fri, 7 Oct 2016 01:36 am, Ned Deily wrote:
> On 2016-10-02 00:25, Steve D'Aprano wrote:
>> On Sun, 2 Oct 2016 01:58 pm, Chris Angelico wrote:
>>> Hmm, I've possibly missed something here, which may indicate a
>>> problem. Why can't your existing machi
etc)
> then that would be useful to know too. (And how does curses manage it?!)
I believe that curses uses a large database of terminal types and associated
escape sequences. So when you start it up, it determines what terminal type
you have (that's black magic itself) and then works out w
bed."
P.S. Desolate.Soul.Me, you might be taken a bit more seriously if you give a
name, or at least a moniker or nick-name which is easier for others to
refer to you by. It doesn't have to be your birthname, or legal name. What
do your friends and workmates call you?
I don't know Be
.
[3] Quite possibly the stupidest thing that has come out of academia since
post-modernism.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
be to write your own pre-processor, which will
parse your source code, and translate it from your language to valid
Python. That's a lot of work for very little value -- I recommend you just
learn the Python syntax rather than trying to force it to be something it
is not.
--
Steve
“Cheer up,
..
py> hasattr(f.__get__, '__get__')
False
So what kind of thing is f.__get__? f itself is a function, which looks like
this:
py> f
but f.__get__ is something different:
py> f.__get__
"Method-wrapper" is an undocumented internal implementation detail. It isn'
spaces in them.
The os.path and os functions do not need you to escape the file name with
quotes to handle spaces.
It is very likely that if you call out to another Windows program using the
os.system() call you will need to worry about escaping the spaces, but
otherwise, you don't need the
gt; example()
3081877100 []
py> example()
3081877100 [1]
py> example()
3081877100 [1, 1]
py> example()
3081877100 [1, 1, 1]
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
*is* a standard idiom.
> That is if you care about anyone reading your code ;)
Here's another example of a mutable default argument:
https://www.python.org/doc/essays/graphs/
Although it isn't actually being mutated. Nevertheless, if it is good enough
for Guido, then it should be
n
File "", line 1
a=1
^
SyntaxError: multiple statements found while compiling a single statement
Notice how the compiler shows the offending line and puts a caret ^ at the
end?
Unless you show us what code actually causes this error message, I don't
think it is poss
ther copy and paste one line at a time, or you can use the File >
Open menu command to open a complete script.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
t of things,
including globals(), map(), named exceptions, "" strings ('' is okay),
exponentiation, and more.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 9 Oct 2016 05:45 am, Random832 wrote:
> On Sat, Oct 8, 2016, at 07:29, Steve D'Aprano wrote:
>> The oldest version I have access to is the *extremely* primitive 0.9. Not
>> surprisingly, it doesn't have xrange -- but it lacks a lot of things,
>> in
ception: type error: illegal argument type for built-in
operation
Stack backtrace (innermost last):
File "", line 1
>>> d['1'] = 2
>>> print d
{'1': 2}
There are functions (def) but not lambda, but no `class` statement.
Primitive days indeed. And yet already usable.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
t; error:
> Traceback (most recent call last):
> File "", line 1, in
> while not done:
> NameError: name 'done' is not defined
Right.
That's because 'done' is not defined.
Why don't you try my suggestion of saving the code into a .py fi
lse
>>>> pygame = True
Why have you defined pygame = True? Is that what the code on the website
does?
My guess is that you are supposed to say:
import pygame
Why don't you try my suggestion of saving the code into a .py file, then
using the File > Open command to open it?
;= c means a <= b and b <= c
which is False for a = 1, b = 3 and c = 2.
> Using consistent operators is not required but is easier to read and less
> confusing.
Indeed.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
t; N=3 part.
I do not understand, what do you mean "dividing N=3 part"?
Could you do this?
[10,20,30,40,110,50,18,32,5]
split into three lists:
[10,20,30,40,110,50,18], [32], [5]
Or these three lists:
[10], [20,30,40,110,50,18], [32,5]
Or these three lists:
[10,20,30], [40,110
://www.chinesepython.org/english/english.html
or at least was very serious a few years ago. Unfortunately I don't know if
it is still maintained.
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
https://mail.python.org/mailman/listinfo/python-list
ns calling"
from last week. I believe that he hasn't given up on the hope to avoid
writing parentheses and just use spaces, even though we've already
explained that is ambiguous:
func a b c
# is that func(a, b, c) or func(a(b, c)) or func(a, b(c)) or ... ?
I don't believe t
On Wed, 12 Oct 2016 12:19 am, BartC wrote:
> Python is not really suited for AOT native-code compilation.
You might be right, but the author of Nuitka disagrees.
http://nuitka.net/
Nice to see that there's a new release, only a week or so ago!
--
Steve
“Cheer up,” they said,
801 - 900 of 7146 matches
Mail list logo