On 12Aug2014 09:56, Steven D'Aprano
wrote:
Cameron Simpson wrote:
On 12Aug2014 02:07, Steven D'Aprano
wrote:
Is this documented somewhere?
In python/2.7.6/reference/simple_stmts.html#index-22, "print" is described
in terms of a "write" for each object, and a "write" for the separators.
Th
On 12Aug2014 08:01, Marko Rauhamaa wrote:
Steven D'Aprano :
Personally, I believe that print ought to do its own locking. And
print is a statement, although in this case there's no need to support
anything older than 2.6, so something like this ought to work:
from __future__ import print_funct
Steven D'Aprano :
> Personally, I believe that print ought to do its own locking. And
> print is a statement, although in this case there's no need to support
> anything older than 2.6, so something like this ought to work:
>
>
> from __future__ import print_function
>
> _print = print
> _rlock =
On Tuesday, August 12, 2014 12:23:57 AM UTC+5:30, Grant Edwards wrote:
> I just installed Arch Linux for the first time, and was surprosed to
> find that Python isn't installed as part of a "base" system. It's
> also not included in the 'base-devel' package group. It's trivial to
> install, but I
On 2014-08-11, Chris Angelico wrote:
> On Tue, Aug 12, 2014 at 7:36 AM, Ned Deily wrote:
>> In article ,
>> Grant Edwards wrote:
>>> Apparently. Perhaps theres an "enable LSB compliance" option
>>> somewhere in the Arch install docs, but I didn't see it...
>>
>> Also beware that, unlike most o
On 2014-08-12 02:07, Steven D'Aprano wrote:
> >> It is rude to deliberately refuse to give attributes
> >
> > While I find this true for first-level attribution, I feel far
> > less obligation to attribute additional levels (and the verbosity
> > they entail).
>
> I cannot disagree with that.
On Tue, Aug 12, 2014 at 12:07 PM, Steven D'Aprano wrote:
> I cannot disagree with that. I consider that the first-level attribution
> MUST be given, second-level SHOULD be given, and third- and subsequent
> levels MAY be given, where MUST/SHOULD/MAY have their conventional
> meanings from RFC 2119
On Mon, 11 Aug 2014 19:27:25 -0500, Tim Chase wrote:
> On 2014-08-12 10:11, Steven D'Aprano wrote:
>> It is rude to deliberately refuse to give attributes
>
> While I find this true for first-level attribution, I feel far less
> obligation to attribute additional levels (and the verbosity they
>
On 2014-08-12 10:11, Steven D'Aprano wrote:
> It is rude to deliberately refuse to give attributes
While I find this true for first-level attribution, I feel far less
obligation to attribute additional levels (and the verbosity they
entail). If the reader is really that interested in who said what
Wolfgang Keller wrote:
>> By the way, you keep replying to people, and quoting them, but
>> deleting their name. Please leave the attribution in place, so we
>> know who you are replying to.
>
> That's what the "References:"-Header is there for.
The References header is for the benefit of news a
On Tue, Aug 12, 2014 at 9:56 AM, Steven D'Aprano
wrote:
> from __future__ import print_function
>
> _print = print
> _rlock = threading.RLock()
> def print(*args, **kwargs):
> with _rlock:
> _print(*args, **kwargs)
You're conflating print and stdout here. Do you know which one is the
Cameron Simpson wrote:
> On 12Aug2014 02:07, Steven D'Aprano
> wrote:
>>INADA Naoki wrote:
>>
>>> On Python 3, print is thread safe.
>>> But Python 2 has broken scenario:
>>
>>Is this documented somewhere?
>
> In python/2.7.6/reference/simple_stmts.html#index-22, "print" is described
> in terms
On Tue, Aug 12, 2014 at 7:36 AM, Ned Deily wrote:
> In article ,
> Grant Edwards wrote:
>> Apparently. Perhaps theres an "enable LSB compliance" option
>> somewhere in the Arch install docs, but I didn't see it...
>
> Also beware that, unlike most other distributions and contrary to
> recommend
On Tue, Aug 12, 2014 at 12:32 AM, Robin Becker wrote:
> Of course Python can be even more confusing so that for example
>
class NeverEqual(int):
> ... def __new__(cls,v):
> ... self = int.__new__(cls,v)
> ... return self
> ... def __eq__(self,other):
> ...
On 14-08-11 04:26 PM, thequietcen...@gmail.com wrote:
...
Hello, has anyone created a survey of Python Object Systems? The two I am aware
of are:
- elk https://github.com/frasertweedale/elk
- Traits http://code.enthought.com/projects/traits/
Here's the ones from my talk at Pycon 2005
(http://w
On 06/08/2014 20:05, Skip Montanaro wrote:
On Wed, Aug 6, 2014 at 1:31 PM, Joel Goldstick wrote:
Among other features it lists this: Gaps in functionality: ISO-8601
parsing, timespans, humanization
What is "humanization"?
Skip
Presumably as in https://pypi.python.org/pypi/humanize
The pa
On 2014-08-10, Marko Rauhamaa wrote:
> Christian Gollwitzer :
>
>> Am 10.08.14 11:39, schrieb Steven D'Aprano:
>>> Android phones don't mount as storage devices?
>>> Oh well, that's Android crossed off my list.
>>
>> Not any longer. They used to, but the support for mass storage was
>> dropped in
On 31/07/2014 10:11, Wolfgang Maier wrote:
Hi,
I'm trying to convert ISO8601-compliant strings representing dates or
dates and times into datetime.datetime objects.
I tried using the strptime method, but the problem here is that I can
only specify one format argument, which can be used to parse e
On 12Aug2014 02:07, Steven D'Aprano
wrote:
INADA Naoki wrote:
On Python 3, print is thread safe.
But Python 2 has broken scenario:
Is this documented somewhere?
In python/2.7.6/reference/simple_stmts.html#index-22, "print" is described in
terms of a "write" for each object, and a "write"
On 2014-08-08, Chris Angelico wrote:
> On Fri, Aug 8, 2014 at 11:58 PM, Steven D'Aprano
> Why should that disable access to everything else? Most full screen
> games let you alt-tab away from them (preferably auto-pausing the
> game). If a game goes system modal on me, I would not be happy.
>
>>
On 2014-08-07, Jaydeep Patil wrote:
> I have one query. I have did some programming which copies and paste
> data using system clipboard. I need to keep one GUI always on top
> till my python code is running.
If you mean keep it on top while it is running, the answer is probably
yes, but how to
On 11/08/2014 13:30, alister wrote:
It already is a different operator from equality which is ==
Mathematicians use '=' for name binding all the time, with and without
'let':
Let u = x + y, v = x - y. Then ... .
However, name binding itself is a mental operation, not a mathematical one.
Ma
thequietcen...@gmail.com:
> I personally get tired of manually assigning attributes in a
> __init__() method.
It's not all that bad. Just do it.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
On 11/08/2014 22:26, thequietcen...@gmail.com wrote:
On Monday, August 11, 2014 5:09:35 PM UTC-4, Marko Rauhamaa wrote:
Elk and Traits implement a C++-style object model on top of Python. The
systems enforce member access, type constraints etc and result in ugly
code that barely looks like P
In article ,
Grant Edwards wrote:
> Apparently. Perhaps theres an "enable LSB compliance" option
> somewhere in the Arch install docs, but I didn't see it...
Also beware that, unlike most other distributions and contrary to
recommended practice, Arch has chosen to make Python 3 its default, th
On Monday, August 11, 2014 5:09:35 PM UTC-4, Marko Rauhamaa wrote:
>
> Elk and Traits implement a C++-style object model on top of Python. The
>
> systems enforce member access, type constraints etc and result in ugly
>
> code that barely looks like Python.
I personally get tired of manually a
Skip Montanaro :
> On Mon, Aug 11, 2014 at 3:26 PM, wrote:
>> has anyone created a survey of Python Object Systems?
>
> For the uninitiated, can you back up a step and define what you mean
> by an "object system"?
Elk and Traits implement a C++-style object model on top of Python. The
systems e
On Monday, August 11, 2014 4:37:29 PM UTC-4, Skip Montanaro wrote:
> On Mon, Aug 11, 2014 at 3:26 PM, wrote:
>
> > has anyone created a survey of Python Object Systems?
>
>
>
> For the uninitiated, can you back up a step and define what you mean
>
> by an "object system"?
I mean a system b
On Mon, Aug 11, 2014 at 3:26 PM, wrote:
> has anyone created a survey of Python Object Systems?
For the uninitiated, can you back up a step and define what you mean
by an "object system"? The term seems kind of broad for Google (
number of hits for CLOS, etc), and Wikipedia just directs to a pag
(Cross-posted from
http://www.reddit.com/r/Python/comments/2d9f7i/survey_of_python_object_systems/)
Hello, has anyone created a survey of Python Object Systems? The two I am aware
of are:
- elk https://github.com/frasertweedale/elk
- Traits http://code.enthought.com/projects/traits/
--
https:/
On 2014-08-11, Chris Rebert wrote:
> On Mon, Aug 11, 2014 at 11:53 AM, Grant Edwards
> wrote:
>> I just installed Arch Linux for the first time, and was surprosed to
>> find that Python isn't installed as part of a "base" system. It's
>> also not included in the 'base-devel' package group. It'
On Mon, Aug 11, 2014 at 11:53 AM, Grant Edwards wrote:
> I just installed Arch Linux for the first time, and was surprosed to
> find that Python isn't installed as part of a "base" system. It's
> also not included in the 'base-devel' package group. It's trivial to
> install, but I'd still pretty
I just installed Arch Linux for the first time, and was surprosed to
find that Python isn't installed as part of a "base" system. It's
also not included in the 'base-devel' package group. It's trivial to
install, but I'd still pretty surprised it's not there by default. I
guess I've spent too mu
On 2014-08-11, Wolfgang Keller wrote:
> [somebody, but we don't know who, wrote]...
>> By the way, you keep replying to people, and quoting them, but
>> deleting their name. Please leave the attribution in place, so we
>> know who you are replying to.
>
> That's what the "References:"-Header is
On 2014-08-06, Wolfgang Keller wrote:
>> > Because on such operating systems, each and every application is an
>> > entirely self-contained package that doesn't need any "packages" or
>> > "installers" to use it.
>
>> For people who have never used such a system it's probably difficult
>> to see t
INADA Naoki wrote:
> On Python 3, print is thread safe.
>
> But Python 2 has broken scenario:
Is this documented somewhere?
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
To me rather more interesting than discussing the relative merits of '='
compared to '==', '<=' or ':='. See here
http://nuitka.net/posts/nuitka-release-054.html
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
--
https:/
On 11/08/2014 13:30, alister wrote:
It already is a different operator from equality which is ==
perhaps it would have been better if the behaviour of these two operators
were reversed (= for equality & == for assignment) but i suspect that
Idea if even considered was quickly discarded as it wou
On 08/09/2014 09:07 PM, luofeiyu wrote:
> in the http://homepages.ius.edu/rwisman/C490/html/PythonandBluetooth.htm
>
> *Discovery*
That only works for phones if the phones are manually switched to
discoverable mode, which is off by default for security reasons. By
default they are not going to s
On 11/08/2014 13:11, Rustom Mody wrote:
But then when it comes to Steven supporting the violation 500 years* of
math conventional usage of '=':
I have no interest in the maths convention (see, you don't even know the
original, correct English, math indeed). Of far more importance in the
re
On 11/08/2014 13:30, Tim Chase wrote:
On 2014-08-11 07:55, Roy Smith wrote:
A C programmer asked to swap variables x and y, typically writes
something like
t = x; x = y; y = t;
Fine, since C cant do better.
Sure C can do better.
x = x ^ y
y = y ^ x
x = x ^ y
Any self-respecting C hacker wo
On 11/08/2014 10:04, Steven D'Aprano wrote:
On Mon, 11 Aug 2014 13:15:19 +0800, 13813962782 wrote:
Just like MANY people, I was one of guys who do very like Python. But
there's one thing always puzzled me, could you kindly help give some
words about it:
"Java is belonging to Oracle, C++ is def
On 11/08/2014 10:08, Wolfgang Keller wrote:
By the way, you keep replying to people, and quoting them, but
deleting their name. Please leave the attribution in place, so we
know who you are replying to.
That's what the "References:"-Header is there for.
Sincerely,
Wolfgang
The references
On Mon, Aug 11, 2014 at 10:41 PM, Marko Rauhamaa wrote:
> Tim Chase :
>
>> Pish, such redundancy...everyone knows a C programmer would write
>> that as
>>
>> x ^= y
>> y ^= x
>> x ^= y
>
> Aren't you forgetting something?
I don't think he is. Those are augmented assignments, just as Python
has
Tim Chase :
> Pish, such redundancy...everyone knows a C programmer would write
> that as
>
> x ^= y
> y ^= x
> x ^= y
Aren't you forgetting something?
Marko
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Aug 11, 2014 at 10:11 PM, Rustom Mody wrote:
> So evidently using notations in the ways they are conventionally used
> is a good thing.
>
> But then when it comes to Steven supporting the violation 500 years* of
> math conventional usage of '=':
Yep. It's not a violation; it's a modificat
alister :
> It already is a different operator from equality which is ==
>
> perhaps it would have been better if the behaviour of these two
> operators were reversed (= for equality & == for assignment) but i
> suspect that Idea if even considered was quickly discarded as it would
> cause major c
On Mon, 11 Aug 2014 12:56:59 +0100, Robert Kern wrote:
> On 2014-08-11 03:04, Steven D'Aprano wrote:
>> Rustom Mody wrote:
>>
>>> Its when we have variables that are assigned in multiple places that
>>> we start seeing mathematical abominations like x = x+1
>>
>> That's not a mathematical abominat
On 2014-08-11 07:55, Roy Smith wrote:
> > A C programmer asked to swap variables x and y, typically writes
> > something like
> >
> > t = x; x = y; y = t;
> >
> > Fine, since C cant do better.
>
> Sure C can do better.
>
> x = x ^ y
> y = y ^ x
> x = x ^ y
>
> Any self-respecting C hacker wo
Having it both ways aren't you?
On the one hand you say
On Monday, August 11, 2014 3:21:35 PM UTC+5:30, Chris Angelico wrote:
> On Mon, Aug 11, 2014 at 7:35 PM, Marko Rauhamaa wrote:
> > Python is a formal language with a well-defined syntax and reasonably
> > well-understood semantics. That's al
In article ,
Rustom Mody wrote:
> A C programmer asked to swap variables x and y, typically writes something
> like
>
> t = x; x = y; y = t;
>
> Fine, since C cant do better.
Sure C can do better.
x = x ^ y
y = y ^ x
x = x ^ y
Any self-respecting C hacker would write it this way :-)
--
ht
On 2014-08-11 03:04, Steven D'Aprano wrote:
Rustom Mody wrote:
Its when we have variables that are assigned in multiple places that
we start seeing mathematical abominations like
x = x+1
That's not a mathematical abomination. It's a perfectly reasonable
mathematical equation, one with no solu
On Monday, August 11, 2014 3:58:59 PM UTC+5:30, Steven D'Aprano wrote:
> On Sun, 10 Aug 2014 21:29:12 -0700, Rustom Mody wrote:
> > On Monday, August 11, 2014 8:30:32 AM UTC+5:30, Steven D'Aprano wrote:
> >> You did the same thing in your own course, the only difference being
> >> you accepted a d
Chris Angelico wrote:
> On Mon, Aug 11, 2014 at 7:44 PM, Steven D'Aprano
> wrote:
>> And even when you can
>> parallelize a series of tasks, it's
>
> ... easy for one task to get aborted part way while the rest of the
> tasks continue on, oblivious to the absence of the rest of that
> sentence?
On Mon, Aug 11, 2014 at 8:46 PM, Marko Rauhamaa wrote:
> The main thing is that the definitions must be clear. I must be able to
> look up the precise description quickly, and in fact, I always have the
> Python Library Reference in a browser tab or two because I have to
> review even familiar fun
Chris Angelico :
> On Mon, Aug 11, 2014 at 7:35 PM, Marko Rauhamaa wrote:
>> Python is a formal language with a well-defined syntax and reasonably
>> well-understood semantics. That's all that matters. Any resemblance
>> to the much more ad-hoc syntax of classical mathematics is almost
>> coincid
On Sun, 10 Aug 2014 21:29:12 -0700, Rustom Mody wrote:
> On Monday, August 11, 2014 8:30:32 AM UTC+5:30, Steven D'Aprano wrote:
>
>> You did the same thing in your own course, the only difference being
>> you accepted a different set of primitive functions. But ultimately you
>> have to introduce
On Mon, Aug 11, 2014 at 7:37 PM, alister
wrote:
> On Mon, 11 Aug 2014 11:08:43 +0200, Wolfgang Keller wrote:
>
>>> By the way, you keep replying to people, and quoting them, but deleting
>>> their name. Please leave the attribution in place, so we know who you
>>> are replying to.
>>
>> That's wha
On Python 3, print is thread safe.
But Python 2 has broken scenario:
print "spam", "spam", "spam" # thread 1
print "eggs", "eggs", "eggs" # thread 2
In this case, 2 lines are mixed.
In your case, "spam spam spam" and "eggs eggs eggs" are not mixed.
But newline is mixed like:
spam spam spameg
On Mon, Aug 11, 2014 at 7:44 PM, Steven D'Aprano wrote:
> I think this is why both declarative and functional programming idioms
> will remain niche (although important niches). Most tasks are inherently
> imperative to at least some degree, and often a *great* degree.
Maybe that's true as a whol
On Mon, Aug 11, 2014 at 7:44 PM, Steven D'Aprano wrote:
> And even when you can
> parallelize a series of tasks, it's
... easy for one task to get aborted part way while the rest of the
tasks continue on, oblivious to the absence of the rest of that
sentence?
ChrisA
--
https://mail.python.org/m
On Mon, Aug 11, 2014 at 7:35 PM, Marko Rauhamaa wrote:
> Python is a formal language with a well-defined syntax and reasonably
> well-understood semantics. That's all that matters. Any resemblance to
> the much more ad-hoc syntax of classical mathematics is almost
> coincidental.
Well, it's a bit
On Sun, 10 Aug 2014 22:23:18 -0700, Rustom Mody wrote:
> A C programmer asked to swap variables x and y, typically writes
> something like
>
> t = x; x = y; y = t;
>
> Fine, since C cant do better.
> But then he assumes that that much sequentialization is inherent to the
> problem... Until he se
On Mon, 11 Aug 2014 11:08:43 +0200, Wolfgang Keller wrote:
>> By the way, you keep replying to people, and quoting them, but deleting
>> their name. Please leave the attribution in place, so we know who you
>> are replying to.
>
> That's what the "References:"-Header is there for.
>
> Sincerely,
Rustom Mody :
> You think that the '=' sign not standing for math equality is ok.
>
> How come?
Python is a formal language with a well-defined syntax and reasonably
well-understood semantics. That's all that matters. Any resemblance to
the much more ad-hoc syntax of classical mathematics is almo
On Mon, Aug 11, 2014 at 6:55 PM, Steven D'Aprano wrote:
> On Sun, 10 Aug 2014 23:22:45 -0700, Rustom Mody wrote:
>
>> You think that the '=' sign not standing for math equality is ok.
>>
>> How come?
>
> For the same reason that in the following:
>
> [c.upper() for c in some_string if 'a' < c < 'x
> >> > Thankfully, all actually user-friendly operating systems (MacOS,
> >> > TOS, RiscOS, probably AmigaOS, MacOS X) spare(d) their users the
> >> > bottomless cesspit of "package management" and/or "installers".
> >> >
> >> > Because on such operating systems, each and every application is
> >>
> > Linux was made by geeks who didn't have a clue of ergonomics for
> > screenworkers and didn't care to get one.
>
> I can only repeat what you said earlier:
>
> "You should get a clue in stead [sic] of just fantasizing up
> assumptions based on ignorance."
>
> I daresay that Linus Torvalds sp
On Mon, 11 Aug 2014 13:15:19 +0800, 13813962782 wrote:
> Just like MANY people, I was one of guys who do very like Python. But
> there's one thing always puzzled me, could you kindly help give some
> words about it:
>
> "Java is belonging to Oracle, C++ is defined by ISO Python is designed
> by g
On Sun, 10 Aug 2014 23:22:45 -0700, Rustom Mody wrote:
> You think that the '=' sign not standing for math equality is ok.
>
> How come?
For the same reason that in the following:
[c.upper() for c in some_string if 'a' < c < 'x']
having the c symbol not stand for the speed of light is okay. Li
On 11/08/2014 06:06, Paul Wolf wrote:
I'm pleased to see that you have answers. In return would you please
read and action this https://wiki.python.org/moin/GoogleGroupsPython to
prevent us seeing double line spacing and single line paragraphs, thanks.
--
My fellow Pythonistas, ask not what
Specifically for Python 2.6 and 2.7, but answers for 3.x appreciated as
well.
Is print thread safe? That is, if I have two threads that each call
print, say:
print "spam spam spam" # thread 1
print "eggs eggs eggs" # thread 2
I don't care which line prints first, but I do care if the two lin
On Sun, Aug 10, 2014 at 7:22 PM, Steven D'Aprano
wrote:
> Devin Jeanpierre wrote:
>
>> On Sun, Aug 10, 2014 at 9:31 AM, Steven D'Aprano
>> wrote:
>
>>> I don't think that using a good, but not cryptographically-strong, random
>>> number generator to generate passwords is a serious vulnerability.
73 matches
Mail list logo