r all
> arrays and strings, as some more or less obsolete languages do. I
> think this is more intuitive, since most people (including
> mathematicians) start counting at "1". The reason for starting at
> "0" is easier memory address calculation, so nothing for really high
> level languages.
Personnaly I would like to have the choice. Sometimes I prefer to
start at 0, sometimes at 1 and other times at -13 or +7.
--
Antoon Pardon
--
http://mail.python.org/mailman/listinfo/python-list
Op 2005-04-20, Bill Mill schreef <[EMAIL PROTECTED]>:
> On 20 Apr 2005 12:52:19 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
>> Op 2005-04-20, Torsten Bronger schreef <[EMAIL PROTECTED]>:
>> > Hallöchen!
>> >
>> > [EMAIL PROTECTED] (Nic
Op 2005-04-20, Roy Smith schreef <[EMAIL PROTECTED]>:
> Antoon Pardon <[EMAIL PROTECTED]> wrote:
>
>> Personnaly I would like to have the choice. Sometimes I prefer to
>> start at 0, sometimes at 1 and other times at -13 or +7.
>
> Argggh. Having two (or m
Op 2005-04-20, Bill Mill schreef <[EMAIL PROTECTED]>:
> On 20 Apr 2005 13:39:42 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
>> Op 2005-04-20, Bill Mill schreef <[EMAIL PROTECTED]>:
>>
>> You write this af if other solutions can't be consistent.
>
Op 2005-04-20, Roy Smith schreef <[EMAIL PROTECTED]>:
> Antoon Pardon <[EMAIL PROTECTED]> wrote:
>>Op 2005-04-20, Roy Smith schreef <[EMAIL PROTECTED]>:
>>> Antoon Pardon <[EMAIL PROTECTED]> wrote:
>>>
>>>> Personnaly I would
are normally
counted. If I go and ask my colleague which field
contains some specific data and he answers:
the 5th, I have to remind my self I want lst[4]
This is often a cause for errors.
--
Antoon Pardon
--
http://mail.python.org/mailman/listinfo/python-list
Op 2005-04-20, Terry Hancock schreef <[EMAIL PROTECTED]>:
> On Wednesday 20 April 2005 07:52 am, Antoon Pardon wrote:
>> Personnaly I would like to have the choice. Sometimes I prefer to
>> start at 0, sometimes at 1 and other times at -13 or +7.
>
> Although I would c
. So if you wanted the last element you had to write:
lst[$]
And for the next to last element:
lst[$ - 1]
This would make accessing list elements counted from the rear
almost just as easy as it is now but wouldn't interfere with
the ask forgiveness programming style.
--
Antoon Pardon
--
http://mail.python.org/mailman/listinfo/python-list
Op 2005-04-21, Raymond Hettinger schreef <[EMAIL PROTECTED]>:
> [Antoon Pardon]
>> I don't see why the start index can't be accessible through
>> a method or function just like the length of a list is now.
>>
>> My favourite would be a range met
Op 2005-04-21, Raymond Hettinger schreef <[EMAIL PROTECTED]>:
>> > [Antoon Pardon]
>> >> I don't see why the start index can't be accessible through
>> >> a method or function just like the length of a list is now.
>> >>
>>
Op 2005-04-21, Reinhold Birkenfeld schreef <[EMAIL PROTECTED]>:
> Antoon Pardon wrote:
>
>> I sometimes think python should have been more explicite here,
>> using a marker for the start-index and end-index, may '^' and
>> '$'. So if you want
.
That you are forced to use zero-based structures, while the
problem space you are working on uses one-based structures
is a far bigger stumbling block where you continually have
to be aware that the indexes in your program are one off
from the indexes the problem is expressed in.
The one obvious way is to use the same index scheme as the
one that is used in the specification or problem setting.
Not to use always zero no matter what.
--
Antoon Pardon
--
http://mail.python.org/mailman/listinfo/python-list
Op 2005-04-21, Reinhold Birkenfeld schreef <[EMAIL PROTECTED]>:
> Antoon Pardon wrote:
>> Op 2005-04-21, Reinhold Birkenfeld schreef <[EMAIL PROTECTED]>:
>>> Antoon Pardon wrote:
>>>
>>>> I sometimes think python should have been more explicite he
Op 2005-04-21, Dan Bishop schreef <[EMAIL PROTECTED]>:
> Antoon Pardon wrote:
>> Op 2005-04-21, Steve Holden schreef <[EMAIL PROTECTED]>:
>> > [EMAIL PROTECTED] wrote:
> ...
>> >> Along the same lines, I think the REQUIREMENT that x[0] rather
> tha
that argument
> in the past and am not interested in rearguing it.
That is correct but is expecting too much from people in general.
Expecting from frustrated people to act rational and constructive
is just a recipe for your own frustrations. And your own reaction
illustrates the problem beautifully because you come with an
irrational non-constructive proposal, that is very unlikely to
motivate people in actually want to cooperate with you in getting
this community to be more positive again.
--
Antoon Pardon.
--
https://mail.python.org/mailman/listinfo/python-list
ve tried so hard to help
>> on so many occasions, but have consistently seen their help rejected, and
>> the responders who finally get fed up.
>
> And then it all goes meta. This thread hasn't had anything productive
> for quite some time now... nor even anything funny.
Well if
Op 12-11-13 14:02, Ian Kelly schreef:
> On Tue, Nov 12, 2013 at 2:09 AM, Antoon Pardon
> wrote:
>> So you are complaining about people being human. Yes that is
>> how people tend to react when they continualy are frustrated
>> by someone who refuses to show the slighte
like object? Something else?
This is not python specific, the answer to those questions is needed no matter
what language you use to implement your function.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
news group. And only taking the
venters to task while ignoring the spoon feeders will mostly result in
not be taken serious and will produce rather bad will than good will to
your goal.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 13-11-13 01:41, Steven D'Aprano schreef:
> On Tue, 12 Nov 2013 17:27:08 +0100, Antoon Pardon wrote:
>
>>> Somebody has to
>>> accept the responsibility to walk away and break the positive feedback
>>> loop, or it will never end. And I can't see Nikos
Op 12-11-13 22:26, Ian Kelly schreef:
> On Tue, Nov 12, 2013 at 9:27 AM, Antoon Pardon
> wrote:
>> Op 12-11-13 14:02, Ian Kelly schreef:
>>> On Tue, Nov 12, 2013 at 2:09 AM, Antoon Pardon
>>> wrote:
>>>> So you are complaining about people being human.
as
a solution completely to your satisfaction. You also displayed no
interest in actual learning but expected others to do your work.
This is a pattern that is repeated numerous times and people are
getting utterly fed up with it. So when you come around for yet
another round of the same, frustration le
ll. Remember that the name of
> this group is comp.lang.python. It's *not*
> alt.misc.flame.trolls.nikos.sucks.
It is also not alt.misc.keep.spoon.feeding.nikos.
> The topic here is Python, and if
> you want to talk about that, then welcome and please do. If on the
> other hand you just want to vent your frustration, then find somewhere
> else to do it. Please.
But if you want to spoon feed a help vampire to the detriment of the
group you can go right ahead?
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
ther. They frustrate a
significant number of members because it encourages Nikos in his
destructive behaviour. Continuing to spoon feed Nikos will only make
the frustration levels rise until they reach a level where someone
will feel the need to vent.
So if you can't resist wanting
not the main issue. The python write only works with bytes or
strings, not with floats or ints. So you will have to convert your
numbers using struct. So the question is if you know the byte layout
fortran uses and if you can replicate it with the struct module.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
rogrammer doesn't
have to care about the internal reprensentation of (long) integers. It
is an implemantation detail that is mostly ignorable.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
> root@secure [~]# which python3
> /usr/bin/python3
> root@secure [~]#
>
> The only thing i can think of is that those packages have installed under
> default python 2.6.6 and not under Python 3.3.2.
>
> Can this be the case here?
It can be the case. Now think of
on questions from him. With respect to python questions: Don't
spoon feed him. Don't answer his questions for him or do his work for
him. Give him the information he needs to find things out himself,
preferably refer him to the documentation.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 16-11-13 22:44, Mark Lawrence schreef:
> On 16/11/2013 21:26, Antoon Pardon wrote:
>>
>> Please don't encourage our Help Vampire. I know this is generally a
>> welcoming community that is generous with its expertise, even if
>> someone asks questions beyo
t be consistent
with the past, because that would mean that should a second Nikos arrive here
the chance of repeating the past would be very high. So of course people
will get the code of conduct trust down on them sooner than happened in the
past.
AFAICS, Ned is putting a lot of energy into trying to limit the damage that
Nikos's threads can impose of the list. Is it perfect? No, but I very much
appreciate what he is doing none the less because it is far more preferable
than what happened in the past.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
ation.
--
Antoon Pardon
Op 18-11-13 10:31, YBM schreef:
> You are the one being rude, Nikos.
>
> Moreover you are a nut, installing pygeoip works fine
> for me:
>
> # pip install pygeoip
> Downloading/unpacking pygeoip
> Downloading pygeoip-0.3.0.tar.gz (97Kb): 97Kb downloaded
as "typical shabby
> Nazi trick" was one of Captain Mainwearing's main lines.
Honestly? You expect people to recognize a main line from an old
television series?
> And if I want
> to overreact, I'll overreact, as I couldn't care two hoots whether I'm
> dealing with an arsehole from the Python Software Foundation or one
> who's not.
Now you sound just like Nikos.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
>> and
>>
>> obj = MyClass().spam().eggs().cheese()
>>
>>
>> except the first takes up a lot more vertical space.
>
> I've not yet run short of vertical space ;)
Really? Then you must write only very short programs. Me I
continuously run out of vertical space. That is why I need
to use such tools as scroll bars.
--
Antoon Pardon.
--
https://mail.python.org/mailman/listinfo/python-list
you are burdening the programmer with implemantation details
that don't matter to him.
IMO if Foo.foo() is legal then Foo.foo is callable. That the actual call
is delegated to Foo.foo.__get__(None, Foo) shouldn't matter.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 23-11-13 22:51, Peter Otten schreef:
> Antoon Pardon wrote:
>
>> Op 23-11-13 10:01, Peter Otten schreef:
>>
>>>
>>> Your script is saying that a staticmethod instance is not a callable
>>> object. It need not be because
>>>
>>> Fo
Op 24-11-13 11:43, Peter Otten schreef:
> Antoon Pardon wrote:
>
>> Foo.foo() being legal and Foo.foo not being callable is IMO a bug in
>> python.
>
> Foo.foo() is legal, and Foo.foo is callable.
Indeed, I had a kink in my brain which made it difficult to see
where
Op 24-11-13 12:03, Peter Otten schreef:
> Antoon Pardon wrote:
>
>> Op 23-11-13 10:01, Peter Otten schreef:
>>
>>>
>>> Your script is saying that a staticmethod instance is not a callable
>>> object. It need not be because
>>>
>>> Fo
or perhaps "two code samples", while an Indian speaker
> might say "give me two codes".
>
> As this is an international forum, it behoves us all to make allowances
> for slight difference in dialect.
I don't see how that follows. I would say on the contrary
Op 25-11-13 21:00, Ethan Furman schreef:
> On 11/25/2013 11:53 AM, Antoon Pardon wrote:
>> Op 23-11-13 03:18, Steven D'Aprano schreef:
>>>
>>> As this is an international forum, it behoves us all to make allowances
>>> for slight difference in dialect.
&g
erence in dialect.
>>
>> I don't see how that follows. I would say on the contrary. This being
>> an international forum people should try to reframe from burdening
>> lots of other people with expressions most people will not understand
>> or even misunderstan
Op 26-11-13 15:37, Roy Smith schreef:
> In article ,
> Antoon Pardon wrote:
>
>> So I think we may expect more effort from the writer in trying to be
>> understandable than from the readers in trying to understand. And
>> that includes idiom use.
>
>
Op 26-11-13 22:42, Tim Delaney schreef:
> On 27 November 2013 03:57, Antoon Pardon <mailto:antoon.par...@rece.vub.ac.be>> wrote:
>
>
> So I can now ask my questions in dutch and expect others to try and
> understand me instead of me asking them in english? Or
Op 27-11-13 09:19, Chris Angelico schreef:
> On Wed, Nov 27, 2013 at 7:16 PM, Antoon Pardon
> wrote:
>> However that second sentence doesn't make much sense to me. Modern
>> languages contain a subset that is called the standard language. This
>> is the subset that is
Op 27-11-13 09:36, Chris Angelico schreef:
> On Wed, Nov 27, 2013 at 7:31 PM, Antoon Pardon
> wrote:
>> Op 27-11-13 09:19, Chris Angelico schreef:
>>> On Wed, Nov 27, 2013 at 7:16 PM, Antoon Pardon
>>> wrote:
>>>> However that second sentence doesn'
uage designer might choose to allow a bigger set of characters
in identifiers like '-', '+' and others. In that case a-b would be
an identifier and a - b would be the operation. Just as in python
fromAimportB is an identifier and from A import B is an import
statement.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 04-12-13 13:01, rusi schreef:
> On Wednesday, December 4, 2013 3:59:06 PM UTC+5:30, Antoon Pardon wrote:
>> Op 04-12-13 11:09, rusi schreef:
>>> I used the spaces case to indicate the limit of chaos.
>>> Other characters (that
>>> already have uses) are just
Op 04-12-13 14:02, rusi schreef:
> On Wednesday, December 4, 2013 6:02:18 PM UTC+5:30, Antoon Pardon wrote:
>> Op 04-12-13 13:01, rusi schreef:
>>> On Wednesday, December 4, 2013 3:59:06 PM UTC+5:30, Antoon Pardon wrote:
>>>> Op 04-12-13 11:09, rusi schreef:
&
n or, and or not port and search for those whose value is 10101010,
11001100 and .
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 23-11-15 om 14:58 schreef Steven D'Aprano:
> On Mon, 23 Nov 2015 09:40 pm, BartC wrote:
>
>> On 23/11/2015 07:47, Steven D'Aprano wrote:
>>
>>> I think it would be cleaner and better if Python had dedicated syntax for
>>> declaring static local variables:
>>
>> Interesting. So why is it that wh
Op 24-11-15 om 15:34 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
> wrote:
>>> Start thinking of it as a constructor call rather than a literal, and
>>> you'll get past most of the confusion.
>>
>> That doesn't change the
Op 24-11-15 om 15:34 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
> wrote:
>>> Start thinking of it as a constructor call rather than a literal, and
>>> you'll get past most of the confusion.
>>
>> That doesn't change the
Op 24-11-15 om 15:18 schreef Ned Batchelder:
> 2) In Python, "value" means, what object does a name refer to, or what
> object did an evaluation produce.
I don't think this is correct because that would imply that objects don't
change values (since the value would be the object).
When a list is
Op 24-11-15 om 15:34 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
> wrote:
>>> Start thinking of it as a constructor call rather than a literal, and
>>> you'll get past most of the confusion.
>>
>> That doesn't change the
Op 24-11-15 om 16:17 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 2:03 AM, Antoon Pardon
> wrote:
>> Op 24-11-15 om 15:34 schreef Chris Angelico:
>>> On Wed, Nov 25, 2015 at 1:24 AM, Antoon Pardon
>>> wrote:
>>>>> Start thinking of it as
Op 24-11-15 om 16:48 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 2:46 AM, Antoon Pardon
> wrote:
>> What is your point? I say that [] looks like a literal. Because it
>> sure resembles () which is a literal.
>>
>> That [] in fact isn't a literal does
Op 24-11-15 om 17:56 schreef Ian Kelly:
>
>> So on what grounds would you argue that () is not a literal.
>
> This enumerates exactly what literals are in Python:
>
> https://docs.python.org/3/reference/lexical_analysis.html#literals
>
> I think it's a rather pedantic point, though. How are nu
Op 24-11-15 om 18:46 schreef Terry Reedy:
> On 11/24/2015 9:34 AM, Antoon Pardon wrote:
>
> I agree that the tutorial should talk about default argument objects (which
> have values) instead of conflating 'object' with 'value'.
>
>> Op 20-11-15 om 13:
Op 24-11-15 om 18:53 schreef Ian Kelly:
> On Tue, Nov 24, 2015 at 10:32 AM, Antoon Pardon
> wrote:
>> Op 24-11-15 om 17:56 schreef Ian Kelly:
>>
>>>
>>>> So on what grounds would you argue that () is not a literal.
>>>
>>> This enum
mpile -42 into
a byte code for 42 and a negation. Just as it could compile 42 into byte
code for adding 32, 8 and 2.
The point is, that the reverse isn't true. It couldn't compile [5, 8, 13]
into a LOAD_CONST.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 24-11-15 om 22:14 schreef BartC:
> On 24/11/2015 20:54, Antoon Pardon wrote:
>> Op 24-11-15 om 20:15 schreef Ian Kelly:
>>
>>>> But no matter what you want to call it. The dis module shows that
>>>> -42 is treated in exactly the same way as 42, which
Op 20-11-15 om 01:33 schreef Steven D'Aprano:
> On Fri, 20 Nov 2015 07:57 am, Marko Rauhamaa wrote:
>
>> Laura Creighton :
>>
>>> My experience says that the people who are confused want lists to
>>> behave like tuples. period. i.e. they don't want lists to be mutable.
>> I think it's simpler than
Op 25-11-15 om 09:32 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 7:14 PM, Antoon Pardon
> wrote:
>> What exactly is your point? People's confusions don't disappear
>> because you as an expert have a good understanding of what is
>> going on and so are no l
Op 25-11-15 om 01:55 schreef Laura Creighton:
> In a message of Wed, 25 Nov 2015 11:39:54 +1100, "Steven D'Aprano" writes:
>> I'm not sure what value [ha, see what I did there?!] there is in inventing
>> two new words for things that we already have standard terms for.
> Done correctly, you can get
Op 25-11-15 om 01:36 schreef Steven D'Aprano:
> On Wed, 25 Nov 2015 08:25 am, Antoon Pardon wrote:
>
>> The point is that a
>> tuple can just be loaded as a constant without needing something extra.
>
> How would one load this tuple as a constant?
>
> (myfile.rea
Op 23-11-15 om 09:57 schreef Peter Otten:
> Quivis wrote:
>
>> On Thu, 19 Nov 2015 12:40:17 +0100, Peter Otten wrote:
>>
>>> those questions that are a little harder
>> And just how is he going to determine what is hard?
> Note that I said "a little harder", not "hard".
>
> Write down your next ten
Op 25-11-15 om 11:52 schreef Steven D'Aprano:
> On Wed, 25 Nov 2015 07:14 pm, Antoon Pardon wrote:
>
>> Op 20-11-15 om 01:33 schreef Steven D'Aprano:
>>> On Fri, 20 Nov 2015 07:57 am, Marko Rauhamaa wrote:
>>>
>>>> Laura Creighton :
>>&g
Op 20-11-15 om 08:49 schreef dieter:
> In addition, the last few days have had two discussions in this list
> demonstrating the conceptial difficulties of late binding -- one of them:
>
> Why does "[lambda x: i * x for i in range(4)]" gives
> a list of essentially the same functions?
C
Op 25-11-15 om 14:24 schreef Chris Angelico:
> On Wed, Nov 25, 2015 at 11:25 PM, Antoon Pardon
> wrote:
>>> But there's a big difference between those who guess wrong from a position
>>> of ignorance, and then make an honest attempt to understand the behaviour
>
Op 25-11-15 om 18:40 schreef Steven D'Aprano:
> On Wed, 25 Nov 2015 08:56 pm, Antoon Pardon wrote:
>
>> Since (x, y, z) is not a fixed value, it is not a literal.
>
> Right. And therefore, (x, y, z) syntax is not syntax for a literal. Hence
> why the Python docs call
Op 25-11-15 om 21:39 schreef Ian Kelly:
> On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon
> wrote:
>> I don't know what you are talking about. The first thing I have argued
>> is that () is a literal. Then I have expaned that to that something
>> like (3, 5, 8) is a
Op 25-11-15 om 23:38 schreef Ian Kelly:
> On Wed, Nov 25, 2015 at 2:05 PM, Antoon Pardon
> wrote:
>> Op 25-11-15 om 21:39 schreef Ian Kelly:
>>
>>> I believe that sentence from the docs is using "some" to mean "not
>>> all", whereas you
Op 26-11-15 om 02:52 schreef Ned Batchelder:
> I almost started to explain about how yes, Python is often written in
> conservative static ways. I was going to mention that a little dynamic
> nature goes a long way, and is never far from the surface in even the
> simplest Python programs.
>
> But I
Op 26-11-15 om 09:27 schreef Marko Rauhamaa:
> Chris Angelico :
>
>> On Thu, Nov 26, 2015 at 5:52 PM, Marko Rauhamaa wrote:
>>> Nothing prevents using mutable objects as keys in Python.
>> Sure, you _can_. But if the key's hash changes between dict insertion
>> and retrieval, all manner of invaria
Op 26-11-15 om 12:13 schreef Nobody:
> Returning to the original expression:
>
> > q = [lambda x: i * x for i in range(4)]
> > q[0](1), q[3](1)
> (3, 3)
> > q = [lambda x,i=i: i * x for i in range(4)]
> > q[0](1), q[3](1)
> (0, 3)
Personnaly I would prefer:
>>>
Op 26-11-15 om 12:49 schreef Chris Angelico:
> I can't remember which language it was (maybe Lua?), but I know
> there's one that uses a machine word to store either a pointer to a
> heap object, or an integer of at most one less bit than the machine
> word, represented by 2*n+1.
I think that was
Op 26-11-15 om 13:56 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> Personnaly I would prefer:
>>
>>>>> q = [(lambda i: lambda x: i * x)(i) for i in range(4)]
>>>>> q[0](1), q[3](1)
>> (0, 3)
>>
>> And this is where I ask whether
Op 26-11-15 om 14:56 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> I don't understand. What I propose would be a minor change in
>> how list comprehension works. I don't see how your example
>> can be turned into a list comprehension.
> The list compre
Op 26-11-15 om 16:36 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> [ for in ]
>>
>> would implicitly be rewritten as follows:
>>
>> [ (lambda : )() for in ]
>
> Funny enough, that's how "list comprehensions" are created i
Op 02-12-15 om 02:24 schreef Steven D'Aprano:
> Python has three not-entirely-awful solutions to the problem of static
> locals, but no really great or obvious one.
I think python is unsuited for an obvious solution for static locals.
Because you need to initialise your static variable somewhere.
Op 02-12-15 om 02:24 schreef Steven D'Aprano:
> Heh, I agree, and as I suggested, it might be good to have an actual
> mechanism for static locals. But using a class is no better: your "static
> storage" is exposed as an instance attribute, and even if you flag it
> private, *somebody* is going to
Op 02-12-15 om 10:23 schreef Chris Angelico:
> On Wed, Dec 2, 2015 at 7:21 PM, Antoon Pardon
> wrote:
>> I think python is unsuited for an obvious solution for static locals.
>> Because you need to initialise your static variable somewhere. If you
>> initialise whithin t
Op 02-12-15 om 11:18 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> def foo()
>>foo.attr
>>
>> changes nothing about foo.attr being globally accessible.
> I don't know why global accessibility is such a problem.
Some people seem to have a problem with glo
Op 02-12-15 om 11:22 schreef Steven D'Aprano:
> On Wed, 2 Dec 2015 07:34 pm, Antoon Pardon wrote:
>
>> Op 02-12-15 om 02:24 schreef Steven D'Aprano:
>>> Heh, I agree, and as I suggested, it might be good to have an actual
>>> mechanism for static loca
Op 02-12-15 om 14:11 schreef Steven D'Aprano:
> On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote:
>
>> If you want your arguments to be taken seriously, then you better should.
>> If you use an argument when it suits you and ignore it when it doesn't
>> you ar
Op 02-12-15 om 14:48 schreef Mark Lawrence:
>
> Would the pair of you, Antoon and Steven, be kind enough to take your
> bickering offline, thanks.
>
Mark, you are in no position to make such a request of others.
--
Antoon.
--
https://mail.python.org/mailman/listinfo/python-list
Op 02-12-15 om 15:15 schreef Ian Kelly:
> On Wed, Dec 2, 2015 at 7:41 AM, Antoon Pardon
> wrote:
>> Op 02-12-15 om 14:11 schreef Steven D'Aprano:
>>> On Wed, 2 Dec 2015 10:09 pm, Antoon Pardon wrote:
>>>
>>>> If you want your arguments to be taken
Op 02-12-15 om 21:30 schreef Ian Kelly:
> A person can hold one opinion in some contexts and an opposing opinion
> in others.
Yes people are capable of that. It doesn't mean we shouldn't challenge them
on that. There are many possibilities for people to act like that. One
context can be sufficient
it?
>
>
> Thanks,
You want the following to work
def add(a, b):
return a + b
def double(n)
return n + n
logged_add = logged(add)
logged_double = logged(double)
s = logged_add(3, 5)
d = logged_double(13)
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
On 02/11/2016 09:31 AM, Ulli Horlacher wrote:
> https://docs.python.org/2/library/tarfile.html says:
>
> tarfile.open(name=None, mode='r', fileobj=None, bufsize=10240, **kwargs)
>
> Return a TarFile object for the pathname name.
>
>
> (How) can I read a tar file from a (tcp) socket?
> I do not
On 02/11/2016 06:27 PM, Lars Gustäbel wrote:
> On Thu, Feb 11, 2016 at 04:41:43PM +, Ulli Horlacher wrote:
>> sfo = sock.makefile('r')
>> taro = tarfile.open(fileobj=sfo,mode='r|')
>> taro.extractall(path=edir)
> What about using an iterator?
>
> def myiter(tar):
> for t in tar:
>
I have written a small backup program, that uses ftplib to make
remote backups. However recentely the program starts to regularly
raise IndexErrors, as far as I can see the problem is in socket.py
Can anyone shed some light?
This is the traceback:
Traceback (most recent call last):
File "/usr/l
Op 14-02-16 om 14:40 schreef Peter Otten:
> Antoon Pardon wrote:
>
>> I have written a small backup program, that uses ftplib to make
>> remote backups. However recentely the program starts to regularly
>> raise IndexErrors, as far as I can see the problem is in socket.py
Op 14-02-16 om 14:40 schreef Peter Otten:
>
> PS: How did you produce the overview over the local variables? That looks
> nice.
>
I started from this recipe:
http://code.activestate.com/recipes/52215-get-more-information-from-tracebacks/
made it more to my liking and turned it into a module.
is behavior to a newcommer in Python.
This behaviour is undefined in the language. So there is nothing to explain
except that it depends on implementation details. Any program that depends
on two variable being the same or not the after similar code is wrong.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
write the following
def extern(f)
print(f.__class__)
the result is: , so that doesn't work.
Looking around I didn't find an other obvious candidate
to try. Anybody an idea?
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 05-03-16 om 16:18 schreef Chris Angelico:
> On Sun, Mar 6, 2016 at 2:05 AM, Antoon Pardon
> wrote:
>> Using python 3.4/3.5
>>
>> Suppose I have the following class:
>>
>> class Tryout:
>>
>> @extern
>> def method(self, ...)
>>
a nasty bug while using
one of those ways of simulating switches.
--
Antoon Pardon
--
https://mail.python.org/mailman/listinfo/python-list
Op 16-03-16 om 10:51 schreef Mark Lawrence:
> On 16/03/2016 09:35, Antoon Pardon wrote:
>> Op 16-03-16 om 09:47 schreef Mark Lawrence:
>>>
>>>>
>>>> Same with switch. You can use a hash table etc. to simulate switches,
>>>> but only if the
Op 17-03-16 om 00:14 schreef Chris Angelico:
> def monkeypatch(cls):
> orig = globals()[cls.__name__]
> print("Monkeypatch",id(cls),"into",id(orig))
> for attr in dir(cls):
> if not attr.startswith("_"):
> setattr(orig,attr,getattr(cls,attr))
> return orig
>
> cl
Op 17-03-16 om 09:57 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> Op 16-03-16 om 20:27 schreef Marko Rauhamaa:
>>> Antoon Pardon :
>>>> Look at decorators. They don't provide functionality we wouldn't have
>>>> without them. So we don't
901 - 1000 of 1820 matches
Mail list logo