On Thu, Jun 28, 2018 at 7:01 PM Ben Finney wrote:
>
> Ian Kelly writes:
>
> > On Thu, Jun 28, 2018 at 4:38 AM Ben Finney
> > wrote:
> > >
> > > Ethan Furman writes:
> > >
> > > Specifically, I can't make sense of why someone would
On Thu, Jun 28, 2018 at 10:06 PM Ben Finney wrote:
>
> Ethan Furman writes:
>
> > On 06/28/2018 05:58 PM, Ben Finney wrote:
> >
> > > So I remain dumbfounded as to why anyone would want a class to *both* be
> > > an enumerated type, *and* have callable attributes in its API.
> >
> > Perhaps I am
On Sun, Jul 1, 2018 at 11:09 AM Abdur-Rahmaan Janhangeer
wrote:
>
> was viewing pep526, so, finally, python cannot do without hinting the type
> as other languages?
Python certainly can do without it. That's why it's an optional
feature with no runtime effect beyond making the annotations
inspect
On Sun, Jul 1, 2018 at 10:53 PM Jim Lee wrote:
> I did get one epiphany out of that. He's right - there are orders of
> magnitude more programmers today than there were a couple of decades ago
> - and they ARE almost all entry level, in that they are fluent in only
> one (maybe two) languages.
T
Now that I've actually read the PEP (sorry, I just assumed it would
never fly), I have a couple of (tongue-in-cheek) observations about
it:
> group = re.match(data).group(1) if re.match(data) else None
The only problem with this example of doing more work to save a line
of code is that presumably
On Wed, Jul 4, 2018, 9:36 AM Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Wed, 04 Jul 2018 13:48:26 +0100, Bart wrote:
> >> A better example would be:
> >>
> >> x: int = None
> >>
> >> which ought to be read as "x is an int, or None, and it's currently
> >> None".
> >
>
On Wed, Jul 4, 2018 at 1:11 AM Steven D'Aprano
wrote:
>
> On Tue, 03 Jul 2018 23:05:01 -0600, Ian Kelly wrote:
>
> > Now that I've actually read the PEP (sorry, I just assumed it would
> > never fly), I have a couple of (tongue-in-cheek) observations about it:
On Sat, Jul 7, 2018 at 8:03 AM Stefan Behnel wrote:
>
> Marko Rauhamaa schrieb am 07.07.2018 um 15:41:
> > Steven D'Aprano :
> >> On Sat, 07 Jul 2018 02:51:41 +0900, INADA Naoki wrote:
> >>> D.setdefault('c', None)
> >>
> >> Oh that's clever!
> >
> > Is that guaranteed to be thread-safe? The docum
On Fri, Jul 6, 2018 at 11:56 AM INADA Naoki wrote:
>
> D.setdefault('c', None)
Not guaranteed to be atomic.
I think the only safe way to do it is with a Lock.
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Jul 14, 2018 at 3:12 AM Christian Gollwitzer wrote:
> Typical conversation on this list / newsgroup:
>
> Q: "I could need a ?: operator just like in C. Is there something like
> that in Python?"
>
> A1: "No. You don't want it. It makes the code confusing. You said, you
> have a problem, yo
On Mon, Jul 16, 2018 at 12:02 PM Terry Reedy wrote:
>
> On 7/15/2018 5:28 PM, Marko Rauhamaa wrote:
>
> > if your new system used Python3's UTF-32 strings as a foundation,
>
> Since 3.3, Python's strings are not (always) UFT-32 strings. Nor are
> they always UCS-2 (or partly UTF-16) strings. Nor
Rather than go to the effort of reverse-engineering the chart, I
wonder if it would be simpler to just run OCR over it and dump it into
a spreadsheet.
On Wed, Jul 18, 2018 at 4:01 PM Thomas Jollans wrote:
>
> On 18/07/18 23:43, Chris Angelico wrote:
> > On Thu, Jul 19, 2018 at 7:16 AM, wrote:
>
On Wed, Jul 25, 2018, 8:27 AM Stephan Houben
wrote:
> Op 2018-07-24, Chris Angelico schreef :
> > On Wed, Jul 25, 2018 at 9:18 AM, Rob Gaddi
> > wrote:
> >> On 07/24/2018 01:07 PM, Chris Angelico wrote:
> >> I suppose one valid usage would be this sort of thing:
> >>
> >> fn = {
> >> int: dis
On Thu, Jul 26, 2018, 10:00 AM Stephan Houben
wrote:
> Op 2018-07-25, Ian Kelly schreef :
>
> > Is there a reason for using singledispatch here rather than a simpler and
> > more readable "if color is None" check?
>
> Yes, the other 20 cases I didn't show.
On Tue, Aug 14, 2018 at 1:41 PM Peter J. Holzer wrote:
>
> On 2018-08-08 05:18:21 +, Gilmeh Serda wrote:
> > And if you read email in blasted HTML, chances are they also have an
> > image that they serve to you on their "beautiful" page you receive, an
> > image whose link which may or may not
On Sun, Aug 19, 2018, 1:47 PM Νίκος wrote:
> Hello,
>
> i just installed bottle and flask web frameworks in my CentOS environment
> but i canno get it working even with the simpleste xample. The coonection
> is refused always.
>
> from bottle import route, run, template
>
> @route('/hello/')
> de
On Fri, Aug 24, 2018 at 3:47 PM wrote:
>
> I am looking for a program able to output a set of integers meeting the
> following requirement:
>
> a(n) is the minimum k > 0 such that n*2^k - 3 is prime, or 0 if no such k
> exists
>
> Could anyone get me started? (I am an amateur)
Is there some kno
On Mon, Sep 24, 2018 at 6:55 AM Robin Becker wrote:
>
> On 23/09/2018 15:45, Albert-Jan Roskam wrote:
> > *sigh*. I'm with Hettinger on this.
> >
> > https://www.theregister.co.uk/2018/09/11/python_purges_master_and_slave_in_political_pogrom/
> >
> I am as well. Don't fix what is not broken. The s
Chris Angelico wrote:
>
> I was neither rude, nor personally attacking anyone.
Actually, the "SJW brigade" remark was quite rude, and a clear attack
on anybody who supports this change.
> Yes, it's an insult. It's the people who believe that they can cure
> social problems by making demands, usu
On Wed, Sep 26, 2018 at 2:01 AM David Palao wrote:
>
> Hello,
> My opinion is that the terms "master/slave" describe well some situations.
> They could be seen by some people as offensive (although unfortunately
> sometimes true, even today) when applied to persons. But it is not
> offensive when
On Wed, Sep 26, 2018 at 7:49 AM Chris Angelico wrote:
>
> On Wed, Sep 26, 2018 at 11:33 PM Ian Kelly wrote:
> >
> > Care to give an example? The distinctive part of the definition of
> > "slave" is that it refers to someone who is owned and/or held captive,
&g
On Tue, Sep 25, 2018 at 10:48 PM Chris Angelico wrote:
>
> On Wed, Sep 26, 2018 at 2:36 PM Ian Kelly wrote:
> > So, Chris, what have *you personally* done about real slavery where it
> > still happens?
> >
> > If, as I'm guessing, the answer is "nothing
On Wed, Sep 26, 2018 at 3:10 PM Brian Grawburg wrote:
>
> This is right next to the objection of the use male and female to describe
> the two parts of a connector. I lament that snowflakes and such are trying
> desperately to enforce their quest for radical egalitarianism and see hidden
> agen
On Wed, Sep 26, 2018 at 3:18 PM Chris Angelico wrote:
>
> On Thu, Sep 27, 2018 at 7:05 AM Ian Kelly wrote:
> >
> > You're objecting to people trying to do *something* positive on the
> > grounds that they're not doing *more* while you yourself are doing
> &g
On Tue, Oct 2, 2018 at 4:50 AM Rhodri James wrote:
>
> On what grounds are you suppressing debate? It is exactly and precisely
> not irrelevant to Python, since it's discussing a Python-specific change
> to known and understood computing terminology, and frankly the statement
> "Continued conside
On Wed, Oct 3, 2018 at 7:47 AM Russell Owen wrote:
> Using asyncio I am looking for a simple way to await multiple events where
> notification comes over the same socket (or other serial stream) in arbitrary
> order. For example, suppose I am communicating with a remote device that can
> run diffe
I'm spit-balling here, but I suspect the problem is that
TimedRotatingFileHandler was probably not designed to have multiple
instances of it in different processes all trying to rotate the same
file. Yet that's the situation you have since each subprocess in your
process pool creates its own handle
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:
> > [...]
> > 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 ...
On Sun, Nov 4, 2018 at 3:58 PM Léo El Amri via Python-list
wrote:
>
> On 04/11/2018 20:25, i...@koeln.ccc.de wrote:
> > I'm having trouble with asyncio. Apparently tasks (asyncio.create_task)
> > are not kept referenced by asyncio itself, causing the task to be
> > cancelled when the creating func
On Mon, Nov 5, 2018 at 8:41 AM wrote:
> > > But anyway, I highly recommend you to use the "await other_coroutine()"
> > > syntax I talked about earlier. It may even fix the issue (90% chance).
> >
> > This should indeed fix the issue, but this is definitely not what one is
> > looking for if one r
On Mon, Nov 5, 2018 at 6:20 PM wrote:
> Again sorry for the confusion, but I don't think this is an issue with
> restarting loops, as this isn't happening in my application.
Sure, I wasn't talking about restarting loops so much as strategies
for making sure that everything has completed in the fi
n Mon, Nov 5, 2018 at 8:43 PM wrote:
>
> On Mon, Nov 05, 2018 at 07:15:04PM -0700, Ian Kelly wrote:
> > > For context:
> > > https://github.com/ldo/dbussy/issues/13
> > > https://gist.github.com/tu500/3232fe03bd1d85b1529c558f920b8e43
> > >
> >
On Tue, Nov 6, 2018 at 3:39 PM Ian Kelly wrote:
>
> n Mon, Nov 5, 2018 at 8:43 PM wrote:
> > What I meant was, the error message is specific to futures in the
> > 'PENDING' state. Which should be set to 'RUNNING' before any actions
> > occur. So
On Thu, Mar 31, 2016 at 9:24 AM, Peter Otten <__pete...@web.de> wrote:
> But note:
>
def get(seq, index, default=None):
> ... return (seq[index:index+1] or [default])[0]
> ...
get("abc", -1, "default")
> 'default'
The discontinuity between -1 and 0 in indexing is a pain in the rear.
On Thu, Mar 31, 2016 at 10:30 AM, Travis Griggs wrote:
>
>> On Mar 30, 2016, at 2:36 PM, Gregory Ewing
>> wrote:
>>
>> Tim Golden wrote:
>>
>>> (I don't know how other English-speaking groups say the word, but in
>>> England the first syllable is stressed and the second is the
>>> conventional s
On Fri, Apr 1, 2016 at 8:42 AM, Random832 wrote:
> On Fri, Apr 1, 2016, at 09:24, Chris Angelico wrote:
>> It is an iterable. It is not a factory, as that implies that you call
>> it.
>
> I do have an objection to this statement. It's perfectly reasonable to
> describe the factory pattern as apply
On Fri, Apr 1, 2016 at 11:14 AM, Matthias welp wrote:
>> An example of the transformation would help here
>
> An example, that detects cycles in a graph, and doesn't do an update if
> the graph has cycles.
Thanks.
> class A(object):
> def __init__(self, parent):
> @prevent_cycles
>
On Fri, Apr 1, 2016 at 2:39 PM, Rob Gaddi
wrote:
> Fillmore wrote:
>> Nope, wrong! contrary to what I thought I had understood about how
>> parameters are passed in Python, the function is acting on a copy(!) and
>> my original list is unchanged.
>>
>
> Nope, that's not your problem. Your problem
On Fri, Apr 1, 2016 at 3:10 PM, Chris Kaynor wrote:
> The overall algorithm is O(n^2), as its doing a O(n) operation in a O(n)
> loop:
Depends on whether the OP expects to find only one match or
potentially multiple matches in the list. E did say "if one of the
elements matches".
If there are on
On Mon, Apr 4, 2016 at 1:42 PM, Wildman via Python-list
wrote:
> commandlist = commandlist.split(",")
commandlist is a list.
> command = [target, commandlist]
> subprocess.Popen(command)
This is passing a list containing two elements: the first is a string,
a
On Tue, Apr 5, 2016 at 8:17 AM, Rustom Mody wrote:
> On Tuesday, April 5, 2016 at 7:19:39 PM UTC+5:30, Jon Ribbens wrote:
>> On 2016-04-03, Jon Ribbens wrote:
>> > I'd just like to say up front that this is more of a thought experiment
>> > than anything else, I don't have any plans to use this id
On Tue, Apr 5, 2016 at 11:48 AM, Chris Angelico wrote:
> Your code is a *lot* safer for using 'eval' rather than 'exec'.
> Otherwise, you'd be easily exploited using exceptions, which carry a
> ton of info. But even so, I would not bet money (much less the
> security of my systems) on this being s
On Tue, Apr 5, 2016 at 7:43 PM, Steven D'Aprano wrote:
> I think Jon is on the right approach here for restricting evaluation of
> evaluation, which is a nicely constrained and small subset of Python. He's
> not allowing unrestricted arbitrary code execution: he has a very
> restricted (too restri
On Wed, Apr 6, 2016 at 10:04 AM, Chris Angelico wrote:
> On Thu, Apr 7, 2016 at 1:41 AM, Ian Kelly wrote:
>> type might also be a concern since it can be used to assemble
>> arbitrary classes.
>
> Sadly, this means denying the ability to interrogate an object for its
>
On Wed, Apr 6, 2016 at 8:14 AM, Marko Rauhamaa wrote:
> Now, if Python had an unlimited range() iterator/iterable, you could use
> a "for" statement to emulate "while".
You can already do this.
>>> class While:
... def __init__(self, predicate):
... self._predicate = predicate
...
On Wed, Apr 6, 2016 at 1:22 PM, Marko Rauhamaa wrote:
> However, BartC's No-Buzzword Python doesn't have classes... If he
> allowed for types.SimpleNamespace, we could have:
>
>
> import types
>
> def While(predicate):
>
On Wed, Apr 6, 2016 at 1:59 PM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Wed, Apr 6, 2016 at 1:22 PM, Marko Rauhamaa wrote:
>>> Why is a SimpleNamespace object not an iterator even though it
>>> provides __iter__ and __next__?
>>
>> Because Python
On Wed, Apr 6, 2016 at 2:39 PM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> On Wed, Apr 6, 2016 at 1:59 PM, Marko Rauhamaa wrote:
>>> It seems to me CPython is being a bit too picky here. Why should it
>>> care if the method is a class method or an object method?
On Thu, Apr 7, 2016 at 12:30 AM, Marko Rauhamaa wrote:
> Or:
>
>When a class attribute reference (for class C, say) would yield a
>class method object, it is transformed into an instance method object
>whose __self__ attributes is C.
>https://docs.python.org/3/reference/datamodel.h
On Thu, Apr 7, 2016 at 11:35 AM, Jon Ribbens
wrote:
> Well, it entirely depends on how much you're trying to allow the
> sandboxed code to do. Most of the stuff in that script (e.g.
> _copy_module and safe versions of get/set/delattr, exec, and eval)
> I don't think is really necessary for most se
On Thu, Apr 7, 2016 at 1:32 PM, Marko Rauhamaa wrote:
> Paul Rubin :
>
>> Chris Angelico writes:
>>> First off, what does it actually *mean* to have a tree with numbers
>>> and keys as strings? Are they ever equal? Are all integers deemed
>>> lower than all strings? Something else?
>>
>> If the A
On Thu, Apr 7, 2016 at 2:56 PM, Antoon Pardon
wrote:
> Op 07-04-16 om 14:22 schreef Chris Angelico:
>
> ...
>
>> There's no __cmp__ method, but you could easily craft your own
>> compare() function:
>>
>> def compare(x, y):
>> """Return a number < 0 if x < y, or > 0 if x > y"""
>> if x ==
On Apr 7, 2016 10:22 PM, "Marko Rauhamaa" wrote:
>
> Ian Kelly :
>
> > On Thu, Apr 7, 2016 at 1:32 PM, Marko Rauhamaa wrote:
> >> I use AVL trees to implement timers. You need to be able to insert
> >> elements in a sorted order and remove them quickl
On Fri, Apr 8, 2016 at 3:23 AM, Steven D'Aprano wrote:
> On Fri, 8 Apr 2016 06:34 pm, Marko Rauhamaa wrote:
>
>> Antoon Pardon :
>>
>>> In python2 descending the tree would only involve at most one
>>> expensive comparison, because using cmp would codify that comparison
>>> into an integer which w
On Fri, Apr 8, 2016 at 8:08 AM, Chris Angelico wrote:
> On Fri, Apr 8, 2016 at 11:31 PM, Antoon Pardon
> wrote:
>> Doing it as follows:
>> seq1 < seq2
>> seq2 < seq1
>>
>> takes about 110 seconds.
>>
>>
>> Doing it like this:
>> delta = cmp(seq1, seq2)
>> delta < 0
>> delta >
On Fri, Apr 8, 2016 at 10:33 AM, Marko Rauhamaa wrote:
> Ian Kelly :
>
>> That's fine for those operations and probably insert, but how do you
>> search an AVL tree for a specific key without also using
On Fri, Apr 8, 2016 at 11:50 AM, Rob Gaddi
wrote:
> Sort of. If I've got a directory full of files (in a package)
> that I'm working on, the relative import semantics change based on
> whether I'm one directory up and importing the package or in the same
> directory and importing the files locall
On Sat, Apr 9, 2016 at 7:49 AM, Joseph Caulfield
wrote:
> On Saturday, April 9, 2016 at 2:48:16 PM UTC+1, Joseph Caulfield wrote:
>> how would I model a mug a cylindrical vessel with an open top in python?
>> thansk :)
>
> *as a cylindrical vessel.
class Vessel:
def __init__(self, shape, o
On Fri, Apr 8, 2016 at 5:54 PM, Alexander Myodov wrote:
> Hello.
>
> TLDR: how can I use something like loop.run_until_complete(coro), to execute
> a coroutine synchronously, while the loop is already running?
>
> More on this:
>
> I was trying to create an aio_map(coro, iterable) function (which
On Sat, Apr 9, 2016 at 9:14 AM, Ian Kelly wrote:
> On Fri, Apr 8, 2016 at 5:54 PM, Alexander Myodov wrote:
> This does mean that the pattern for calling aio_map from outside the
> event loop is different from calling it inside the event loop. Your
> main_loop coroutine becomes (note
On Sat, Apr 9, 2016 at 8:18 AM, Joe wrote:
> How to find the number of robots needed to walk through the rectangular grid
> The movement of a robot in the field is divided into successive steps
>
> In one step a robot can move either horizontally or vertically (in one row or
> in one column of ce
On Sat, Apr 9, 2016 at 9:09 PM, pyotr filipivich wrote:
> ASINTOER are the top eight English letters (not in any order, it
> is just that "A Sin To Err" is easy to remember.
What's so hard to remember about ETA OIN SHRDLU? Plus that even gives
you the top twelve. :-)
--
https://mail.pyth
On Wed, Apr 13, 2016 at 7:50 AM, Grant Edwards
wrote:
> FWIW, as an old Pascal programmer, I too would have been surprised
> that an "enum" is not ordinal and doesn't support a next/prev and
> iteration.
They do support iteration, but it's by order of declaration, not by value.
--
https://mail.p
On Wed, Apr 13, 2016 at 8:27 AM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> Let's just guess that you want to xor with the byte value 0xAA. We can
>> do that fairly simply, using integer operations.
>>
> data = b'$//W?\xc0\x829\xa2\xb9\x13\x8c\xd5{\\'
> bytes(b ^ 0xAA for b in data)
>>
On Wed, Apr 13, 2016 at 9:53 AM, salma ammar wrote:
> Hi,
>
> I am about to run this code using python 2.7. But when executing this code,
> an error appears (see attachement): IdentationError; unexpected indent
>
> What should I rectify to correct this error please?
First of all, please post your
On Wed, Apr 13, 2016 at 10:15 AM, alister wrote:
> On Wed, 13 Apr 2016 06:18:22 -0700, durgadevi1 wrote:
>
>> Hi all,
>>
>> I have a doubt regarding a problem.
>>
> No, you have a question doubt means you don't believe something
> (sorry I know this is not an English language lesson)
No, this is
On Sat, Apr 16, 2016 at 4:30 PM, Marko Rauhamaa wrote:
>
> Java generics ruined a perfectly good language. I mean:
>
> Map> customersOfAccountManager =
> new HashMap>();
>
> where classic Java would have:
>
> Map customersOfAccountManager = new HashMap();
The diamond operator in J
On Sun, Apr 17, 2016 at 12:24 PM, Pavol Lisy wrote:
> 2016-04-09 17:43 GMT+02:00, Steven D'Aprano :
>> flag ^ flag is useful since we don't have a boolean-xor operator and
>> bitwise-xor does the right thing for bools. And I suppose some people
>> might prefer & and | over boolean-and and boolean-
On Mon, Apr 18, 2016 at 3:14 PM, Pete Forman wrote:
> Why is it that Python continues to use a fixed width font and therefore
> specifies the maximum line width as a character count?
>
> An essential part of the language is indentation which ought to continue
> to mandate that lines start with a m
On Thu, Apr 21, 2016 at 7:52 PM, Paulo da Silva
wrote:
> Às 22:43 de 21-04-2016, Paulo da Silva escreveu:
>> Hi.
>>
>> Why in this code fragment self.__name is not kept between pickle
>> dumps/loads? How to fix it?
>>
>> Thanks.
>>
>> import pickle
>> import pandas as pd
>> import numpy as np
>>
>
On Fri, Apr 22, 2016 at 2:21 PM, Paulo da Silva
wrote:
> Às 17:27 de 22-04-2016, Ian Kelly escreveu:
>> On Thu, Apr 21, 2016 at 7:52 PM, Paulo da Silva
>> wrote:
>>> Às 22:43 de 21-04-2016, Paulo da Silva escreveu:
> ...
>
>>
>> Probably this is necess
On Sat, Apr 23, 2016 at 7:00 PM, Christopher Reimer
wrote:
> On 4/21/2016 9:46 PM, Ethan Furman wrote:
>>
>> Oh! and Enum!!! ;)
>
>
> OMG! I totally forgot about Enum. Oh, look. Python supports Enum. Now I
> don't have to roll my own!
>
> Hmm... What do we use Enum for? :)
Python enums are great
On Sun, Apr 24, 2016 at 1:20 AM, Ethan Furman wrote:
> On 04/23/2016 06:29 PM, Ian Kelly wrote:
>
>> Python enums are great. Sadly, they're still not quite as awesome as Java
>> enums.
>
>
> What fun things can Java enums do?
Everything that Python enums can do, p
On Sun, Apr 24, 2016 at 10:04 AM, Ethan Furman wrote:
> On 04/24/2016 08:20 AM, Ian Kelly wrote:
>> * Java doesn't have the hokey notion of enum instances being distinct
>> from their "value". The individual enum members *are* the values.
>> Whereas in Pytho
On Tue, Apr 26, 2016 at 10:01 AM, wrote:
> I am wondering how to make my code function so it does not allow any of the
> same values to be entered into a column in my CSV file created through
> python. So I need to read into the CSV file and check if any names have
> already been entered. If t
On Tue, Apr 26, 2016 at 11:13 AM, Chris Kaynor wrote:
> Yah, if you really wanted to make it work properly, you'd need to incref
> the newValue, while decref the oldValue. The incref would not be that
> difficult, but the decref would be more challenging, as you may have to
> also destroy the old
On Tue, Apr 26, 2016 at 11:00 AM, Adam Davis wrote:
> On Tuesday, 26 April 2016 17:14:36 UTC+1, Ian wrote:
>> On Tue, Apr 26, 2016 at 10:01 AM, wrote:
>> > I am wondering how to make my code function so it does not allow any of
>> > the same values to be entered into a column in my CSV file cr
On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola
wrote:
> Just an example. Didn't use the csv but just hope that it helps.
>
> name=[]
> name_exist="Dop"
>
> with open("dop.csv") as f:
> for line in f:
> line_split=line.split(',')
> name.append(line_strip[0])
On Tue, Apr 26, 2016 at 2:07 PM, Adam Davis wrote:
> On Tuesday, 26 April 2016 20:52:54 UTC+1, Ian wrote:
>> On Tue, Apr 26, 2016 at 1:05 PM, Joaquin Alzola
>> wrote:
>> > Just an example. Didn't use the csv but just hope that it helps.
>> >
>> > name=[]
>> > name_exist="Dop"
>> >
>> > with open
On Tue, Apr 26, 2016 at 3:33 PM, D.M. Procida
wrote:
> I have PyGame installed.
>
> As soon as I run pygame.init() or pygame.display.init(), a PyGame icon
> will pop up in the Dock, and then its application will simply stop
> responding. Needless to say, I can't actually do anything with it.
>
> W
On Tue, Apr 26, 2016 at 11:31 PM, Ethan Furman wrote:
> On 04/26/2016 08:43 PM, Christopher Reimer wrote:
>
>> If I'm using a dictionary to store variables for an object, and
>> accessing the variable values from dictionary via property decorators,
>> would it be better to derive the class from ob
On Tue, Apr 26, 2016 at 9:43 PM, Christopher Reimer
wrote:
> class Test2(dict):
> def __init__(self):
> self.__dict__ = {'key', 'value'}
This class definition looks muddled. Because Test2 inherits from dict,
the object referred to by "self" will be a dict, and self.__d
On Mon, May 2, 2016 at 3:52 AM, Adam Davis wrote:
> Hi Ian,
>
> I'm really struggling to implement a set into my code as I'm a beginner,
> it's taking me a while to grasp the idea of it. If I was to show you my code
> so you get an idea of my aim/function of the code, would you be able to help
> m
On Sat, May 7, 2016 at 9:28 PM, DFS wrote:
> But I think there are some pylint bugs here:
> -
>
> standard import "import pyodbc, sqlite3" comes before "import pyodbc,
> sqlite3" (wrong-import-order)
>
> * complains that the
On May 8, 2016 12:42 AM, "Steven D'Aprano" wrote:
>
> def pvariance(data, mu=None):
> if iter(data) is data:
> data = list(data)
> n = len(data)
> if n < 1:
> raise StatisticsError('pvariance requires at least one data
point')
> ss = _ss(data, mu)
> T, ss = _ss(
On May 8, 2016 9:37 AM, "Steven D'Aprano" wrote:
>
> Not sure why this has migrated to this list instead of Python-Ideas.
Because Gmail has somehow never gotten around to implementing reply-to-list
and I'm terrible at choosing the right one.
--
https://mail.python.org/mailman/listinfo/python-lis
On Tue, May 10, 2016 at 10:16 AM, DFS wrote:
> On 5/9/2016 3:53 AM, Steven D'Aprano wrote:
>>
>> On Monday 09 May 2016 09:10, DFS wrote:
>>
>>> sSQL = "line 1\n"
>>> sSQL += "line 2\n"
>>> sSQL += "line 3"
>>
>>
>> Pointlessly provocative subject line edited.
>
>
>
> huh? You called yourself a "
On Wed, May 18, 2016 at 9:47 AM, Steven D'Aprano wrote:
> Extracting the first N or last N characters of a string is easy with
> slicing:
>
> s[:N] # first N
> s[-N:] # last N
>
> Getting the middle N seems like it ought to be easy:
>
> s[N//2:-N//2]
>
> but that is wrong. It's not even the righ
On Wed, May 18, 2016 at 11:15 AM, Steven D'Aprano wrote:
> I don't really understand why the system can't track the current top of the
> stack and bottom of the heap, and if they're going to collide, halt the
> process. That would still be kinda awful, in a sudden "your application
> just died" ki
On Thu, May 19, 2016 at 10:31 AM, Herkermer Sherwood wrote:
> Most keywords in Python make linguistic sense, but using "else" in for and
> while structures is kludgy and misleading. I am under the assumption that
> this was just utilizing an already existing keyword. Adding another like
> "andthen
On Thu, May 19, 2016 at 2:01 PM, Chris Angelico wrote:
> On Fri, May 20, 2016 at 3:46 AM, Steven D'Aprano wrote:
>> The idea of finally is
>> that it executes no matter what happens[1].
>>
>> [1] Well, *almost* no matter what. If you pull the power from the computer,
>> the finally block never ge
On Sat, May 21, 2016 at 5:26 AM, Steven D'Aprano wrote:
> Does anyone know of other languages that include the same feature? It's very
> rare for Python to innovate in language features.
>
> (I wonder if it came from ABC?)
According to Raymond Hettinger starting at about 15:50 in this video:
htt
On Sun, May 22, 2016 at 11:55 AM, Jon Ribbens
wrote:
> On 2016-05-22, Random832 wrote:
>> On Sun, May 22, 2016, at 12:46, Jon Ribbens wrote:
>>> Sorry, I have to stop you there as the entire premise of your post is
>>> clearly wrong. "int" is not "an approximation of real numbers", it's
>>> a mod
On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano
wrote:
> Are you saying that the Egyptians, Babylonians and Greeks didn't know how to
> work with fractions?
>
> http://mathworld.wolfram.com/EgyptianFraction.html
>
> http://nrich.maths.org/2515
>
> Okay, it's not quite 4000 years ago. Sometimes my
On Mon, May 23, 2016 at 8:29 AM, Ben Bacarisse wrote:
> Ian Kelly writes:
>
>> On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano
>> wrote:
>>> Are you saying that the Egyptians, Babylonians and Greeks didn't know how to
>>> work with f
On Mon, May 23, 2016 at 9:53 AM, Ian Kelly wrote:
> I'm not sure where ℝ comes into this in the first place. Existing
> Python numeric types only represent various subsets of ℚ (in the case
> of fractions.Fraction, the entirety of ℚ).
And of course I realized after sending that
On Mon, May 23, 2016 at 10:39 AM, Robin Becker wrote:
> I had always imagined that the str founction did some kind of rounding on
> floats to prevent small numerical errors from showing up. The 2.7
> documentation starts like this
>
>> class str(object='')
>> Return a string containing a nicely pr
On Mon, May 23, 2016 at 11:44 AM, Random832 wrote:
> On Mon, May 23, 2016, at 13:33, Chris Angelico wrote:
>> and then you can use the special "tagged literal" syntax, like with
>> special forms of string literal:
>>
>> >>> f*22/7 + f*2/11
>> Fraction(256, 77)
>
> I like the infix fraction literal
On Mon, May 23, 2016 at 12:16 PM, Pete Forman wrote:
> Something else which I do not think has been stated yet in this thread
> is that floating point is an inexact representation. Just because
> integers and binary fractions have an exact correspondence we ought not
> to be affording them special
On Mon, May 23, 2016 at 9:30 AM, Rustom Mody wrote:
> Yes the point is being missed but in a different direction:
> The SET (as a completed whole) of real numbers (ℝ) is no more than a 100 years
> old.
> People may have used fractions earlier
>
> And even here the first line of Steven's http://nri
1301 - 1400 of 3558 matches
Mail list logo