Akira Li <4kir4...@gmail.com> writes:
> I'm not sure what "parcel tags" model is but if you mean these
> pictures[1] than it works in this case as well as any other (take *a*,
> *b* nametags, put them on the corresponding balloons that represents
> list objects).
>
> The only names left are *a* and
Laura Creighton writes:
> But I am not sure how it is that a poor soul who just wants to print a
> railway schedule 'in local time' is supposed to know that Creighton is
> using Winnipeg time.
The same way they know that any other location is using whatever time it
uses. By the user having specif
On Sat, Sep 12, 2015, at 22:25, Tim Peters wrote:
> That helps a lot, but "industrial-strength" implies "by algorithm".
> There are far too many zones to deal with by crafting a hand-written
> class for each.
It occurs to me that though it's written in C, the zdump utility
included in the tz cod
Akira Li <4kir4...@gmail.com> writes:
>Rustom Mody writes:
>> viz. I have two variables (or names!) say a and b which look the same
> a
>> [[1,2],[1,2]]
> b
>> [[1,2],[1,2]]
>> And yet doing
> a[0][0] = "Oops!"
>> gives a data structure one "Oops!"
>> whereas doing it to b mysteriously
Jussi Piitulainen writes:
> I think the best way is to say that a[0] and a[1] are the same object,
> while b[0] and b[1] are different objects.
Sure, you can *say* that. But how do you draw it on a diagram with
sticky notes or parcel tags or whatever?
--
https://mail.python.org/mailman/listinfo
Oops, pressed the wrong reply button and it didn't include the datetime
list.
On Sat, Sep 12, 2015, at 14:53, Tim Peters wrote:
> > I was trying to find out how arithmetic on aware datetimes is
> > "supposed to" work, and tested with pytz. When I posted asking why
> > it behaves this way I was tol
On Sat, Sep 12, 2015, at 14:53, Tim Peters wrote:
> > I was trying to find out how arithmetic on aware datetimes is
> > "supposed to" work, and tested with pytz. When I posted asking why
> > it behaves this way I was told that pytz doesn't behave correctly
> > according to the way the API was desig
On Sat, Sep 12, 2015, at 14:36, Carl Meyer wrote:
> Well, the problem is that because datetime doesn't include any way to
> disambiguate ambiguous times, it's not really possible to implement
> complex timezones in a way that is both correct (if your definition of
> correct includes "timezone conve
I was trying to find out how arithmetic on aware datetimes is "supposed
to" work, and tested with pytz. When I posted asking why it behaves this
way I was told that pytz doesn't behave correctly according to the way
the API was designed. The tzlocal module, on the other hand, appears to
simply def
Chris Angelico writes:
> Here. Ned Batchelder explains it better than I can.
See, those diagrams are perfect (well, almost, I think the names should
have square boxes too). They're arrows. They *point* at
things. *Pointers*.
The boxes are variables. The circles represent special boxes
(implement
Mark Lawrence writes:
> No it isn't. When you make a copy of an object you will end up with
> two names that refer to the same object.
No, when you *make a copy of* an object, you get two objects.
>>> x = [1, 2, 3]
>>> y = copy.copy(x)
>>> x is y
False
What you make a copy of when you do y =
Ben Finney writes:
> The reference value is inaccessible to the program, it can only be used
> to get at the referenced object.
That's like saying an integer is inaccessible since it can only be used
to add/subtract/etc (list of all operations you can do with an
integer). What does it mean to acc
Mark Lawrence writes:
> Let's put it another way, in the 15 years I've been using Python I do
> not recall any experienced Python programmer using "pointer", so what
> makes you think, in 2015, that you are correct and everybody else is
> wrong? I still say that everything in Python is an object,
Mark Lawrence writes:
> How do I access these pointers? Is there a builtin called pointer()
> that's analogous to id()?
You access them *all the time*. They are the *only* thing you access.
But if you want... pointer = lambda x: return x
> I'll ask again, where do pointers come into
> the Jyth
Ben Finney writes:
> Random832 writes:
>
>> Ben Finney writes:
>> > With the significant difference that “pointer” implies that it has its
>> > own value accessible directly by the running program, such as a pointer
>> > in C.
>>
>> Its own
Ben Finney writes:
> With the significant difference that “pointer” implies that it has its
> own value accessible directly by the running program, such as a pointer
> in C.
Its own value *is* what you're accessing when you assign or return
it. You just can't do math on it, but there are lots of
Mark Lawrence writes:
> I think pointer is even worse because of its connection with C and
> hence cPython. What is wrong with object if that is the only thing
> Python knows about?
Because the object is the *thing the arrow points at*. You don't have
two objects when store the same object in tw
Mark Lawrence writes:
> My favourite analogy for Python names, the sticky note, here
> https://mail.python.org/pipermail/tutor/2006-October/049767.html
Is player3[3] also a sticky note? Wouldn't the note have to have the id
of player3 written on it somehow? Should the player3 sticky note have
the
Mark Lawrence writes:
> On 12/09/2015 01:11, random...@fastmail.us wrote:
> If everything in Python is an object, how can it assign a pointer?
> Especially how do Jython and IronPython assign pointers?
The Java and .NET runtimes also have pointers, they just don't [usually]
call them pointers, j
On Fri, Sep 11, 2015, at 20:01, Michael Torrie wrote:
> The secret to understanding the global keyword is to understand how
> Python namespaces work. The statement "a=5" does not assign a 5 to the
> box called "a." Rather it binds the name "a" to the "5" object, which
> is immutable and called in
On Fri, Sep 11, 2015, at 11:55, Chris Angelico wrote:
> On Sat, Sep 12, 2015 at 1:49 AM, Ian Kelly wrote:
> > Ah, that makes sense. It's writing into the dict that is created and
> > returned by locals(), but not actually updating the frame locals which
> > are the source of truth.
>
> Yeah... bu
On Fri, Sep 11, 2015, at 03:28, Antoon Pardon wrote:
> The error is also facilitated because C doesn't have booleans
> and so everything can be used as one.
Python does have booleans and everything can be used as one - the
logical conclusion is that being able to use everything as a boolean is
a
On Thu, Sep 10, 2015, at 16:15, Akira Li wrote:
> There are cases when it might be justified to alter the behavior e.g.,
> *colorama* allows to strip ANSI codes (e.g., disable colored output) if
> stdout is not a tty or *win-unicode-console* make sys.stdout to use
> WriteConsoleW() to write Unicode
On Thu, Sep 10, 2015, at 14:13, Steven D'Aprano wrote:
> Because that's the definition of an expression in this context. An
> expression is evaluated to either return a result, or raise an exception.
Nonsense. An expression is something allowed within a larger expression.
It's easy to imagine an e
On Thu, Sep 10, 2015, at 12:48, Chris Angelico wrote:
> Having assignment be a statement (and therefore illegal in a loop
> condition) makes sense. Having it be an expression that yields a
> useful or predictable value makes sense. Having it be an expression,
> but not returning a value, doesn't.
On Thu, Sep 10, 2015, at 11:59, Steven D'Aprano wrote:
> Although, I'm not sure that I agree with the idea that "everything is an
> expression". I think that's a category mistake, like asking for the speed
> of dark[1], or for a bucket of cold. Some things are functional by
> nature,
> and other th
On Wed, Sep 9, 2015, at 15:59, Tim Golden wrote:
> On 09/09/2015 08:59, Laszlo Lebrun via Python-list wrote:
> > Yes, you are right, let me append the message.
> > Just after a fresh install of Python with PIP on Windows.
> > Whenever I start PIP, I get:
> > "Fatal error in launcher: Unable to crea
On Wed, Sep 9, 2015, at 13:55, Steven D'Aprano wrote:
> In fairness to the C creators, I'm sure that nobody back in the early
> seventies imagined that malware and security vulnerabilities would be as
> widespread as they have become. But still, the fundamental decisions made
> by C are lousy. Assi
MRAB writes:
> If you're allowed to specify both bounds, why would you be forbidden
> from negative ones?
It makes it non-obvious what value should be returned from e.g. search
methods that return a negative number on failure. .NET's IndexOf
function returns -1, but MaxValue if the array has a ne
On Tue, Sep 8, 2015, at 10:31, Ian Kelly wrote:
> I believe this wart is fixed in VB .NET.
This is apparently true, but the weird thing is it was done late enough
in the design cycle that the .NET runtime still has features meant to
support it. You can create such an array with the Array.CreateIns
Steven D'Aprano writes:
> That depends. Is the example C# code idiomatic for the language?
Not in the least. My first clue was Int32 - nobody actually uses those
names.
> Or was it
> written by somebody ignorant of C#, and consequently is a poor example of
> badly-written and unidiomatic "Java
On Thu, Sep 3, 2015, at 19:25, Sven R. Kunze wrote:
> You mentioned side-effects. That is true. Right now, however, the
> side-effects even fire back to the RHS of the assignment. That is really
> weird. To me, and as it seems to some other folks here, the RHS should
> be at least independent
On Wed, Sep 2, 2015, at 13:26, Sven R. Kunze wrote:
> I agree as well. First evaluate the right side, then assign it to the
> left side at once.
The behavior, if it's *not* "first evaluating the right side", is
indistinguishable from it by this test. Assigning the RHS of each case
to a separate l
On Tue, Sep 1, 2015, at 10:57, Steven D'Aprano wrote:
> Q1: In this example, I know that I opened the fd in write mode, because
> I
> did it myself. But since I'm not actually opening it, how do I know what
> mode to use in the call to fdopen? Is there something I can call to find
> out what mode
On Fri, Aug 28, 2015, at 00:57, Victor Hooi wrote:
> I'm reading JSON output from an input file, and extracting values.
>
> Many of the fields are meant to be numerical, however, some fields are
> wrapped in a "floatApprox" dict, which messed with my parsing.
> Is there a way to re-write strip_flo
On Tue, Aug 25, 2015, at 12:56, Terry Reedy wrote:
> Huh?? I fail to see the point of this buggy code.
...
> The extra marginal '>' quote makes it look like this buggy code was
> posted by Andrew, but it comes from random832.
Actually, it comes from one of the links I pos
On Mon, Aug 24, 2015, at 22:12, Andrew Wang wrote:
> Hi.
>
> I know this thread is ancient, but I would like to know the answer
> as well
> ( https://mail.python.org/pipermail/python-list/2006-May/413542.html).
Of course, the answer in 2015 is actually very different from the
answer in 2006, sinc
On Mon, Aug 17, 2015, at 18:25, alex.fl...@gmail.com wrote:
> Sorry I completely mistype that. It was supposed to read:
>
> >>> id(multiprocessing.Process.is_alive) == id(multiprocessing.Process.start)
> True
>
> >>> multiprocessing.Process.is_alive is multiprocessing.Process.start
> False
Try t
On Sun, Aug 16, 2015, at 14:41, Chris Angelico wrote:
> On Mon, Aug 17, 2015 at 3:27 AM, Albert-Jan Roskam
> wrote:
> > Does that number happen to be -1 * sys.maxint?
>
> No, it's -1 * 0x7ff5f806. As a signed 32-bit integer, it's 0x800a07fa.
> Does either of those numbers mean anything?
That's a
On Sat, Aug 8, 2015, at 13:59, Laurent Pointal wrote:
> > Level?
>
> Graduate (post-Bac in france)
Yours or your students?
> > 1. Are you
> > grade school (1=12)?
>
> (sorry, I dont know correspondance in france)
Grade 12 refers to 17-18 year old students, each grade is one year.
> > undergra
On Tue, Aug 4, 2015, at 21:32, Michael Torrie wrote:
> In many of my projects I put basic config variables in a file like
> config.py and import that in each module that needs it. The config
> module doubles as a global namespace for sharing between modules as well.
What about JSONP? That is, a f
On Sat, Jul 11, 2015, at 03:28, Chris Warrick wrote:
> That’s not necessarily “older”.
>
> Windows XP/7/8: My Documents
> Windows Vista/8.1: Documents
Mine's called Documents on 7 and 8. Is the system you got this
information from a new install or an upgrade? (It may also depend on
whether it's a
On Thu, Jul 30, 2015, at 14:31, sutanu@gmail.com wrote:
> _year=$(date -d "-5 hour" +%Y)
> _month=$(date -d "-5 hour" +%m)
> _day=$(date -d "-5 hour" +%d)
> _hour=$(date -d "-5 hour" +%H)
What is the purpose of the -5 hour offset? Is it an attempt to
compensate for timezones?
--
https://mail.
On Sun, Jul 26, 2015, at 07:48, Marko Rauhamaa wrote:
> At first, there was only the machine language. Assembly languages
> introduced "mnemonics" for the weaklings who couldn't remember the
> opcodes by heart.
To be fair, x86 is also a particularly terrible example of a machine
language, from the
On Sun, Jul 26, 2015, at 02:43, Ian Kelly wrote:
> What Internet standard is being violated by reflowing text content in
> the message body?
Well, implicitly, text is only supposed to be reflowed when
format=flowed is in use, and only then when each physical line of the
file ends with a space char
On Sat, Jul 11, 2015, at 07:20, Chris Angelico wrote:
> On Sat, Jul 11, 2015 at 9:12 PM, Luuk wrote:
> > It can occur in an arithmetic expression, and 'not' has a higher precedence
> > than '+'
> > (https://docs.python.org/2/reference/expressions.html#operator-precedence)
> >
>
> I think you're m
The My Documents directory is not guaranteed to be named "Documents". On
older versions of windows it was "My Documents", and on foreign versions
of windows it is a name in their language.
The correct way to get the path of this folder is, for example (couldn't
test since I'm on a mac right now)
On Thu, Jul 9, 2015, at 15:36, Tony the Tiger wrote:
> On Sun, 05 Jul 2015 20:29:11 +, Stefan Ram wrote:
>
> > X-Copyright: (C) Copyright 2015 Stefan Ram. All rights reserved.
> > Distribution through any means other than regular usenet channels is
> > forbidden. It is forbidden to publish thi
On Wed, Jul 1, 2015, at 21:49, bvdp wrote:
> Interesting that negative values translate properly. That's an
> non-intuitive result to me. Guess I should have studied that math stuff
> harder way back when!
There are multiple interpretations of the operation, and not all
languages behave the same w
On Wed, Jul 1, 2015, at 20:12, bvdp wrote:
> Not sure what this is called (and I'm sure it's not normalize). Perhaps
> "scaling"?
>
> Anyway, I need to convert various values ranging from around -50 to 50 to
> an 0 to 12 range (this is part of a MIDI music program). I have a number
> of places whe
On Mon, Jun 29, 2015, at 14:25, Terry Reedy wrote:
> Registry => Windows.
> Did you check [X] Make this my default python?
I didn't see any such checkbox, in any of installers I ran.
(And, yes, I assumed windows was implied by my subject - other systems
python runs on either don't have a notion o
I installed Python 2.1 for historical interest and it associated python
files with the python 2.1 interpreter. I installed 3.4 afterwards (I had
3.3 as my latest python version before) expecting this to fix it, but it
left it alone. Even deleting all the Python associations from the
registry and th
On Sun, Jun 28, 2015, at 14:55, Steven D'Aprano wrote:
> I'm trying to use a readline binding for both TAB and Ctrl-TAB, but it's
> not
> working for me. Whichever I install second seems to over-ride the first.
Can you bind it directly to whatever escape sequence ctrl-tab produces?
Some terminals
On Thu, Jun 25, 2015, at 09:35, Michael Torrie wrote:
> The OP mentions that even when he manually supplies extended paths,
> os.mkdir, os.getsize, and shutil.rmtree return errors for him in Python
> 2.7. So there's more to this problem.
The byte versions of the underlying OS APIs use a 256-chara
On Wed, Jun 17, 2015, at 20:23, Chris Angelico wrote:
> On Thu, Jun 18, 2015 at 7:55 AM, Paul Hubert wrote:
> > f_in = open(dafile, 'rb')
> > f_out = gzip.open('/Users/Paul/Desktop/scripts/pic.jpg.gz', 'wb')
> > f_out.writelines(f_in)
> > f_out.close()
> > f_in.close()
>
> Are you sure you want i
On Wed, Jun 17, 2015, at 20:14, Chris Angelico wrote:
> Mostly. That would imply that object is a mandatory parameter, which
> AIUI isn't the case for Steven's edir. The downside of this kind of
> signature is that it's hard to show the parameters that have unusual
> defaults (either sentinel objec
On Wed, Jun 17, 2015, at 09:33, hamilton wrote:
> However, the python source can be read by anyone.
>
> As a .exe, the source can not be read.
>
> Just because the interpreter is open source,
> does not mean my application should be.
Being readable isn't the same thing as being open source. If s
On Tue, Jun 16, 2015, at 15:18, Thomas 'PointedEars' Lahn wrote:
> There is no such thing as “relative probability”, except perhaps in
> popular-
> scientific material and bad translations. You might mean relative
> _frequency_, but I was not talking about that specifically.
The probability of o
On Fri, Jun 12, 2015, at 18:09, Thomas 'PointedEars' Lahn wrote:
> Do you deny that “123456789” *is* “a sequence containing all nine
> numbers”
Do you deny that "123456798" *is* "a sequence containing all nine
numbers"?
Does this mean that "123456789" *is* "123456798" by the transitive
property?
On Fri, Jun 12, 2015, at 17:32, Thomas 'PointedEars' Lahn wrote:
> Ian Kelly wrote:
>
> > The probability of 123456789 and 1 are equal. The probability
> > of a sequence containing all nine numbers and a sequence containing
> > only 1s are *not* equal.
>
> There is a contradiction in that
For completeness I will note that Windows is completely different. The
plain exit status (1 for typical command failures) appears in the
os.system result rather than a wait-encoded value. And, incidentally, an
MSVC program which calls abort() will return an exit status of 3. A
process that terminat
On Fri, Jun 12, 2015, at 09:54, Ian Kelly wrote:
> Exit code 0 traditionally means success. The exit status is two bytes,
> with
> the low-order byte normally containing the exit code and the high-order
> byte containing the signal that caused the program to exit.
That's backwards. The signal (or
On Thu, Jun 11, 2015, at 14:54, random...@fastmail.us wrote:
> On Thu, Jun 11, 2015, at 14:32, Sebastian M Cheung via Python-list
> wrote:
> > How to pretty mathematical formulas in Python? Similar to Mathematica
> > formats.
> >
> > Are there good packages to prettify mathematica formulas in Pyth
On Thu, Jun 11, 2015, at 14:32, Sebastian M Cheung via Python-list
wrote:
> How to pretty mathematical formulas in Python? Similar to Mathematica
> formats.
>
> Are there good packages to prettify mathematica formulas in Python?
>From a google search, apparently matplotlib has a module called mat
On Wed, Jun 10, 2015, at 23:05, Chris Angelico wrote:
> http://youtu.be/CEpcUeWP0bg
> http://youtu.be/WFZAaHrHens
An example of the actual subtitle text would be more useful than a
youtube link to the video, since we're unlikely to be able to see what
context the character appears in if our client
On Wed, Jun 10, 2015, at 20:09, Chris Angelico wrote:
> And U+FEFF "ZERO WIDTH NO-BREAK SPACE", notable because it's also used as
> the byte-order mark (as its counterpart, U+FFFE, is unallocated). I've
> been
> fighting with VLC Media Player over the font it uses for subtitles; for
> some bizarre
On Wed, Jun 10, 2015, at 19:30, Gregory Ewing wrote:
> If whitelisting a type is the *only* thing you need to
> do to make it serialisable, I think that comes close
> enough to the stated goal of being able to "serialise
> all [potentially serialisable] language objects".
IMO the serialization fra
On Wed, Jun 10, 2015, at 13:03, Thomas 'PointedEars' Lahn wrote:
> This is _not_ a lottery box; you put the ball with the number on it *back
> into the box* after you have drawn it and before you draw a new one.
Yes, but getting a 2, putting it back, and getting a 1 is just as good
as getting a 1
On Wed, Jun 10, 2015, at 11:03, Laura Creighton wrote:
> In these unicode days, this thinking may need to be revisited. There
> are many languages where whitespace does not separate words -- either
> words aren't separated, or in Vietnamese, spaces separate syllables,
> so entire words have spaces
On Wed, Jun 10, 2015, at 08:08, Marko Rauhamaa wrote:
> You can't serialize/migrate arbitrary objects. Consider open TCP
> connections, open files and other objects that extend outside the Python
> VM. Also objects hold references to each other, leading to a huge
> reference mesh.
>
> For example:
On Tue, Jun 9, 2015, at 23:52, Steven D'Aprano wrote:
> > For human readable serialized data, text format protocol buffers are
> > seriously underrated. (Relatedly: underdocumented, too.)
>
> Ironically, literal_eval is designed to process text-format protocols
> using
> human-readable Python syn
On Tue, Jun 9, 2015, at 08:15, Skip Montanaro wrote:
> Skip> Why don't floats support "{:.Ns}"? (I know I can use "{!s}".)
>
> random832> Why would they? The old style didn't support %.Ns either.
>
> Well, the old style does, though it appears t
On Mon, Jun 8, 2015, at 16:32, Skip Montanaro wrote:
> This is counterintuitive:
>
> >>> "{:.3}".format(-0.00666762259822)
> '-0.00667'
> >>> "{:.3f}".format(-0.00666762259822)
> '-0.007'
> >>> "%.3f" % -0.00666762259822
> '-0.007'
> >>> "{:.3s}".format(-0.00666762259822)
> ValueError Unknown form
On Sun, Jun 7, 2015, at 21:42, Chris Angelico wrote:
> On Mon, Jun 8, 2015 at 11:34 AM, wrote:
> > In general, as the number of trials increases, the probability of having
> > e.g. at least one of each value never _reaches_ 1, but it gets
> > arbitrarily close.
>
> And by "arbitrarily close", yo
On Sun, Jun 7, 2015, at 16:56, Thomas 'PointedEars' Lahn wrote:
> random...@fastmail.us wrote:
>
> > On Sun, Jun 7, 2015, at 16:09, Thomas 'PointedEars' Lahn wrote:
> >> No. AISB, those sequences all have the same probability:
> >
> > Yes and the probability of getting _any_ of the sequences, is
On Sun, Jun 7, 2015, at 16:09, Thomas 'PointedEars' Lahn wrote:
> No. AISB, those sequences all have the same probability:
Yes and the probability of getting _any_ of the sequences, is the sum of
the probabilities for each one of the sequences individually.
--
https://mail.python.org/mailman/l
On Sun, Jun 7, 2015, at 15:29, Thomas 'PointedEars' Lahn wrote:
> Jussi Piitulainen wrote:
>
> > Thomas 'PointedEars' Lahn writes:
> >> 8 3 6 3 1 2 6 8 2 1 6.
> >
> > There are more than four hundred thousand ways to get those numbers in
> > some order.
> >
> > (11! / 2! / 2! / 2! / 3! / 2! =
On Sun, Jun 7, 2015, at 07:42, Steven D'Aprano wrote:
> The question of graphemes (what "ordinary people" consider letters and
> characters, e.g. "ch" is two letters to an English speaker but one letter
> to a Czech speaker) should be left to libraries.
Do Czech speakers expect to be able to selec
On Sun, Jun 7, 2015, at 05:06, Luca Menegotto wrote:
> Il 07/06/2015 10:22, Cecil Westerhof ha scritto:
> > That only times the function. I explicitly mentioned I want both the
> > needed time AND the output.
> >
> > Sadly the quality of the answers on this list is going down
>
> First of
On Fri, Jun 5, 2015, at 23:20, Rustom Mody wrote:
> The word immutuable happens to have existed in English before python.
> I also happen to have used it before I knew of python
> The two meanings do not match
> I am surprised
> Is that surprising?
They don't match only if you consider the objects
On Thu, Jun 4, 2015, at 22:37, Steven D'Aprano wrote:
> That's not a reference to the value. That's a string that describes the
> object.
Well, of course. None of these things are strings.
The normal human-readable representation of a reference is an arrow on a
diagram, pointing from a box that
On Thu, Jun 4, 2015, at 18:16, Steven D'Aprano wrote:
> Remember, you've tried to claim that it is not invisible or unknown, so
> you
> must be able to see and know that value. So what is the value?
It doesn't have to have a string representation to exist. But if you
really want one?
>>> object._
On Tue, Jun 2, 2015, at 12:13, Cecil Westerhof wrote:
> I am thinking about using ipython3 instead of bash. When I want to
> find a file I can do the following:
> !find ~ -iname '*python*.pdf'
> but is there a python way?
Python really isn't a good substitute for a shell, but the normal python
On Thu, Jun 4, 2015, at 13:36, Michael Torrie wrote:
> Surely two objects can hold the same value, or represent the same value
> (number), without *having* to be the same object. I don't see why
> people would assume, let alone demand that different objects
> representing the same value be the sam
On Thu, Jun 4, 2015, at 13:11, Steven D'Aprano wrote:
> You need at least one more test to prove pass by value: you need to
> demonstrate that the value bound to y is copied when passed to the
> function. E.g. pass a mutable value (say, a list) and mutate it inside
> the
> function. If the list in
On Thu, Jun 4, 2015, at 09:47, Steven D'Aprano wrote:
> In other words, according to this Java philosophy, following `x = 23`,
> the
> value of x is not 23 like any sane person would expect, but some
> invisible
> and unknown, and unknowable, reference to 23.
Well, no, because, in Java, if the typ
On Wed, Jun 3, 2015, at 17:56, Mark Lawrence wrote:
> Now does Python pass by value or by reference? Happily sits back and
> waits for 10**6 emails to arrive as this is discussed for the 10**6th
> time.
Python's in that same awkward space as Java, where it technically passes
by value, but the va
On Wed, Jun 3, 2015, at 10:43, Marko Rauhamaa wrote:
> However, the child process needs to be prepared for os.close() to block
> indefinitely because of an NFS problem or because SO_LINGER has been
> specified by the parent, for example. Setting the close-on-exec flag
> doesn't help there.
Out of
On Wed, Jun 3, 2015, at 09:32, Chris Angelico wrote:
> Write an editor that opens a file and holds it open until the user's
> done with it. Have something that lets you shell out for whatever
> reason. Then trigger the shell-out, and instantly SIGSTOP the child
> process, before it does its work -
On Wed, Jun 3, 2015, at 09:08, Marko Rauhamaa wrote:
> random...@fastmail.us:
>
> > Why does the child process need to report the error at all? The parent
> > process will find out naturally when *it* tries to close the same file
> > descriptor.
>
> That's not how it goes.
>
> File descriptors a
On Wed, Jun 3, 2015, at 08:25, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
> > How does the child process know what action didn't complete? What
> > error message are you going to display to the user?
>
> You definitely must not use sys.stderr from the child process nor are
> you allowed to exit
On Wed, Jun 3, 2015, at 03:11, Alain Ketterlin wrote:
> Thank you, I know this. What I mean is: what are the reasons that you
> cannot access your file descriptors one by one? To me closing a range of
> descriptors has absolutely no meaning, simply because ranges have no
> meaning for file descript
On Tue, Jun 2, 2015, at 13:59, BartC wrote:
> On 02/06/2015 18:00, Steven D'Aprano wrote:
> > Again, this is not relevant. Javascript is dynamically typed, but some
> > values are machine primitives and other values are objects. The interpreter
> > keeps track of this at runtime.
>
> Javascript
On Tue, Jun 2, 2015, at 00:18, fl wrote:
> Hi,
>
> I just know that '_' is the last result in the Python interpreter. I feel that
> it is like 'ans' in Matlab. When I run the following commands. The result of
> '_' are always '4'.
>
>
> Because I have tried several commands, such as reversed('fr
On Mon, Jun 1, 2015, at 21:15, TheDoctor wrote:
> In Python 2.7 type(type) is type (not object), but isinstance(type,
> object) is true -- so it is ambiguous, even contradictory, in the
> language.
isinstance(type, object) is true because object is the parent class of
type. issubclass(type, object
On Mon, Jun 1, 2015, at 20:24, TheDoctor wrote:
> A type is not an object in the same way an instantiated type is an object
> -- anymore than a blueprint for a building is the building itself.
What is an object?
It's something you can call str or repr on. It's something you can
lookup attributes
On Mon, Jun 1, 2015, at 09:18, Marko Rauhamaa wrote:
> if elements:
> for element in elements:
> ...
>
>instead of:
>
> for elements in elements:
TypeError: 'NoneType' object is not iterable
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, May 31, 2015, at 10:34, Eddilbert Macharia wrote:
> Hello All ,
>
> I'm wrecking my head trying to understand. where the class object comes
> into play .
>
> Is it only meant to act as base class and does it mean there is an actual
> class called object in python which all the objects cr
On Fri, May 29, 2015, at 13:08, Chris Angelico wrote:
> Also, I like talking about Fraction and
> Decimal for the simple reason that they're unobvious; you can poke
> around with Python and discover int and float, and if ever you need
> imaginary/complex numbers, you'll quickly come across complex,
On Fri, May 29, 2015, at 12:11, Ned Deily wrote:
> As others
> have noted, running third-party apps like CleanMyMac is probably not a
> good idea, but, even if it is as crappy as its sounds, I would think it
> unlikely that it would be fooling with the Apple-supplied system Python
> in /System/
501 - 600 of 757 matches
Mail list logo