On Thu, Aug 22, 2013, at 18:22, Dennis Lee Bieber wrote:
> Well... The main thing to understand is that this particular "forum" is
> NOT JUST a mailing-list. It is cross-linked with the Usenet
> comp.lang.python news-group (and that, unfortunately, is cross-linked to
> Google-Groups). And to
On Fri, Aug 23, 2013, at 7:14, Peter Otten wrote:
> The following works on my linux system:
>
> instream = iter(p.stdout.readline, "")
>
> for line in instream:
> print line.rstrip()
>
> I don't have Windows available to test, but if it works there, too, the
> problem is the interna
On Sat, Aug 24, 2013, at 2:45, David M. Cotter wrote:
> > you need to use u" ... " delimiters for Unicode, otherwise the results you
> > get are completely arbitrary and depend on the encoding of your terminal.
> okay, well, i'm on a mac, and not using "terminal" at all. but if i
> were, it woul
On Sat, Aug 24, 2013, at 12:47, David M. Cotter wrote:
> > What _are_ you using?
> i have scripts in a file, that i am invoking into my embedded python
> within a C++ program. there is no terminal involved. the "print"
> statement has been redirected (via sys.stdout) to my custom print class,
>
On Mon, Aug 26, 2013, at 11:03, Guy Tamir wrote:
> Thanks for reply,
> In what cases will i have this header?
In practice, you'll usually have it, except in cases where the user has
bookmarked your site, typed/pasted the URL directly, had it opened by an
external program, or taken action to block
On Mon, Aug 26, 2013, at 15:37, Marco Buttu wrote:
> Since StopIteration is not an error, how come does it inherit directly
> from Exception and not from BaseException?
The reason KeyboardInterrupt and SystemExit inherit from BaseException
is because you often want them to escape (allowing the pr
On Wed, Aug 28, 2013, at 11:15, Neal Becker wrote:
> The change in integer division seems to be the most insidious source of
> silent
> errors in porting code from python2 - since it changes the behaviour or
> valid
> code silently.
>
> I wish the interpreter had an instrumented mode to detect a
On Wed, Aug 28, 2013, at 12:44, John Levine wrote:
> I have a crufty old DNS provisioning system that I'm rewriting and I
> hope improving in python. (It's based on tinydns if you know what
> that is.)
>
> The record formats are, in the worst case, like this:
>
> foo.[DOM]::[IP6::4361:6368:6574]
indows machine on remote
> windows machine ?
The taskkill command actually has an option for this: /S. I don't know
what mechanism it uses or what you would have to do to give yourself
permission to use it.
--
Random832
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Sep 3, 2013, at 9:54, Venkatesh wrote:
> Hello comp.lang.python Group,
>
> I am trying to invoke a subprocess in Python as below
>
> import sys
> import time
> import os
> import subprocess
> DETACHED_PROCESS = 0x0008
>
> path = r'C:\Windows\System32\cmd.exe /k ping www.google.com
On Tue, Sep 3, 2013, at 6:31, Tim Chase wrote:
> I'd contend that the two primary purposes of raw strings (this is
> starting to sound like a Spanish Inquisition sketch) are regexes and
> DOS/Win32 file path literals. And I hit this trailing-backslash case
> all the time, as Vim's path-completion
On Wed, Sep 4, 2013, at 12:49, Ferrous Cranus wrote:
> Without closing it, the client can download
> again and forever if they choose to because
> the cgi window is open and the link is still
> active.
Why is this a problem? They usually won't want to, and if they do want
to (for example if th
On Thu, Sep 5, 2013, at 23:33, Tim Roberts wrote:
> random...@fastmail.us wrote:
> >
> >Of course, in 99% of situations where you can use a windows pathname in
> >Python, you are free to use it with a forward slash instead of a
> >backslash.
>
> This is actually worth repeating, because it's not w
On Fri, Sep 6, 2013, at 11:46, Piet van Oostrum wrote:
> The FSR does not split unicode in chuncks. It does not create problems
> and therefore it doesn't have to solve this.
>
> The FSR simply stores a Unicode string as an array[*] of ints (the
> Unicode code points of the characters of the stri
On Fri, Sep 6, 2013, at 13:04, Chris Angelico wrote:
> On Sat, Sep 7, 2013 at 2:59 AM, wrote:
> > Incidentally, how does all this interact with ctypes unicode_buffers,
> > which slice as strings and must be UTF-16 on windows? This was fine
> > pre-FSR when unicode objects were UTF-16, but I'm not
On Mon, Sep 9, 2013, at 15:03, Ian Kelly wrote:
> Do you mean that it breaks when overwriting Python string object buffers,
> or when overwriting arbitrary C strings either received from C code or
> created with create_unicode_buffer?
>
> If the former, I think that is to be expected since ctypes
On Mon, Sep 9, 2013, at 16:10, Mohsen Pahlevanzadeh wrote:
> My question is , do you have reverse of this function? persianToInteger?
The int constructor is able to handle different forms of decimal
numerals directly:
>>> int('\u06f3\u06f4\u06f5\u06f5')
3455
--
https://mail.python.org/mailman/li
On Tue, Sep 10, 2013, at 3:01, Steven D'Aprano wrote:
> def integerToPersian(number):
> """Convert positive integers to Persian.
>
> >>> integerToPersian(3455)
> '۳۴۵۵'
>
> Does not support negative numbers.
> """
> digit_map = dict(zip('0123456789', '۰۱۲۳۴۵۶۷۸۹'))
> d
On Mon, Sep 9, 2013, at 10:28, wxjmfa...@gmail.com wrote:
*time performance differences*
>
> Comment: Such differences never happen with utf.
Why is this bad? Keeping in mind that otherwise they would all be almost
as slow as the UCS-4 case.
> >>> sys.getsizeof('a')
> 26
> >>> sys.getsizeof('€')
On Fri, Sep 13, 2013, at 10:38, stephen.bou...@gmail.com wrote:
> > Hm, that gives me a "Type str doesn't support the buffer API" message.
>
> Aha, I need to use str(s, encoding='utf8').rstrip('\0').
It's not a solution to your problem, but why aren't you using
CF_UNICODETEXT, particularly if you
On Mon, Sep 16, 2013, at 9:15, Michael Schwarz wrote:
> According to the documentation of time.gmtime(), it returns a struct_time
> in UTC, but %z is replaced by +0100, which is the UTC offset of my OS’s
> time zone without DST, but DST is currently in effect here (but was not
> at the timestamp pa
On Mon, Sep 16, 2013, at 16:55, Michael Schwarz wrote:
> On 2013-W38-1, at 19:56, random...@fastmail.us wrote:
>
> > On Mon, Sep 16, 2013, at 9:15, Michael Schwarz wrote:
> >> According to the documentation of time.gmtime(), it returns a struct_time
> >> in UTC, but %z is replaced by +0100, which
On Fri, Sep 13, 2013, at 12:09, random...@fastmail.us wrote:
> Anyway, to match behavior found in other applications when pasting from
> the clipboard, I would suggest using:
>
> if s.contains('\0'): s = s[:s.index('\0')]
>
> Which will also remove non-null bytes after the first null (but if the
On Wed, Sep 18, 2013, at 16:13, Dave Angel wrote:
> So is the bug in Excel, in Windows, or in the Python library? Somebody
> is falling down on the job; if Windows defines the string as ending at
> the first null, then the Python interface should use that when defining
> the text defined with CF_
Registration appears to succeed, but does not allow login, and I can't
tell if email confirmation worked or not. I was able to register by
changing it to lowercase, but I had to guess what was happening.
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Sep 30, 2013, at 17:28, Ned Batchelder wrote:
> On 9/30/13 3:34 PM, Dave Angel wrote:
> > Python doesn't actually have variables, but the things it documents as
> > variables are local names within a method. Those are not visible
> > outside of the method, regardless of whether you're in a
On Tue, Oct 1, 2013, at 13:53, kjaku...@gmail.com wrote:
> I ended up with these. I know they're only like half right...
> I was wondering if any of you had to do this, what would you end up with?
>
> # Question 1.a
> def temp(T, from_unit, to_unit):
Assuming this is temperature conversion. You s
On Tue, Oct 1, 2013, at 17:30, Terry Reedy wrote:
> Part of the reason that Python does not do tail call optimization is
> that turning tail recursion into while iteration is almost trivial, once
> you know the secret of the two easy steps. Here it is.
That should be a reason it _does_ do it - s
On Wed, Oct 2, 2013, at 9:32, Steven D'Aprano wrote:
> Python is not as aggressively functional as (say) Haskell, but it is
> surely an exaggeration to suggest that the failure to include tail call
> optimization means that Python "rejects" functional programming styles.
> You can still write yo
On Wed, Oct 2, 2013, at 17:33, Terry Reedy wrote:
> 5. Conversion of apparent recursion to iteration assumes that the
> function really is intended to be recursive. This assumption is the
> basis for replacing the recursive call with assignment and an implied
> internal goto. The programmer can
On Wed, Oct 2, 2013, at 21:46, MRAB wrote:
> > The difference is that a tuple can be reused, so it makes sense for the
> > comiler to produce it as a const. (Much like the interning of small
> > integers) The list, however, would always have to be copied from the
> > compile-time object. So that
On Wed, Oct 2, 2013, at 22:34, Steven D'Aprano wrote:
> You are both assuming that LOAD_CONST will re-use the same tuple
> (1, 2, 3) in multiple places. But that's not the case, as a simple test
> will show you:
>>> def f():
... return (1, 2, 3)
>>> f() is f()
True
It does, in fact, re-use it
On Mon, Oct 7, 2013, at 13:15, Alain Ketterlin wrote:
> That's fine. My point was: you can't at the same time have full
> dynamicity *and* procedural optimizations (like tail call opt).
> Everybody should be clear about the trade-off.
Let's be clear about what optimizations we are talking about. T
On Sat, Oct 5, 2013, at 3:39, Antoon Pardon wrote:
> What does this mean?
>
> Does it mean that a naive implementation would arbitrarily mess up
> stack traces and he wasn't interested in investigating more
> sophisticated implementations?
>
> Does it mean he just didn't like the idea a stack tra
On Tue, Oct 8, 2013, at 10:28, kjaku...@gmail.com wrote:
> I have to define a function add(c1, c2), where c1 and c2 are capital
> letters; the return value should be the sum (obtained by converting the
> letters to numbers, adding mod 26, then converting back to a capital
> letter).
>
> All I hav
On Tue, Oct 8, 2013, at 2:45, sprucebond...@gmail.com wrote:
> On Monday, October 7, 2013 8:17:21 PM UTC-10, Chris Angelico wrote:
> > print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n"),4))
> > # 87
>
> import random as r
> print(*r.sample(open("/usr/share/dict/wo
On Tue, Oct 8, 2013, at 11:44, kjaku...@gmail.com wrote:
> def add(c1, c2):
> ans = ''
This only makes sense if your answer is going to be multiple characters.
> for i in c1 + c2:
This line concatenates the strings together.
> ans += chrord(i)-65))%26) + 65)
The way you are
On Tue, Oct 8, 2013, at 18:27, Rob Day wrote:
> On 08/10/13 07:17, Chris Angelico wrote:
> > Who's up for some fun? Implement an XKCD-936-compliant password
> > generator in Python 3, in less code than this:
> >
> > print(*__import__("random").sample(open("/usr/share/dict/words").read().split("\n")
On Wed, Oct 16, 2013, at 23:13, Owen Jacobson wrote:
> > * therapist - yeah, It passes as a double meaning - but still.
Or a single meaning. Who's to say the person who wrote the module even
had any idea it could be read otherwise?
> > * shag
Something to do with carpet?
> > * db_nazi
See belo
On Mon, Oct 21, 2013, at 16:47, Terry Reedy wrote:
> Manual says "-c
> Execute the Python code in command. command can be one or more
> statements separated by newlines, with significant leading whitespace as
> in normal module code."
>
> In Windows Command Prompt I get:
> C:\Programs\Pyth
On Wed, Oct 23, 2013, at 16:52, Chris Angelico wrote:
> There are times when this is correct behaviour - like asking for
> passwords (SSH and sudo work like this).
Less (or pagers generally, or an interactive text editor that allows
creating a file from standard input) would be another example of
On Mon, Oct 28, 2013, at 8:00, Johannes Bauer wrote:
> Hi group,
>
> in http://docs.python.org/3/reference/datamodel.html#customization the
> doc reads:
>
> > There are no swapped-argument versions of these methods (to be used when
> > the left argument does not support the operation but the r
On Thu, Oct 31, 2013, at 21:12, Nobody wrote:
> On Thu, 31 Oct 2013 12:16:23 -0400, Roy Smith wrote:
>
> > I want to do getpeername() on stdin. I know I can do this by wrapping a
> > socket object around stdin, with
> >
> > s = socket.fromfd(sys.stdin.fileno(), family, type)
> >
> > but that re
On Mon, Nov 4, 2013, at 11:07, Chris Angelico wrote:
> Then os.path.join is probably the wrong tool for the job. Do you want
> to collapse "/foo/bar" + "../quux" into "/foo/quux"? That rewrites the
> first. If not, don't use a function that does that. Try simple string
> concatenation instead.
>>>
> A built-in function 'isimmutable()' shall tell efficiently whether the
> object
> of concern is mutable or not.
What's the benefit over attempting to hash() the object?
copy.deepcopy already has special case for int, string, and tuples
(including tuples that do and do not have mutable members)
On Wed, Mar 4, 2015, at 07:12, Albert-Jan Roskam wrote:
> Hi,
>
> Is there a (use case) difference between codecs.open and io.open? What is
> the difference?
> A small difference that I just discovered is that
> codecs.open(somefile).read() returns a bytestring if no encoding is
> specified*), but
On Thu, Mar 5, 2015, at 09:06, Steven D'Aprano wrote:
> I mostly agree with Chris. Supporting *just* the BMP is non-trivial in
> UTF-8
> and UTF-32, since that goes against the grain of the system. You would
> have
> to program in artificial restrictions that otherwise don't exist.
UTF-8 is alread
It's been brought up on Stack Overflow that the "in" operator (on
tuples, and by my testing on dict and list, as well as dict lookup) uses
object identity as a shortcut, and returns true immediately if the
object being tested *is* an element of the container. However, the
contains operation does no
On Thu, Mar 5, 2015, at 22:49, Chris Angelico wrote:
> I'm not sure it's just an optimization. Compare this post from
> python-dev, where Nick Coghlan discusses the same topic:
>
> https://mail.python.org/pipermail/python-dev/2014-July/135476.html
If it is a bug for NaN to "infect" containers' be
On Fri, Mar 6, 2015, at 04:06, Rustom Mody wrote:
> Also:
> Can a programmer who is away from UTF-16 in one part of the system (say
> by using python3)
> assume he is safe all over?
The most common failure of UTF-16 support, supposedly, is in programs
misusing the number of code units (for length
On Fri, Mar 6, 2015, at 08:39, Chris Angelico wrote:
> Number of code points is the most logical way to length-limit
> something. If you want to allow users to set their display names but
> not to make arbitrarily long ones, limiting them to X code points is
> the safest way (and preferably do an N
On Fri, Mar 6, 2015, at 09:11, Chris Angelico wrote:
> To prevent people from putting three paragraphs of lipsum in and
> calling it a username.
Limiting by UTF-8 bytes or UTF-16 units works just as well for that.
> So you truncate to the desired length, then if the first character of
> the trimm
On Sun, Mar 8, 2015, at 22:09, Ben Finney wrote:
> Steven D'Aprano writes:
>
> > '\udd00' should be a SyntaxError.
>
> I find your argument convincing, that attempting to construct a Unicode
> string of a lone surrogate should be an error.
>
> Shouldn't the error type be a ValueError, though? T
On Tue, Mar 10, 2015, at 00:01, Paulo da Silva wrote:
> For .pnm photo files I read the entire file (I needed it in memory
> anyway), splited a copy separated by b'\n', got the headers stuff and
> then used the original remaining bytes as the photo pixels.
> But this is very tricky! I am on linux,
On Sat, Mar 14, 2015, at 18:09, Cameron Simpson wrote:
> >So there's still something amiss.
>
> Am I missing something obvious here? int() likes only ints, not floats:
What you're missing is that when directly examined in pdb, the value
appeared to be '4', but then when passed to the int construc
On Tue, Mar 24, 2015, at 18:24, Dan Stromberg wrote:
> Is there a way of "adding" 4 hours and getting a jump of 5 hours on
> March 8th, 2015 (due to Daylight Savings Time), without hardcoding
> when to spring forward and when to fall back? I'd love it if there's
> some library that'll do this for
, "credits" or "license" for more information.
> >>> def foo(**kwargs):
> ... return { (k, kwargs[k]) for k in kwargs }
> ...
> >>> foo()
> set()
> >>> foo(a=1)
> {('a', 1)}
> >>>
>
> ~Andrew
> --
> https://mail.python.org/mailman/listinfo/python-list
--
Random832
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, May 4, 2015, at 18:02, BartC wrote:
> (I think I would have picked up "++" and "--" as special tokens even if
> increment/decrement ops weren't supported. Just because they would
> likely cause errors through misunderstanding.)
There's precedent for not doing this in C itself - even thou
On Fri, May 8, 2015, at 15:00, zljubisic...@gmail.com wrote:
> As I saw, I could solve the problem by changing line 4 to (small letter
> "r" before string:
> ROOTDIR = r'C:\Users\zoran'
>
> but that is not an option for me because I am using configparser in order
> to read the ROOTDIR from underly
On Fri, May 15, 2015, at 00:25, Chris Angelico wrote:
> The main thing is that trashing invites the system to delete the file
> at its leisure,
I've never seen a system whose trash can emptied itself without user
intervention.
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, May 23, 2015, at 21:53, Dr. John Q. Hacker wrote:
> What should happen when there's a name collision on method names between
> mix-ins? Since they're mix-ins, it's not presumed that there is any
> parent
> class to decide. The proper thing would seem to call each method in the
> order th
On Mon, May 25, 2015, at 15:21, ravas wrote:
> Is this valid? Does it apply to python?
> Any other thoughts? :D
The math.hypot function uses the C library's function which should deal
with such concerns internally. There is a fallback version in case the C
library does not have this function, in P
On Tue, May 26, 2015, at 09:40, random...@fastmail.us wrote:
> On Mon, May 25, 2015, at 15:21, ravas wrote:
> > Is this valid? Does it apply to python?
> > Any other thoughts? :D
>
> The math.hypot function uses the C library's function which should deal
> with such concerns internally. There is a
On Tue, May 26, 2015, at 12:57, Laura Creighton wrote:
> Guido did. :)
> http://neopythonic.blogspot.se/2008/10/why-explicit-self-has-to-stay.html
It's worth noting that the "dynamically modify a class" argument (and to
some extent the decorator argument) misses Javascript's solution - _any_
func
On Wed, May 27, 2015, at 07:15, anatoly techtonik wrote:
> The solution is to have filter preprocess the binary string to escape all
> non-unicode symbols so that the following lossless transformation
> becomes possible:
>
>binary -> escaped utf-8 string -> unicode -> binary
>
> I want to kno
On Wed, May 27, 2015, at 07:47, anatoly techtonik wrote:
> because Python 3 doesn't have non-unicode StringIO
That's actually not true - the non-unicode equivalent is BytesIO.
However, it's probably not actually what you want, if the point is to
display the filenames to the user.
--
https://mail.
On Wed, May 27, 2015, at 18:23, Karthik Sharma wrote:
> The JSON structure is valid as shown by http://jsonlint.com/
>I want to be able to access the different fields inside `data` such as
>`severity`, `subject` and also fields inside `tdetails` such as `CPUs`
>and `Product`. How do I d
On Wed, May 27, 2015, at 19:51, Karthik Sharma wrote:
> I get the following error.
>
> Traceback (most recent call last):
> File "test_json.py", line 23, in
> print('message {} \n\n'.format(message['Message']))
> TypeError: list indices must be integers, not str
> karthik.sharma@aukksharm
On Thu, May 28, 2015, at 17:50, Skybuck Flying wrote:
> Surpisingly enough I don't think there is a casual/common operator for
> this
> thruth table.
>
> AND does not apply.
> OR does not apply.
> XOR does not apply.
All sixteen possible logical operators have formal names. This one is
called "B
On Thu, May 28, 2015, at 23:49, Skybuck Flying wrote:
> Ok thanks for this information.
>
> I was just wondering how many thruth table combinations there can be for
> a
> typical thruth table with 2 inputs and 1 output.
>
> Since there are 2 inputs, this means 4 possible outputs, which means 2 t
On Thu, May 28, 2015, at 23:48, Chris Angelico wrote:
> On Fri, May 29, 2015 at 1:20 PM, wrote:
> > The possibility of spelling these with the comparison operators, as some
> > have suggested, is a consequence of Python's implementation where True
> > == 1 and False == 0. In other languages bool
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/
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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
501 - 600 of 757 matches
Mail list logo