I haven't read over every message in the thread, so sorry if this has
been suggested before, but how about "if not break:" and "if not
except:" as synonyms for the current 'else' clause? They're already
keywords, and this sequence of keywords has no current meaning.
--
https://mail.python.org/mail
On Mon, Dec 4, 2017, at 13:54, Jason Maldonis wrote:
> Is there any background on why that doesn't raise an IndexError? Knowing
> that might help me design my extended list class better. For my specific
> use case, it would simplify my code (and prevent `if isinstance(item,
> slice)` checks) if the
On Wed, Dec 6, 2017, at 11:18, Steve D'Aprano wrote:
> You suggested that if he wasn't familiar with free software, his
> request that people send him a copy of Python wouldn't look so odd.
> Okay, if Python weren't free software, it would be non-free software,
> and you are saying that it wouldn't
On Mon, Dec 4, 2017, at 13:54, Jason Maldonis wrote:
> Is there any background on why that doesn't raise an IndexError? Knowing
> that might help me design my extended list class better. For my specific
> use case, it would simplify my code (and prevent `if isinstance(item,
> slice)` checks) if the
On Sun, Dec 17, 2017, at 10:46, Chris Angelico wrote:
> But if you're trying to *validate* an email address - for instance, if
> you receive a form submission and want to know if there was an email
> address included - then my recommendation is simply DON'T. You can't
> get all the edge cases right
On Mon, Dec 18, 2017, at 16:25, Tim Chase wrote:
> My understanding was that "in" makes use of an available __contains__
> but something seems to preventing Python from finding that.
>
> What's going on here?
Most __ methods have to be an actual method on the class object, which
means you have to
On Mon, Dec 18, 2017, at 02:01, Chris Angelico wrote:
> Hmm, is that true? I was under the impression that the quoting rules
> were impossible to match with a regex. Or maybe it's just that they're
> impossible to match with a *standard* regex, but the extended
> implementations (including Python'
On Sat, Dec 30, 2017, at 23:57, jf...@ms4.hinet.net wrote:
> I have a multiline string, something like '''...\nf.write('\n')\n...'''
> when pass to exec(), I got
> SyntaxError: EOL while scanning string literal
>
> How to get rid of it?
Use \\n for this case, since you want the \n to be interpret
On Tue, Jan 2, 2018, at 10:36, Robin Becker wrote:
> >> u'\u200e28\u200e/\u200e09\u200e/\u200e1962'
>
> I guess I'm really wondering whether the BIDI control characters have any
> semantic meaning. Most numbers seem to be LTR.
>
> If I saw u'\u200f12' it seems to imply that the characters should
On Sun, Jan 7, 2018, at 17:27, Gene Heskett wrote:
> >
> > đ đ»
> >
> But here its broken and I am looking at two pairs of vertical boxes
> because it is not properly mime'd. If you use chars or gliphs from a
> non-default charset, it needs to demarcated with a mime-boundary marker
> followed by
On Sun, Jan 7, 2018, at 17:47, Richard Damon wrote:
> But it also says:
>
> Content-Transfer-Encoding: 7bit
>
> Which is incorrect, as the message is actually 8bit encoded (since the
> Emoji aren't in the first 127 characters, so their UTF-8 encoding isn't
> 7-bit. Some software might have mes
On Sun, Jan 7, 2018, at 18:50, Gene Heskett wrote:
> That, now that you mention it, could also effect this as I see it, my
> default kmail message body font is hack 14 in deference to the age of my
> eyes.
>
> My system default font is I believe utf-8. That is not a kmail settable
> option. But
On Mon, Jan 15, 2018, at 09:35, Peter Otten wrote:
> Peng Yu wrote:
>
> > Can utf-8 encoded character contain a byte of TAB?
>
> Yes; ascii is a subset of utf8.
>
> If you want to allow fields containing TABs in a file where TAB is also the
> field separator you need a convention to escape the
On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote:
> Hello!
>
> I am using ctypes on Windows to interface with a dll and it works fine
> on Linux and windows 32-bit python. But, when using 64-bit python, we got
> error "exception: access violation writing 0x99222A60".
Y
On Tue, Apr 19, 2022, at 07:11, Loris Bennett wrote:
> I now realise that timedelta is not really what I need. I am interested
> solely in pure periods, i.e. numbers of seconds, that I can convert back
> and forth from a format such as
A timedelta *is* a pure period. A timedelta of one day is 864
On Sat, Apr 16, 2022, at 13:35, Peter J. Holzer wrote:
> When adding a timedeltacal object to a datetime, the fields are added
> from most to least significant: First a new date is computed by
> advancing the number of months specified [TODO: Research how other
> systems handle overflow (e.g. 2022-
On Fri, Jan 15, 2021, at 13:36, Alan Gauld via Python-list wrote:
> That could make a big difference, the putp() function specifically
> states that it writes to stdout.
I think there is a reasonable argument that this is a deficiency of the curses
module.
I think that the curses module should A
On Wed, Jan 20, 2021, at 14:54, panfei wrote:
> 3. Compile Python 3.9.1
> C_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/
> CPLUS_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/
> LD_RUN_PATH=/home/felix/.local/sqlite/default/lib ./configure
> --prefix=/home/felix/.
On Wed, Jan 20, 2021, at 16:45, Random832 wrote:
> On Wed, Jan 20, 2021, at 14:54, panfei wrote:
> > 3. Compile Python 3.9.1
> > C_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/
> > CPLUS_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/
> &
On Sat, Jan 30, 2021, at 11:50, Bischoop wrote:
>
> Got problem with responding for Ping, tried so many ways to response
> and always end up with time out or other error. This time:
1. It looks like you're forgetting to send \n\r
2. i'm not sure if the server ping is guaranteed to have : characte
On Sat, Feb 20, 2021, at 15:00, dn via Python-list wrote:
> So, the output is not a set (as you say) but nor (as
> apparently-indicated by the square-brackets) is it actually a list!
To be clear, it is an instance of collections.abc.Set, and supports most binary
operators that sets support.
I wa
On Wed, Feb 24, 2021, at 02:59, Marco Sulla wrote:
> On Wed, 24 Feb 2021 at 06:29, Random832 wrote:
> > I was surprised, though, to find that you can't remove items directly from
> > the key set, or in general update it in place with &= or -= (these
> > operators w
On Tue, Aug 9, 2016, at 16:51, Juan Pablo Romero MĂ©ndez wrote:
> So as the writer of the function you expect the user to read the function
> body to determine what is safe to pass or not?
How about expecting them to read the docstring?
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Aug 10, 2016, at 06:34, eryk sun wrote:
> On Wed, Aug 10, 2016 at 4:46 AM, wrote:
> >
> > i have installed python 3.5 , but the python command is not recognized
> >
> > C:\Users\sharmaaj>python
> > 'python' is not recognized as an internal or external command,
> > operable program or batc
On Wed, Aug 10, 2016, at 07:59, Dennis Lee Bieber wrote:
> The use of = also has a long history... FORTRAN (where the comparison
> was .EQ.), BASIC (granted, K&K required assignment to start with the
> keyword LET, so the use of = was mainly a delimiter between target and
> expression being a
On Wed, Aug 10, 2016, at 19:57, Michael Torrie wrote:
> But the grammar must still be a bit complex as sometimes the LHS of the
> = is an expression, as well as the RHS.
The only place that an *arbitrary* expression (including e.g. = as
equality) can appear in the LHS is inside parentheses, otherw
On Wed, Aug 17, 2016, at 14:27, Terry Reedy wrote:
> That particular syntax was not really considered. At least 10 versions
> using 'if', 'then', 'else', and other tokens were.
>
> They all had the problem of requiring a new keyword such as 'then' or
> some other innovation.
Why not just if(co
On Fri, Aug 19, 2016, at 16:51, Lawrence DâOliveiro wrote:
> On Saturday, August 20, 2016 at 6:03:53 AM UTC+12, Terry Reedy wrote:
> >
> > An 'octet' is a byte of 8 bits.
>
> Is there any other size of byte?
Not very often anymore. Used to be some systems had 9-bit bytes, and of
course a lot of c
On Fri, Aug 19, 2016, at 21:09, Steve D'Aprano wrote:
> Depends what you mean by "byte", but the short answer is "Yes".
>
> In the C/C++ standard, bytes must be at least eight bytes. As the below
> FAQ
> explains, that means that on machines like the PDP-10 a C++ compiler will
> define bytes to be
On Sat, Aug 20, 2016, at 03:50, Marko Rauhamaa wrote:
> 2'scomplement arithmetics is quite often taken advantage of in C
> programming. Unfortunately, with the castration of signed integers with
> the most recent C standards, 2's-complement has been dangerously broken.
No part of any version of th
On Mon, Aug 22, 2016, at 01:35, Steven D'Aprano wrote:
> Could somebody (the OP?) please explain what is the purpose of this
> proposal, what it does, how it works, and when would people use it?
I think what he wants is a way for a module which uses features
(syntactic or otherwise, but I suppose
On Mon, Aug 22, 2016, at 02:03, Stefan Behnel wrote:
> Steven D'Aprano schrieb am 22.08.2016 um 07:35:
> > if sys.version < '3':
> > import mymodule2 as mymodule
> > else:
> > import mymodule3 as mymodule
>
> This condition is going to fail when Python 30.0 comes out.
Er, won't it rather
On Mon, Aug 22, 2016, at 08:44, Chris Angelico wrote:
> However, I don't think it's particularly necessary. Explicit version
> number checks should be very rare, and shouldn't be encouraged.
> Instead, encourage feature checks, as Steve gave some examples of.
The problem is when you want to write
On Mon, Aug 22, 2016, at 08:39, Chris Angelico wrote:
> Nope. On Windows, you would try/except it.
No, you can't, because the failure mode often isn't "file refuses to
open" but "data is written to a serial port".
There are myriad other ways
> something could fail, and the only correct action is
On Mon, Aug 22, 2016, at 09:21, Steve D'Aprano wrote:
> Rather, you just use the features you rely on, document the minimum
> supported version, and if somebody is silly enough to try running your
> code
> under Python 1.4, they'll get a SyntaxError or an exception when you try
> to
> do something
On Mon, Aug 22, 2016, at 10:21, Ben Finney wrote:
> So yes, filenames from arbitrary sources should be *completely*
> untrusted, and never used to access any file on the system. Throw the
> entire filename away and make a filename locally, without using any part
> of the original name.
To be fair,
On Mon, Aug 22, 2016, at 11:40, Chris Angelico wrote:
> Windows has some other issues, including that arbitrary files can
> become executable very easily (eg if %PATHEXT% includes its file
> extension), and since the current directory is always at the beginning
> of your path, this can easily turn
On Mon, Aug 22, 2016, at 16:21, Malcolm Greene wrote:
> Python 3.5: Is there a way to dynamically import specific names from a
> module vs importing the full module?
>
> By dynamic I mean via some form of importlib machinery, eg. I'm looking
> for the dynamic "from import " equivalent of "import
On Wed, Aug 24, 2016, at 00:26, Gary Herron wrote:
> Perhaps I'm not understanding what you mean by "clunky", but this seems
> pretty clean and simple to me.
The original post is from 2002, I don't know why it got a reply just
now.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Aug 24, 2016, at 07:17, Chris Angelico wrote:
> Objects/listobject.c:795
>
> /* Special cases:
>1) lists and tuples which can use PySequence_Fast ops
>2) extending self to self requires making a copy first
> */
And, of course, it is a special case - a.extend(iter(a
On Sat, Aug 27, 2016, at 13:24, Grant Edwards wrote:
> Becuase the parser thinks you've entered a floating point number with
> a fractional part of "bit_length".
123.+456 doesn't think that the fractional part is "+456".
(Of course, the real reason is "because it would be even more annoying
to ge
Directing this to python-list because it's really not on the topic of
the idea being discussed.
On Mon, Aug 29, 2016, at 05:37, Chris Angelico wrote:
> Suppose I come to python-ideas and say "Hey, the MUD community would
> really benefit from a magic decoder that would use UTF-8 where
> possible,
On Mon, Aug 29, 2016, at 11:14, Chris Angelico wrote:
> Please don't. :) This is something that belongs in the application;
> it's somewhat hacky, and I don't see any benefit to it going into the
> language. For one thing, I could well imagine making the fallback
> encoding configurable (it isn't c
On Wed, Aug 10, 2016, at 12:19, Random832 wrote:
> On Wed, Aug 10, 2016, at 07:59, Dennis Lee Bieber wrote:
> > The use of = also has a long history... FORTRAN (where the
> > comparison was .EQ.), BASIC (granted, K&K required assignment to
> > start with the k
On Fri, Sep 2, 2016, at 11:51, Marco Sulla wrote:
> >>> 10**26 - 1
> 99
> >>> 1e26 - 1
> 1e+26
>
>
> Why?
Exponential notation creates floating point numbers, which have a
limited amount of precision in binary.
Specifically (on my system which, as most modern computer
On Fri, Sep 2, 2016, at 13:02, Marco Sulla wrote:
> On Fri, Sep 2, 2016 at 6:17 PM, Random832 wrote:
> > Trying to add 1 gets it rounded off again, and the value is simply
> > printed as 1e+26 by default because this is the shortest representation
> > that gives the
On Fri, Sep 2, 2016, at 15:12, Christian Gollwitzer wrote:
> Tradition? All languages I know of treat a number with an exponent as
> floating point.
Scheme does allow you to give integers (and rationals) in decimal and/or
exponential notation with the "#e" prefix.
--
https://mail.python.org/mail
On Thu, Sep 8, 2016, at 18:13, Grant Edwards wrote:
> After all, that boilerplate just makes the corporation look stupid and
> incompetent. Any email that leaves the corporate network must be
> assumed to be visible to world+dog. Anybody who thinks differently is
> deluded and should not be allow
On Mon, Sep 12, 2016, at 17:29, Chris Angelico wrote:
> old_id = id(a)
> a += something
> if id(a) == old_id:
> print("We may have an optimization, folks!")
>
> But that can have false positives. If two objects do not concurrently
> exist, they're allowed to have the same ID number.
But the t
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 claim, it goes into some
detail on why it wouldn't if it were infinitely large due to
gravi
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 what a horizon is - and what
a straight line is, if not the path followed by a beam of light.
-
On Thu, Sep 15, 2016, at 15:31, Steve D'Aprano wrote:
> Light follows geodesics, not straight lines.
What is a straight line on a curved space if not a geodesic? That was
actually what I was getting at.
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Sep 20, 2016, at 09:19, 38016226...@gmail.com wrote:
> >>> x = [1, 2, 3]
> >>> y = [4, 5, 6]
> >>> zipped = zip(x, y)
> >>> list(zipped)
> [(1, 4), (2, 5), (3, 6)]
> >>> x2, y2 = zip(*zip(x, y))
> >>> x == list(x2) and y == list(y2)
> True
>
> My problem is >>> x2, y2 = zip(*zip(x, y)).
>
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 that out to be O(N) not O(N log N). I'm afraid I can't parse
> your final clause:
>
> "si
On Tue, Sep 20, 2016, at 23:34, Steve D'Aprano wrote:
> One of us is badly missing something.
The problem is the number of times next is called. Here, it'll be more
clear if we wrap the iterator in the original example to print each time
next is called.
class WrappedIterator():
def __init__(s
On Wed, Sep 21, 2016, at 10:39, ROGER GRAYDON CHRISTMAN wrote:
> Which only highlights my disappointment that my tree
> traversal itself was O(n log n), unless I gave up on yield.
Or you can give up on recursion. Recursive tree traversal is generally
associated with passing in a callback in rather
On Thu, Sep 22, 2016, at 09:45, eryk sun wrote:
> On Thu, Sep 22, 2016 at 12:40 PM, Gregory Ewing
> wrote:
> > eryk sun wrote:
> >>
> >> Actually in a Unix terminal the cursor can also be at
> >> the end of a line, but a bug in Python requires pressing Ctrl+D twice
> >> in that case.
> >
> > I wou
On Tue, Sep 27, 2016, at 15:58, TUA wrote:
> Is the following possible in Python?
>
> Given how the line below works
>
> TransactionTerms = 'TransactionTerms'
>
>
> have something like
>
> TransactionTerms =
>
> that sets the variable TransactionTerms to its own name as string
> representati
On Wed, Sep 28, 2016, at 11:41, Paul Moore wrote:
> What "allows side effects" in languages like Haskell is the fact that the
> runtime behaviour of the language is not defined as "calculating the
> value of the main function" but rather as "making the process that the
> main functon defines as an
On Thu, Sep 29, 2016, at 02:47, Rustom Mody wrote:
> Your example is exactly what I am saying; if a type has a behavior in
> which all values are always True (true-ish) its a rather strange kind
> of bool-nature.
For a given type T, if all objects of type T are true (true-ish, truthy,
whatever), i
On Fri, Sep 30, 2016, at 14:42, Ned Batchelder wrote:
> On Friday, September 30, 2016 at 2:16:10 PM UTC-4, Les Cargill wrote:
> > What is an equivalent mechanism in Python?
>
> There's no way* to hook into "x = 2", but you could hook into "x.a = 2"
> if you wanted do, by defining __setattr__ on x'
On Fri, Sep 30, 2016, at 20:46, Gregory Ewing wrote:
> What *is* necessary and sufficient is to make each iteration
> of the for-loop create a new binding of the loop variable
> (and not any other variable!).
I don't think that's true. I think this is logic that is excessively
tied to the toy exam
On Thu, Oct 6, 2016, at 12:46, Tim wrote:
> I need to zip up a directory that's about 400mb.
> I'm using shutil.make_archive and I'm getting this response:
>
> Segmentation fault: 11 (core dumped)
>
> The code is straightforward (and works on other, smaller dirs):
Are you able to make a test
On Thu, Oct 6, 2016, at 13:45, Random832 wrote:
> On Thu, Oct 6, 2016, at 12:46, Tim wrote:
> > I need to zip up a directory that's about 400mb.
> > I'm using shutil.make_archive and I'm getting this response:
> >
> > Segmentation fault: 11 (core du
On Thu, Oct 6, 2016, at 19:27, Loren Wilton wrote:
> So I don't want to WRITE a Python interpreter for the actual mainframe
> environment. I want to use an interpreter for an existing environment
> (Windows) where there are already a lot of existing libraries. But
> since a lot of the data to be an
On Sat, Oct 8, 2016, at 06:12, BartC wrote:
> The OP's code however is a good demonstration of how crazy Python's
> original for-range loop was: you need to construct a list of N elements
> just to be able to count to N. How many years was it until xrange was
> introduced?
Python 1.4 had it, an
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,
> including globals(), map(), named exceptions, "" strings ('' is okay),
> exponentiation, and mor
On Mon, Oct 17, 2016, at 14:20, eryk sun wrote:
> You can patch print() to transcode non-BMP characters as surrogate
> pairs. For example:
>
> On Windows this should allow printing non-BMP characters such as
> emojis (e.g. U+0001F44C).
I thought there was some reason this wouldn't work with tk, o
On Tue, Oct 25, 2016, at 02:39, Steven D'Aprano wrote:
> Not really. I think that lots of people think they need it, but
> once they write a little utility, they often realise that it's not
> that useful. That's just my opinion, and I'm one of those guys who
> wrote one:
>
> http://code.activestat
On Mon, Oct 31, 2016, at 10:55, Wildman via Python-list wrote:
> I have code using that approach but I am trying to save myself
> from having to parse the entire shadow file. Grep will do it
> for me if I can get code right.
Python already has built-in functions to parse the shadow file.
https:/
On Fri, Nov 25, 2016, at 06:33, Ned Batchelder wrote:
> A Python implementation can choose when to reuse immutable objects and
> when not to. Reusing a value has a cost, because the values have to
> be kept, and then found again. So the cost is only paid when there's
> a reasonable chance that the
On Mon, Dec 5, 2016, at 14:48, Michael Torrie wrote:
> Wow. Does that actually work? And work consistently? How would it
> handle globs like this:
The rules are simpler than you're probably thinking of. There's actually
no relationship between globs on the left and on the right. Globs on the
lef
On Mon, Dec 5, 2016, at 21:21, Dennis Lee Bieber wrote:
> They are languages in their own right, with their own rules.
>
> The Windows command prompt being one of the weakest -- it doesn't
> support arithmetic and local variables, nor (to my knowledge) looping
> constructs. BAT files a
On Tue, Dec 6, 2016, at 02:01, Larry Hudson via Python-list wrote:
> On 12/05/2016 06:51 PM, Nathan Ernst wrote:
> > IIRC, command.com was a relic of Win9x running on top of DOS and was a
> > 16-bit executable, so inherently crippled (and probably never support by
> > the NT kernel). Whereby cmd.ex
On Thu, Dec 8, 2016, at 01:20, Gregory Ewing wrote:
> BartC wrote:
> > And globbing doesn't take care of all of it: a Linux program still has
> > to iterate over a loop of filenames. The same as on Windows, except the
> > latter will need to call a function to deliver the next filename.
>
> Actu
On Wed, Dec 7, 2016, at 00:15, Steven D'Aprano wrote:
> and the shell expands the metacharacters ? {...} * [...] regardless of
> how much
> smarts the command itself has.
>
> There are thousands of programs I might use, and they may implement who
> knows
> how many different globbing rules:
>
>
On Wed, Dec 7, 2016, at 03:50, Peter Otten wrote:
> Is there an equivalent to
>
> # touch -- -r
>
> on Windows?
Doesn't need one - options conventionally start with /, and filenames
can't contain /.
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Dec 7, 2016, at 15:29, Lew Pitcher wrote:
> But, point of fact is that the feature to disable globbing is not often
> needed. Most Unix programs that accept filenames are happy to accept a
> list of filenames. There is not much call for a program to perform it's own
> globbing, like is requ
On Wed, Dec 7, 2016, at 22:41, Steven D'Aprano wrote:
> Python's fnmatch lib is a good example. It has, or at least had, no
> support for escaping metacharacters. Anyone relying on Python's fnmatch and
> glob
> modules alone for globbing will be unable to handle legitimate file names.
That's not
On Thu, Dec 8, 2016, at 20:38, Dennis Lee Bieber wrote:
> On Thu, 08 Dec 2016 10:37:27 -0500, Random832
> declaimed the following:
> >There are other issues, like needing a way to do Windows' version of
> >wildcard parsing with all its quirks, or at least some of its qu
On Tue, Dec 13, 2016, at 12:25, George Trojan - NOAA Federal wrote:
> >
> > Are repeated newlines/carriage returns significant at all? What about
> > just using re and just replacing any repeated instances of '\r' or '\n'
> > with '\n'? I.e. something like
> > >>> # the_string is your file all rea
On Tue, Dec 13, 2016, at 11:01, Michael Torrie wrote:
> On 12/13/2016 05:39 AM, Samuel Williams wrote:
> > Michael, yes.
> >
> > FYI, I found out why this works. Pressing Ctrl-D flushes the input
> > buffer. If you do this on an empty line, it causes read(...) to return
> > 0 which Ruby considers
On Tue, Dec 13, 2016, at 17:09, Michael Torrie wrote:
> On 12/13/2016 10:48 AM, Random832 wrote:
> > The problem is there's currently no way to differentiate "interactive
> > mode" from "script run on a tty".
> >
> > You can get similar behavio
On Tue, Dec 13, 2016, at 19:10, Steve D'Aprano wrote:
> Can you show a simple demonstration of what you are doing?
>
> I'm having difficulty following this thread because I don't know
> what "script run on a tty" means.
The question is literally about the input/script being the tty and not
redire
On Tue, Dec 13, 2016, at 19:20, Steve D'Aprano wrote:
> sys.flags.interactive will tell you whether or not your script was
> launched
> with the -i flag.
>
> hasattr(sys, 'ps1') or hasattr(sys, 'ps2') will tell you if you are
> running
> in the REPL (interactive interpreter). The ps1 and ps2 varia
On Thu, Dec 15, 2016, at 08:31, Dennis Lee Bieber wrote:
> As for my posts disappearing: I run with "X-NoArchive" set. I have from
> before Google absorbed DejaNews. Back then, most news-servers expired
> posts
> on some periodic basis (my ISP tended to hold text groups for 30 days or
> so, b
On Sun, Dec 18, 2016, at 17:03, Gregory Ewing wrote:
> mm0fmf wrote:
> > +1 for knowing where CTRL should be.
> > Bonus +1 for having used an ASR33.
>
> And it's quite remarkable that the designers of the ASR33
> knew exactly where it would need to be for Emacs users
> years later! I think Richard
On Fri, Dec 30, 2016, at 09:47, Steve D'Aprano wrote:
> Again, assume both operands are in range for an N-bit signed integer.
> What's
> a good way to efficiently, or at least not too inefficiently, do the
> calculations in Python?
I'd do something like:
bit_mask = (1 << bits) - 1 # 0x
sign_b
On Fri, Dec 30, 2016, at 09:47, Steve D'Aprano wrote:
> Again, assume both operands are in range for an N-bit signed integer.
> What's
> a good way to efficiently, or at least not too inefficiently, do the
> calculations in Python?
I'd do something like:
bit_mask = (1 << bits) - 1 # 0x sign_b
On Fri, Jan 13, 2017, at 17:24, D'Arcy Cain wrote:
> I thought I was done with this crap once I moved to 3.x but some
> Winblows machines are still sending what some circles call "Extended
> ASCII". I have a file that I am trying to read and it is barfing on
> some characters. For example:
>
On Thu, Apr 19, 2018, at 03:39, zljubi...@gmail.com wrote:
> Is there any other option for getting interactive multi line input from user.
If you don't need a full-featured text editor, you could build a simple input
popup with the Textbox widget in tkinter.
--
https://mail.python.org/mailman/li
Python itself runs fine, but when I try to drop a file on a script it just
doesn't work.
If I try to regsvr32 the shell extension, it says: The module
"c:\windows\pyshellext.amd64.dll" failed to load.
There was no indication of any problem until this. Apparently it is linked
against "VCRUNTIME
Python itself runs fine, but when I try to drop a file on a script it just
doesn't work.
If I try to regsvr32 the shell extension, it says: The module
"c:\windows\pyshellext.amd64.dll" failed to load.
There was no indication of any problem until this. Apparently it is linked
against "VCRUNTIME140
On Mon, Mar 28, 2016, at 19:40, Steven D'Aprano wrote:
> Not to mention "Monad". I don't think *anyone* knows what a Monad is ;-)
A monad is just a monoid in the category of endofunctors; what's the
problem?
Well, someone had to say it.
--
https://mail.python.org/mailman/listinfo/python-list
I'd posted this to stdlib-...@python.org without realizing that that
list is mostly dead.
On Thu, Mar 24, 2016, at 22:33, Random832 wrote:
> I assume that everyone who has ever used imaplib is familiar with how
> painful its output format is to deal with. I am wondering if anyone els
On Tue, Mar 29, 2016, at 14:45, Grant Edwards wrote:
> I think giving up on backwards compatiblity and starting from scratch
> is the best idea.
>
> I like imaplib2
>
> https://pypi.python.org/pypi/imaplib2
> https://github.com/bcoe/imaplib2
> https://sourceforge.net/projects/imaplib2/
>
> imapc
On Tue, Mar 29, 2016, at 19:54, Rob Gaddi wrote:
> Just read on Usenet instead of through the mailing list. That way
> you can accept broken threading as a given rather than wonder why it's
> happening in a particular case.
It's a given everywhere. Any thread that contains a sufficient number of
On Tue, Mar 29, 2016, at 20:56, Chris Angelico wrote:
> The map contract is this:
>
> x = StrangeDict()
> x[123] = 456
> ...
> assert x[123] == 456
>
> Your mapping does violate the map contract.
So, you can put *anything* in that "..."?
x = dict()
x[123] = 456
x[123] = 789
assert x[123] == 456
On Wed, Mar 30, 2016, at 01:43, Steven D'Aprano wrote:
> This is not an argument about dicts being mutable, because clearly they
> aren't. This is an argument about key:value pairs being stable. "Stable"
> doesn't mean "immutable". If you change the value associated with a key
> directly, then i
This discussion is getting a bit distracted from the original request.
Let's look at it from a higher level.
What is being requested, regardless of if you call it a "map interface"
or whatever, is a single way, for sequences and maps... broadly,
anything with a __getitem__, to iterate over all val
1 - 100 of 757 matches
Mail list logo