It sounds a little like you're looking for interval arithmetic.
Maybe https://pypi.org/project/python-intervals/1.5.3/ ?
On Thu, Apr 7, 2022 at 4:19 AM Antoon Pardon wrote:
> I am working with a list of data from which I have to weed out duplicates.
> At the moment I keep for each entry a conta
ing a bloom
filter. EG: https://pypi.org/project/drs-bloom-filter/
On Sun, Apr 10, 2022 at 5:31 PM Dan Stromberg wrote:
>
> It sounds a little like you're looking for interval arithmetic.
>
> Maybe https://pypi.org/project/python-intervals/1.5.3/ ?
>
> On Thu, Apr 7, 2022 at
On Fri, Apr 15, 2022 at 11:43 AM Alan Gauld wrote:
> I've just migrated from a Linux PC to a Mac mini running Monterey.
>
I'm using a Mac for work lately. I miss Linux. I feel like MacOS isn't
nearly as good at multimonitor setups as Cinnamon.
Does anyone know how to launch a Python program fr
I have a program http://stromberg.dnsalias.org/~dstromberg/looper/
that I use and maintain.
It's like GNU parallel or similar - yet another "run n processes, m at
a time" implementation. Interestingly, I've only used/tested it on
Linux, but it's under a Microsoft copyright because Microsoft acqui
On Mon, Oct 10, 2016 at 12:05 AM, dieter wrote:
> Dan Stromberg writes:
>> I have a program http://stromberg.dnsalias.org/~dstromberg/looper/
>> that I use and maintain.
>>
>> It's like GNU parallel or similar - yet another "run n processes, m at
>> a
Hi folks.
I'm attempting to set up Sphinx to document several API's based on docstrings.
I've got something browseable for one example API using Sphinx +
autodoc + apidoc.
However, we aren't really a PEP8 shop; we use hard tabs expanded to 4
columns, and we use 120 columns total width (and somet
On Sat, Sep 24, 2016 at 6:30 PM, Yann Kaiser wrote:
> pydoctor may be something you're looking for. I don't know if it supports
> exporting to PDF like Sphinx does.
>
> As you've no doubt figured out by now, Sphinx doesn't revolve around the
> Python files themselves, but rather .rst files in whic
On Mon, Oct 24, 2016 at 2:39 PM, Ned Batchelder wrote:
> On Monday, October 24, 2016 at 5:00:47 PM UTC-4, Dan Stromberg wrote:
>> However, we aren't really a PEP8 shop; we use hard tabs expanded to 4
>> columns, and we use 120 columns total width (and sometimes a little
>
Hello,
I'm a french student and I'm running Python 3.5.2 on windows.
When I installed Anaconda3 4.2.0 version, Pyzo couldn't find a module named
conda.
Then I registered it as my default Python 3.5.2 version, but I couldn't use
Pyzo anymore (I sent you a screenshot). So I tried to fix this problem
f
your use case. Yes, I'm willing to have missed something subtle (or not
so subtle).
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 17 Nov 2016 16:17:51 +1100, Steven D'Aprano wrote:
> ... factory functions are great. But I'm saying that as the writer of
> the library, not the user of the library. Can you imagine expecting
> users to do this?
> from math import trig
> sin = trig.build('sine')
> result = sin(0.1)
No,
On Wed, 04 Jan 2017 16:40:00 +1100, Steven D'Aprano wrote:
> On Wednesday 04 January 2017 15:46, Deborah Swanson wrote:
>
>> Steven D'Aprano wrote, on January 03, 2017 8:04 PM
> [...]
>>> Of course you have to put quotes around them to enter them in
>>> your source code.
>>> We don't expect this
On Wed, 04 Jan 2017 16:40:00 +1100, Steven D'Aprano wrote:
> On Wednesday 04 January 2017 15:46, Deborah Swanson wrote:
>
>> Steven D'Aprano wrote, on January 03, 2017 8:04 PM
> [...]
>>> Of course you have to put quotes around them to enter them in
>>> your source code.
>>> We don't expect this t
ne
drawing characters," and took a slightly different approach (I think) to
the command line argument(s):
The default is ASCII, or you can specify -G to specify the VT100 line
drawing characters (G for Graphic, I assume), or you can specify -U for
the UTF-8 line drawing characters.
Dan
--
;t get out of the way and let me edit my
own code get deleted).
In Python, I prefer to get the indent right myself before I press ENTER.
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 04 Feb 2017 12:56:58 -0600, Wildman wrote:
> On Sat, 04 Feb 2017 18:25:03 +, Grant Edwards wrote:
>> It allows a malicous user to put an evil executable someplace public
>> like /tmp and have it executed accidentally. For example, let's say
>> this executable file was named "sl" and
On Sat, 04 Feb 2017 21:19:06 +0200, Marko Rauhamaa wrote:
> Now, that's why the distros are careful to place $HOME/bin as the
> final entry of PATH; the system commands take precedence over the
> user's personal ones. However, the user is free to define the PATH any
> way they like.
I deliberatel
On Wed, Mar 7, 2018 at 1:57 PM, C W wrote:
> I set time to 6:30, but it's coming out to 5:30. I guess it's because I
> passed in 5:30, so, it's replaced?
time and self.time are 2 different things.
> How does line-by-line execution run inside a frame
To quickly come to grips with execution order
elf.time are not the same (at
least not in Python; other languages may (and do) work differently).
Dan
--
https://mail.python.org/mailman/listinfo/python-list
time()
> 5:30
>
> I set time to 6:30, but it's coming out to 5:30. I guess it's because I
> passed in 5:30, so, it's replaced?
Hint: in Python, self.time and time are not the same (unless you've
played some sort of weird trick somewhere).
Dan
--
https://mail.python.org/mailman/listinfo/python-list
x27;
That's (a) a triple quoted string containing a single escaped quote,
followed by (b) a quoted empty string. The two consecutive strings are
concatenated into a single string.
(Too many years of shell programming to miss this one!)
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Mar 15, 2018 at 8:25 AM, Bob Gailer wrote:
> On Mar 15, 2018 9:30 AM, wrote:
>>
>> I would like to have this offer 6 guesses, but instead it gives one guess
> and prints the if statement/output 6 timesany ideas where I went wrong?
>
> I suggest you conduct a walk-through. That means p
I'd put them in a file with access to the daemon..
Putting credentials in an environment variable is insecure on Linux,
because ps auxwwe lists environment variables.
On Fri, Mar 23, 2018 at 9:37 AM, Malcolm Greene wrote:
> Looking for your suggestions on best practice techniques for managing
>
On Fri, Mar 23, 2018 at 9:34 PM, Arkadiusz Bulski wrote:
> I already asked on PYPY and they confirmed that any version of pypy,
> including 2.7, has dict preserving insertion order. I am familiar with
> ordered **kw which was introduced in 3.6 but I also heard that builtin dict
> preserves order s
I imagine pygame could do this, if you give it:
https://freesound.org/people/pinkyfinger/packs/4409/
On Sun, Mar 25, 2018 at 1:31 PM, Bernard via Python-list
wrote:
>
> Pyton Friends,
> Do you have any code that will play the notes "ABCDEFG" from my computer
> keyboard when a key is pressed ? Fo
On Sun, Mar 25, 2018 at 11:10 PM, dieter wrote:
> adrien oyono writes:
>> I have recently read the documentation about how imports work on python,
>> and I was wondering why, when you execute a python file, the current
>> directory is not added by default to the PYTHONPATH ?
>
> Maybe, to avoid s
Please at least skim http://www.catb.org/esr/faqs/smart-questions.html
On Tue, Mar 27, 2018 at 12:27 AM, kevon harris wrote:
> Unable to pull up IDLE after downloading Python 3.6.4
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 27, 2018 at 8:18 AM, Michael Torrie wrote:
> But when it's exactly what you need, why do
> you need to shoehorn the expression into 79 characters? Seems pointless
> in a case like this. PEP8 is a guideline, not an absolute rule. It's
> okay to bend it a bit in cases like this.
I thi
On Tue, Mar 27, 2018 at 4:37 PM, Rick Johnson
wrote:
> On Tuesday, March 27, 2018 at 4:02:37 PM UTC-5, Dan Stromberg wrote:
>> On Tue, Mar 27, 2018 at 8:18 AM, Michael Torrie wrote:
>> > But when it's exactly what you need, why do you need to
>> > shoehorn t
On Wed, Mar 28, 2018 at 7:30 AM, Ganesh Pal wrote:
>>
>> Or maybe they're not giving the same result. I'm a little confused here.
>>
>
>
> My Bad and Apologies , I should be fined for pasting wrong question.
>
> Actually I wanted to know if its ok to use just empty {} with .format()
> or use {
On Thu, Mar 29, 2018 at 7:06 AM, Malcolm Greene wrote:
> We're using virtual environments with Python 3.6. Since all our pip
> installed modules are in our environment's local site-packages folder,
> is the distribution of a virtual environment as simple as recursively
> zipping the environment's
On Wed, Mar 28, 2018 at 7:18 PM, wrote:
> Hello all,
>
> This code is written for multivariate (multiple independent variables
> x1,x2,x3..xn and a dependent variable y) time series analysis using logistic
> regression (correlation and prediction).
> This code is based on one point location (o
I'm not super-familiar with tarfile, though I did use it in one project.
First off, note that CPython is commonly 4x slower than C. In fact,
it can be much worse at times.
Also... Have you considered trying your code on Pypy3?
On Mon, Apr 16, 2018 at 9:10 AM, Jim MacArthur
wrote:
> Hi, I'm se
Given that the list does not allow pictures, would it make sense to
have the software that strips the pictures also send an e-mail to the
picture sender indicating that pictures are disallowed?
I see a lot of people responding individually saying that images are
stripped. It's looking like a bit
On Tue, Apr 17, 2018 at 4:11 PM, wrote:
> W dniu sobota, 27 stycznia 2018 16:59:50 UTC+1 użytkownik larry@gmail.com
> napisał:
>> I have a script that does this:
>>
>> subprocess.Popen(['service', 'some_service', 'status'],
>> stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>>
>> When I ru
On Sun, May 20, 2018 at 12:54 PM, wrote:
> Lets say I have the following tuple like string.
> (128, 020, 008, 255)
>
> What is the best way to to remove leading zeroes and end up with the
> following.
> (128, 20, 8, 255)-- I do not care about spaces
>
> This is the solution I came up
On Sat, May 19, 2018 at 3:58 PM, wrote:
> On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan wrote:
>> > It does auto-detect it as cp1252- look at the files in the traceback and
>> > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong
>> > encoding, try ope
On Thu, May 24, 2018 at 7:12 PM, wrote:
> here is the code, i keep getting an error, "break outside loop". if it is
> false just exit function
>
>
> def d(idx):
> if type(idx) != int:
> break
>
> d('k')
Not what you asked, but I believe pylint recommends using not isinstance
instead
On Thu, May 24, 2018 at 9:34 PM, Mikhail V wrote:
> Hi.
> I've put some thoughts together, and
> need some feedback on this proposal.
> Main question is: Is it convincing?
> Is there any flaw?
> My own opinion - there IS something to chase.
> Still the justification for such syntax is hard.
>
Th
On Fri, Jun 1, 2018 at 6:34 PM, Mike McClain wrote:
> On Fri, Jun 01, 2018 at 08:02:27AM -0700, Mike McClain wrote:
> > On Thu, May 31, 2018 at 07:44:35PM -0700, Mike McClain wrote:
> >
> > > Is there a way in a script to know which version of python is being
> > > run so I can write:
> > >
On Fri, Jun 1, 2018 at 2:57 PM, Chris Angelico wrote:
> If you dislike adding features to a language on the basis that it
> makes the language harder to learn, remember that you instead force
> one of three even worse options:
>
> 1) Messy code because people unindent inside their source code,
>
On Sat, Jun 2, 2018 at 4:28 AM, Chris Angelico wrote:
> On Sat, Jun 2, 2018 at 9:13 PM, Steven D'Aprano
> wrote:
> > On Sat, 02 Jun 2018 20:58:43 +1000, Chris Angelico wrote:
> Can someone confirm whether or not all the listed signals are actually
> supported? We know that Ctrl-C maps to the int
On Sat, Jun 2, 2018 at 11:43 AM, Chris Angelico wrote:
> >> 1) Messy code because people unindent inside their source code,
> >> creating wonky indentation (which Python usually avoids)
> >>
> >> 2) Forcing readers to look up the third-party module you're using
> >> before they can understand you
On Sun, Jun 17, 2018 at 1:23 PM, Marko Rauhamaa wrote:
> Jim Lee :
> > IMHO, trying to shoehorn static type checking on top of a dynamically
> > typed language shows that the wrong language was chosen for the job.
>
> I'm also saddened by the type hinting initiative. When you try to be
> best for
On Sun, Jun 17, 2018 at 5:05 AM, Marko Rauhamaa wrote:
> Bart :
> > So, how /do/ you obtain the memory address of those values are
> > located? For example, in order to pass it to some foreign C function
> > that takes a void* parameter.
>
> That is dependent on the Python implementation. CPython
On Mon, Jun 18, 2018 at 5:45 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Mon, 18 Jun 2018 14:57:30 +, Schachner, Joseph wrote:
> > I believe the proposed type hints are only necessary
> > for function definitions,
>
> What is the basis of this belief? How much exper
On Mon, Jun 18, 2018 at 5:52 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Mon, 18 Jun 2018 21:03:14 +0100, Bart wrote:
>
> > In the case of Python, it is
> > already so big and has so many features crammed in that adding type
> > hints probably makes little difference.
>
On Mon, Jun 18, 2018 at 10:08 PM, Chris Angelico wrote:
> On Tue, Jun 19, 2018 at 1:46 PM, Dan Stromberg
> wrote:
> > Great languages are small but extensible, easy to read, and don't require
> > learning a lot before you can get started writing code or reading
On Tue, Jun 19, 2018 at 7:33 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Tue, 19 Jun 2018 17:41:11 -0700, iansuderman wrote:
>
> > What does the code look like to insert assembler into python and how
> > does that code send information back to python.
> >
> > It seems y
On Mon, Jun 25, 2018 at 3:40 AM, wrote:
> Hey,
> I already have quite an experience in programming, and I wish to study
> Python as well. I need to study it before I continue with my comp. science
> academic studies.
> How do you recommend studying it? As mentioned in the headline, I already
> kn
From: Dan Stromberg
On Mon, Jun 25, 2018 at 3:40 AM, wrote:
> Hey,
> I already have quite an experience in programming, and I wish to study
> Python as well. I need to study it before I continue with my comp. science
> academic studies.
> How do you recommend studying it? As m
On Tue, Jun 26, 2018 at 8:26 PM, Sharan Basappa
wrote:
> Folks,
>
> I know this is not a machine learning forum but I wanted to see if anyone
> can explain this to me.
>
> In artificial neural network, I can understand why sigmoid is used but I
> see that derivative of sigmoid output function is
On Wed, Jun 27, 2018 at 10:44 AM, T Berger wrote:
> On Wednesday, June 27, 2018 at 1:40:20 PM UTC-4, Marko Rauhamaa wrote:
> > Joaquin Henriquez :
> >
> > >>Subject: EXTERNAL: OSError: [Errno 48] Address already in use
> > >
> > > The best way to help if got you to put the relevant code here.
> >
On Wed, Jun 27, 2018 at 8:49 AM, T Berger wrote:
> Why am I getting this error? I'm not sure what additional information I
> need to supply, so please let me know.
AIUI, there are 2 possible causes. You either have some other process
listening on the requested port, or a process that Was using
On Wed, Jun 27, 2018 at 10:31 PM, Marko Rauhamaa wrote:
> Dan Stromberg :
> >> > The problem can be solved by turning on the SO_REUSEADDR flag of
> >> > the socket.
> > BTW, it's a security feature you're turning off. If you're on a
> >
On Thu, Jun 28, 2018 at 1:27 PM, Marko Rauhamaa wrote:
> Dan Stromberg :
> > On Wed, Jun 27, 2018 at 10:31 PM, Marko Rauhamaa
> wrote:
> >> Dan Stromberg :
> >> >> > The problem can be solved by turning on the SO_REUSEADDR flag of
> >> >> &g
On Thu, Jun 28, 2018 at 10:30 PM, Marko Rauhamaa wrote:
> Well, the same security issue can be demonstrated without SO_REUSEADDR:
>
> The security issue can be real but is not directly related with
> SO_REUSEADDR.
>
Yes, it can. It just takes longer.
--
https://mail.python.org/mailman/listinfo
On Sat, Jun 30, 2018 at 11:19 AM, Peter J. Holzer wrote:
> On 2018-06-28 18:04:16 -0700, Dan Stromberg wrote:
> > On Thu, Jun 28, 2018 at 1:27 PM, Marko Rauhamaa
> wrote:
> > Start an echo server process P that listens on tcp/.
> >
> > Initiate a connection fr
On Mon, Jul 2, 2018 at 11:02 AM, T Berger wrote:
> Is there any way to set posts to appear chronologically in tree view? And
> why is the tree view completely out of order? My last two posts in this
> view are from 6/27 and 6/28.
>
I'm thinking you may want to specify what software you're talkin
On Sun, Jul 1, 2018 at 8:51 PM, Jim Lee wrote:
> Languages that used to be small, lean, and exceptional at doing things
> really well in a given domain have morphed into large, monolithic, bloated
> language *systems* that do many things in many domains, and have many ways
> to do the *same* thin
On Mon, Jul 2, 2018 at 6:10 PM, Jim Lee wrote:
> On 07/02/18 17:34, Dan Stromberg wrote:
>
> The fact of the matter is the economics have changed a lot since then.
> Machine time used to be really expensive compared to developer time.
> Today, it's the opposite: deve
On Mon, Jul 2, 2018 at 5:51 PM, Tim Daneliuk wrote:
> In particular, there is little interest in having programmers
> learn on the job, only that they be as productive as possible
> as fast they can. Hiring specific languages skills - the theory
> goes - means that the individual will be fluent
On Mon, 16 Jul 2018 10:39:49 +, Steven D'Aprano wrote:
> ... people who think that if ISO-8859-7 was good enough for Jesus ...
It may have been good enough for his disciples, but Jesus spoke Aramaic.
Also, ISO-8859-7 doesn't cover ancient polytonic Greek; it only covers
modern monotonic Gree
On Tue, 17 Jul 2018 08:48:55 +1000, Chris Angelico wrote:
> That said, though, the fact that indexing a byte string yields an int
> instead of a one-byte string is basically unable to be changed now ...
Agreed.
> ... and IMO it'd be better to be consistent with text strings than
> with bytearray
On Sat, 21 Jul 2018 17:37:00 +0100, MRAB wrote:
> On 2018-07-21 15:20, aldi.kr...@gmail.com wrote:
>> Hi,
>> I have a long text, which tells me which files from a database were
>> downloaded and which ones failed. The pattern is as follows (at the end of
>> this post). Wrote a tiny program, but
though, then those ten stubs tell me that I have to override them, and
their docstrings tell me how. That is a huge improvement in long term
maintainability.
Dan
--
https://mail.python.org/mailman/listinfo/python-list
;
> (Not that I do this using "inner classes", but I do often want to use
> a class as a container for functions, without caring about "self" or
> wrapping everything in staticmethod.)
Isn't that what modules are for? (I suspect that I'm missing
On Mon, 20 Aug 2018 22:55:26 +0300, Marko Rauhamaa wrote:
> Dan Sommers :
>
>> On Mon, 20 Aug 2018 14:39:38 +, Steven D'Aprano wrote:
>>> I have often wished Python had proper namespaces, so I didn't have to
>>> abuse classes as containers in this wa
and the behavior.
Script
x = input ("Enter the numbers separated by space and press ENTER :")
Think about what x is here, and what x.split does.
x = x.split(" ")
Now think about what x is again, and recall that Python is strongly typed.
Dan
--
https://mail.python.org/mai
=True/False.
In their simplest form, the brackets match alternatives. For example,
file[1234].text matches file1.text, file2.text, file3.text, and
file4.text, but not file_something_else.text.
Dan
--
https://mail.python.org/mailman/listinfo/python-list
Robin Becker wrote:
> [...] just thought control of the wrong sort..
Is there "thought control of the right sort"?
--
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
--
https://mail.python.org/mai
David Raymond wrote:
> [...]
> HAL.open(ship.pod_bay.doors)
I'm sorry Dave, I'm afraid I can't do that.
--
|_|O|_| Registered Linux user #585947
|_|_|O| Github: https://github.com/dpurgert
|O|O|O| PGP: 05CA 9A50 3F2E 1335 4DC5 4AEE 8E11 DDF3 1279 A281
--
https://mail.python.org/mailman/listinf
On 9/28/18 2:00 PM, Chris Green wrote:
I have a list created by:-
fld = shlex.split(ln)
It may contain 3, 4 or 5 entries according to data read into ln.
What's the neatest way of setting the fourth and fifth entries to an
empty string if they don't (yet) exist? Using 'if len(fld) < 4:' fee
Thomas Jollans wrote:
> [...] (preferably, not in /usr - that's for OS-installed files only.
> /usr/local is a nice place to put things you installed from source).
While I agree that /usr(/bin) is incorrect, I believe that "for
OS-installed files only" is taking it a bit far.
My (admittedly, dim)
Thomas Jollans wrote:
> On 02/10/2018 19:22, Dan Purgert wrote:
>> Thomas Jollans wrote:
>>> [...] (preferably, not in /usr - that's for OS-installed files only.
>>> /usr/local is a nice place to put things you installed from source).
>>
>> While I a
Chris Angelico wrote:
> On Wed, Oct 3, 2018 at 5:17 AM Thomas Jollans wrote:
>> [...]
>> Whether we agree on the terminology here or not, of course we can agree
>> that you have to be bloody careful if you *do* decide to put things in
>> /usr/bin yourself :-)
>
> [...] On my system (Debian GNU/Lin
jf...@ms4.hinet.net wrote:
> Chris Angelico at 2018.10.10 UTC+8 AM 10:31:33 wrote:
>> On Wed, Oct 10, 2018 at 1:21 PM wrote:
>> > [...] 3) Google group is a more free land to live.
>> >
>> >
>>
>> Well, just be aware that a lot of people block ALL posts that come
>> from Google Groups. [...]
>
>
Larry Martell wrote:
> On Fri, Oct 5, 2018 at 6:54 AM Bruce Coram wrote:
> [...]
> We don't like you. We don't want you here. We never will. Save us all
> the trouble and go away.
That's the best code of conduct I've ever read ... 10/10, would read
again.
--
|_|O|_| Registered Linux user #58594
Chris Angelico wrote:
> On Fri, Oct 12, 2018 at 5:07 AM Ian Kelly wrote:
>>
>> On Thu, Oct 11, 2018 at 9:28 AM Dan Purgert wrote:
>> >
>> > Larry Martell wrote:
>> > > On Fri, Oct 5, 2018 at 6:54 AM Bruce Coram
>> > > wrote:
>>
English (and many other languages), it is wrong to spell my first
name with an initial lower case letter. Therefore, Dan and dan are not,
and should not be, the same identifier.
ObPython: if my identifiers are case-insensitive, then what about the
language's keywords? Can I spell class an
On Sun, 03 Apr 2016 08:46:59 -0700, Rustom Mody wrote:
> On Sunday, April 3, 2016 at 8:58:59 PM UTC+5:30, Dan Sommers wrote:
>> Yes, it's marginally annoying, and a security hole waiting to happen,
>> that A and A often look very much alike.
>
> "A security hole w
On Sun, 03 Apr 2016 08:39:02 -0700, Rustom Mody wrote:
> On Sunday, April 3, 2016 at 8:58:59 PM UTC+5:30, Dan Sommers wrote:
>> On Sun, 03 Apr 2016 07:30:47 -0700, Rustom Mody wrote:
>>
>> > So here are some examples to illustrate what I am saying:
>>
>&g
On Sun, 03 Apr 2016 10:18:45 -0700, Rustom Mody wrote:
> On Sunday, April 3, 2016 at 9:56:24 PM UTC+5:30, Dan Sommers wrote:
>> On Sun, 03 Apr 2016 08:39:02 -0700, Rustom Mody wrote:
>>
>> > On Sunday, April 3, 2016 at 8:58:59 PM UTC+5:30, Dan Sommers wrote:
>> &
On Sun, 03 Apr 2016 09:49:03 -0700, Rustom Mody wrote:
> On Sunday, April 3, 2016 at 9:41:11 PM UTC+5:30, Dan Sommers wrote:
>> On Sun, 03 Apr 2016 08:46:59 -0700, Rustom Mody wrote:
>>
>> > On Sunday, April 3, 2016 at 8:58:59 PM UTC+5:30, Dan Sommers wrote:
>> &g
On Mon, 11 Apr 2016 01:33:10 +0100, MRAB wrote:
> There _is_ one exception though: (). It's the empty tuple (a 0-element
> tuple). It doesn't have a comma and the parentheses are mandatory.
> There's no other way to write it.
The other way to write it is:
tuple()
--
https://mail.python.org/
e input driver does that for me. (Be careful; it's
tricky at that point to "fix" your shell.)
HTH,
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 16 Apr 2016 16:44:30 -0400, Random832 wrote:
> On Sat, Apr 16, 2016, at 16:21, Ben Finney wrote:
>> * Oh, come on, no-one would use U+000C FORM FEED in source code.
>
> Some text editors have shortcuts to navigate to the previous/next line
> that begins with a form feed.
Add these to the
On Sun, 17 Apr 2016 07:34:20 +1000, Chris Angelico wrote:
> On Sun, Apr 17, 2016 at 7:22 AM, Dan Sommers wrote:
>> On Sat, 16 Apr 2016 16:44:30 -0400, Random832 wrote:
>>
>>> On Sat, Apr 16, 2016, at 16:21, Ben Finney wrote:
>>>> * Oh, come on, no-one would
On Sun, 17 Apr 2016 11:48:11 +1000, Steven D'Aprano wrote:
> On Sun, 17 Apr 2016 09:35 am, Dan Sommers wrote:
>
>> We (this mailing list, or maybe it was the python-ideas mailing list)
>> just had a thread about non-ASCII characters in identifiers. One of
>> the
On Tue, 26 Apr 2016 11:51:23 +1000, Steven D'Aprano wrote:
> ... (Possible a few very old operating systems on supercomputers from
> the 1970s or 80s may have supported inserting... I seem to recall that
> VMS may have allowed that... but don't quote me.)
Some [non-supercomputer] OSes/filesystems
On Thu, 05 May 2016 18:37:11 -0700, Stephen Hansen wrote:
> ''.join(x for x in string if x.isupper())
> The difference is, both filter and your list comprehension *build a
> list* which is not needed, and wasteful. The above skips building a
> list, instead returning a generator ...
filter u
On Fri, 06 May 2016 02:46:22 +, Dan Sommers wrote:
> Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
> [GCC 5.3.1 20160409] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >
e to some other module and not notice that you don't have
> a verbosity check at the top, and then wonder why disabling verbose
> doesn't fully work. Both problems are solved by having a dedicated
> spam function, which will simply error out if you didn't set it up
&g
On Mon, 09 May 2016 00:22:46 -0400, DFS wrote:
> python 2.7.11 docs: "The returned list is truncated in length to the
> length of the shortest argument sequence."
>
>
> a = ['who','let','the']
> b = ['dogs','out?']
> c = zip(a,b)
>
> print c
> [('who', 'dogs'), ('let', 'out?')]
>
>
> Wouldn'
sum(map(itemgetter(2), v)),
sum(map(itemgetter(3), v)))
for (k, v) in [(k, list(v))
for (k, v)
in groupby(aList, itemgetter(1))]])
Shorter? In terms of number of expressions, yes. In terms of
characters typed, no.
Sweeter? YMMV.
HTH,
Dan
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 21 May 2016 03:19:49 +, Dan Sommers wrote:
>> Is there something shorter and sweeter for the summation?
>
> from itertools import groupby
> from operator import itemgetter
>
> result = [(k,
>sum(map(itemgetter(2), v)),
>
On Mon, 06 Jun 2016 17:51:24 -0700, Lawrence D’Oliveiro wrote:
> It is nice to have a common, versatile looping form which can be
> arranged in different ways to suit the problem at hand. That’s why I
> like the C-style for-statement.
[example snipped]
I used to write a lot of assembly code, for
On Tue, 07 Jun 2016 00:53:31 -0700, Lawrence D’Oliveiro wrote:
> On Tuesday, June 7, 2016 at 3:34:39 PM UTC+12, Dan Sommers wrote:
>
>> I used to write a lot of assembly code, for a lot of different CPUs, and
>> they all had a common, versatile looping form which co
On Wed, 22 Jun 2016 12:57:55 +1000, Chris Angelico wrote:
> On Wed, Jun 22, 2016 at 12:48 PM, Steven D'Aprano wrote:
>> I'm doing some arithmetic on complex numbers involving INFs, and getting
>> unexpected NANs.
>>
>> py> INF = float('inf')
>> py> z = INF + 3j
>> py> z
>> (inf+3j)
[...]
>> Is
On Wed, 22 Jun 2016 16:30:49 +1000, Chris Angelico wrote:
> On Wed, Jun 22, 2016 at 4:17 PM, Steven D'Aprano
> wrote:
>> On Wednesday 22 June 2016 13:54, Dan Sommers wrote:
>>
>>> By the time Python returns a result for inf+3j, you're already in
>>
701 - 800 of 2387 matches
Mail list logo