On 31-10-2019 14:44, Thomas Jollans wrote:
On 31/10/2019 14.13, Arnaud Loonstra wrote:
On 30-10-2019 09:32, Arnaud Loonstra wrote:
Hi all,
I'm trying to wrap my head around the ctypes API. I have a C
structure I wish to create in Python and then return from python to C.
So a python meth
On 31-10-2019 15:39, Arnaud Loonstra wrote:
On 31-10-2019 14:44, Thomas Jollans wrote:
On 31/10/2019 14.13, Arnaud Loonstra wrote:
On 30-10-2019 09:32, Arnaud Loonstra wrote:
Hi all,
I'm trying to wrap my head around the ctypes API. I have a C
structure I wish to create in Python and
Hello,
I've got a nasty bug and no idea to deal with :
here is the method :
def denormer(self, var) :
" denorme un vecteur d'entree "
try:
#a = map(self.decerner, self.param, var)
#a = [self.decerner(x, y) for x, y in map(None,
self.param, var)]
ts, any thoughts about that?
* Fix the code in ZODB to not avoid import but to me this seems like a
dirty hack because it could happen again and I would prefer to fix
this issue once and for all.
Any thoughts or suggestion welcome, thanks!
Regards,
--
Arnaud Fontaine
[0] http://bugs.python.o
ts, any thoughts about that?
* Fix the code in ZODB to not avoid import but to me this seems like a
dirty hack because it could happen again and I would prefer to fix
this issue once and for all.
Any thoughts or suggestion welcome, thanks!
Regards,
--
Arnaud Fontaine
[0] http://bugs.python.o
;d still go for hashfile
for the function name though.
--
Arnaud
--
https://mail.python.org/mailman/listinfo/python-list
the same project name on
google code.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
27;re using an old version of
Python (before the with statement was introduced - 2.5?)
> File "unpyc3.py", line 96, in dec_module
> stream = open(pyc_path, "rb")
> UnboundLocalError: local variable 'pyc_path' referenced before assignment
>
> change pyc_path to path
Thanks, I've fixed that.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 14 September 2011 09:44, Vincent Vande Vyvre
wrote:
> File "unpyc3.py", line 211, in __init__
> for v in code_obj.co_cellvars + code_obj.co_freevars]
> AttributeError: 'NoneType' object has no attribute 'co_cellvars'
Could you show me what you do
On 14 September 2011 11:03, Vincent Vande Vyvre
wrote:
> Le 14/09/11 11:31, Arnaud Delobelle a écrit :
[...]
> Could you show me what you do to get this error? Thank you,
> [vincent@myhost unpyc3]$ python
> Python 3.2.1 (default, Jul 11 2011, 12:37:47)
> [GCC 4.6.1] on linu
o_consts == ('foodoc',)
But I can't find where in foo.__code__ is stored the information that
the first constant in foo.__code__ is actually a docstring.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 15 September 2011 16:17, Ian Kelly wrote:
> On Thu, Sep 15, 2011 at 5:10 AM, Arnaud Delobelle wrote:
>> Hi all,
>>
>> You can do:
>>
>> def foo():
>> "foodoc"
>> pass
>>
>> function = type(lambda:0)
>> foo2 = fun
on, I suggest you read Guido's essay
on "new style classes" which were introduced in Python 2.2 (and are
now a good 10 years old I think):
http://www.python.org/download/releases/2.2.3/descrintro
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
out of it.
My entry:
>>> sum(map(int,str(2**1000)))
1366
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 16 September 2011 21:20, Ian Kelly wrote:
> On Fri, Sep 16, 2011 at 2:17 PM, Arnaud Delobelle wrote:
>> Ah go on, let's make a codegolf contest out of it.
>> My entry:
>>
>>>>> sum(map(int,str(2**1000)))
>> 1366
>
> That is exactly what m
er is 1 :)
Hopefully-helpfully-but-not-so-sure'ly yours,
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 18, 2011 1:20 PM, "Mark Dickinson" wrote:
>
> On Sep 16, 9:17 pm, Arnaud Delobelle wrote:
> > Ah go on, let's make a codegolf contest out of it.
> > My entry:
> >
> > >>> sum(map(int,str(2**1000)))
>
> You could save another
commutative. Then
>
> y = 123 + X()
>
> should have the same result. However, since it does not call __add__ on
> an instance of X, but on the int 123, this fails:
>
> TypeError: unsupported operand type(s) for +: 'int' and 'X'
>
> How can
# Simple example of 'pause' in action:
>>> def g(x):
... b = 5
... pause()
...
>>> def f(x, y):
... z = 2
... g(x)
... print "And we carry on..."
...
>>> f('spam', [4, 2])
*** Entering pause mode (EOF to resume)
pause> ?
File "", line 3, in g
. File "", line 3, in f
.. File "", line 1, in
pause> b
(g) 5
pause> b+1
(g) 6
pause> .z
(f) 2
pause> .y
(f) [4, 2]
pause> .x
(f) 'spam'
pause> ..len
()
pause> ^D
*** Leaving pause mode
And we carry on...
>>>
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
r normal arguments is argc & 0xFF
* the number of default values for keyword only arguments is argc >> 8
Can anyone confirm this? I can then open a ticket on bugs.python.org
[1] http://docs.python.org/dev/library/dis.html#opcode-MAKE_FUNCTION
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 21 September 2011 04:09, Terry Reedy wrote:
> I agree that doc should be updated for 3.x. Please suggest a new working if
> you can, as well as copying the source snippet above. Add me terry.reedy as
> nosy.
Done: http://bugs.python.org/issue13026
--
Arnaud
--
http://mail.p
m is now missing. If someone can shed light on why this is happening, I'd
> be grateful.
Line 46:
for distribution_other in _balls_in_unlabeled_boxes(
Should be:
for distribution_other in _balls_in_labeled_boxes(
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
(sorry about the top posting)
Change yield c to yield (c,)
HTH
Arnaud
PS: you could also change the if ... To
If not ns:
Yield ((),)
Else:
...
On Sep 24, 2011 8:06 AM, "Dr. Phillip M. Feldman" <
[email protected]> wrote:
>
> I wrote a small generator
3, go half and half - generate the lower half by adding to the lower
> bound, and the upper half by subtracting from the upper bound. Not
#4 the barycentric approach.
((n-i)*a + i*b)/n for i in range(n+1)
Gives you n+1 equally spaced values between a and b inclusive
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
The documentation says "New in version 2.2.2".
But zfill has been in the string module for a lot longer.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
, 0.8, 1.1]
>>> start, stop, n = -1, 1.1, 7
>>> [((n-i)*start + i*stop)/n for i in range(n+1)]
[-1.0, -0.7001, -0.39997,
-0.09996, 0.20004, 0.5, 0.8, 1.1]
On these examples, using fractions is no better than what I suggested
in my previous post.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 24 September 2011 23:10, Terry Reedy wrote:
> On 9/24/2011 10:18 AM, Arnaud Delobelle wrote:
>> ((n-i)*a + i*b)/n for i in range(n+1)
>
>>>> ['%20.18f' % x for x in [((7-i)*0.0 + i*2.1)/7 for i in range(8)]]
> ['0.00'
On Sep 25, 2011 10:49 PM, "Chris Angelico" wrote:
> And if you're willing to learn, it's not uncommon to start off
> complaining and end up appreciating. :)
+1 QOTW
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
> len(bytes)*8
960
>>> sum(map(counts.__getitem__, bytes))
480
Pretty fast as well.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
ndows installer on the 2.6.7 page. Do I install
> 2.6.6 first and then update to 2.6.7?
I don't know if it would suite your needs but there's ActivePython -
they provide an installer for 2.6.7
http://www.activestate.com/activepython/downloads
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
e a function object.
The problem is that you need to provide a code object, and the easiest
way to create a code object is to use a def statement :)
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
o_default = 42
def foo(arg1, arg2=foo_default):
...
foo.DEFAULT = foo_default
del foo_default
...
Or get the default at function runtime:
def foo(arg1, arg2=None):
if arg2 is None:
arg2 = foo.DEFAULT
...
foo.DEFAULT = 42
...
But I'd probably simply go for foo_DEFAULT, foo_MONKEY and
foo_SPECIAL. They're also quicker (1 dict lookup instead of 2)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
I've never used it, but
I think it endeavours to be what you are looking for.
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
bute '__dict__'
>>>>
Some built in types have a __dict__:
>>> def foo(): pass
...
>>> foo.__dict__
{}
>>> import random
>>> len(random.__dict__)
57
>
> So, i was wondering :
>
> -- why this behaviour ?
Performance reasons I guess.
> -- where the official documentation refers to this point ?
I don't know this one :)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
> So what is the pragmatics of the as syntax ?
It can also help when you want to import two different modules with
the same name.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
print("except")
...
try
except
>>> try:
...print("try")
... except TypeError:
...print("except")
... else:
...f()
...
try
Traceback (most recent call last):
File "", line 6, in
File "", line 1, in f
TypeError
>>>
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
nd, neither "quicker to execute" nor "more compact" equates
> to "more Pythonic".
It's idiomatic to write "x is None" when you want to know whether x is None.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
#x27;"
>>> [x for i, p in enumerate(s.split("'")) for x in ([p] if i%2 else p.split())]
['This', 'is', 'an', 'example string', 'with', 'quotes again']
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 23 November 2011 17:38, W. eWatson wrote:
[...]
> It may be time to move on to c++.
Good Luck. Bye!
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 28 November 2011 20:45, Ethan Furman wrote:
> [email protected] wrote:
>>
>> s = GIS.GIS.Cadastral\GIS.GIS.Citylimit
>> NeededValue = Citylimit
>
> NeededValue = s.rsplit('.', 1)[1]
Also:
>>> s[s.rfind(".") + 1:]
'Citylim
itor
except ImportError:
from psi.devsonly.ast import parse, NodeVisitor
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
you come back to it
in the future.
As for the main() function, I don't think it is standard practice in
Python. There is no requirement to have a main() function. You can
use the idiom:
if __name__ == "__main__":
...
which will execute if you call the file as a sc
On Nov 30, 2011 6:21 AM, "郭军权" wrote:
>
> Good after
> I have a string liststr = '["","","ccc"]' ,and I need
convert it to a list like list = ["","","ccc"],what can id do?
> Thanks
> 2) If not, try "foo-1", "foo-2", and so on
>
> 3) If you reach "foo-20", give up.
>
> What would you say if you saw this:
>
> for suffix in [''] + [str(i) for i in xrange(-1, -20, -1)]:
>
It's a little obfuscated ;)
valuable IMHO. There are some significant differences
but if you have a good understanding of one, you will have no problem
adapting very quickly to the other.
And Python 2 is definitely not obsolete :)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
here a simple way to achieve this? I could do something like this:
def encode(u):
"""encode a unicode string in .properties format"""
return u"".join(u"\\u%04x" % ord(c) if ord(c) > 0xFF else c for c
in u).encode("latin_1")
On 3 December 2011 23:51, Peter Otten <[email protected]> wrote:
> Arnaud Delobelle wrote:
>
>> I need to generate some java .properties files in Python (2.6 / 2.7).
>> It's a simple format to store key/value pairs e.g.
>>
>> blue=bleu
>> green=ve
solution and this is it. FTR,
the 'backslashreplace' argument tells the encoder to replace any
character that it can't encode with a backslash escape sequence.
Which is exactly what I needed, only I hadn't realised it. Thanks!
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 5 December 2011 20:05, Serhiy Storchaka wrote:
> 03.12.11 23:34, Arnaud Delobelle написав(ла):
>
>> Is there a simple way to achieve this? I could do something like this:
>>
>> def encode(u):
>> """encode a unicode string in .properties format
On 5 December 2011 21:46, Serhiy Storchaka wrote:
> 05.12.11 22:25, Arnaud Delobelle написав(ла):
>> On 5 December 2011 20:05, Serhiy Storchaka wrote:
>>> You must also encode backslash ('\\'), whitespaces and control characters
>>> (ord(c)<=32), '=&
eed 'test', import settings and you will be
able to access test. This is why singletons are often not needed in
Python (just like most other design patterns).
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
ainer object. What you use as a container object
> is up to you. Some use a 1-element list, although I find that ugly.
This kind of trick is not often necessary anyway. It may be a sign
that there is a better approach to the problem that the OP is trying
to solve.
--
Arnaud
--
http://mail.pyt
ss _TypeCheckedFunction():
def __init__(self, decoratedfunction):
self._decoratedfunction = decoratedfunction
def __call__(self, *args, **kwargs):
[...] Actual checking
def __get__(self, obj, objtype):
return partial(self, obj)
(Untested)
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 12 December 2011 13:52, Henrik Faber wrote:
> On 12.12.2011 14:45, Arnaud Delobelle wrote:
>
>>> Can someone please enlighten me?
>>
>> You can (need to?) use the descriptor protocol to deal with methods.
>>
>> from functools import partial
> [...
1,2,3,4,5
>>>> a,b,c
> ([1, 2, 3], 4, 5)
>
>> I personally quite like them, but I would like them to be more general.
>
>
> It already is. The *target can be anywhere in the sequence.
>
> --
> Terry Jan Reedy
You can even have nested sequences!
>>> a, (b, *c), *d = 1, "two", 3, 4
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
helped by
> the fact that (a+b) % c == a%c + b%c
You mean (a + b) % c == (a%c + b%c) % c
:)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
ed iterable using * will always
> yield a list. That is, unless the construct appears inside a function
> definition; then somehow a tuple is always the right choice'
When you quote somebody (even yourself), it would be helpful if you
attributed your quote.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
eas, to pursue them and to believe in them, but it
would be foolish to think that they are superior to knowledge which
has been accumulated over so many generations.
You claim that mathematicians have a poor understanding of philosophy.
It may be so for many of them, but how is this a problem? I
On 14 December 2011 12:33, Eelco wrote:
> On 14 dec, 12:55, Arnaud Delobelle wrote:
>> On 14 December 2011 07:49, Eelco wrote:
>> > On Dec 14, 4:18 am, Steven D'Aprano > > [email protected]> wrote:
>> >> > They might not be will
On 16 December 2011 18:25, Chris Angelico wrote:
> tee = lambda func,arg: (func(arg),arg)[1]
What a strange way to spell it!
def tee(func, arg):
func(arg)
return arg
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
ble. How do I achieve that please?
Well, you were almost there:
pid = recs[19][8]
Note: all caps is usually reserved for constants in Python.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
reates 4 intermediate strings, which is quite inefficient
(I've got 10s of MB's worth of unicode strings to escape)
I can think of another way using regular expressions:
escape_ptn = re.compile(r"[\n\t\f\r\\]")
# escape_map is defined above
def escape_match(m, map=escape_map):
return map[m.group(0)]
def escape_text(text, sub=escape_match):
return escape_ptn.sub(sub, text)
Is there a better way?
Thanks,
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 20 December 2011 14:54, Tim Chase wrote:
> On 12/20/11 08:02, Arnaud Delobelle wrote:
>>
>> Hi all,
>>
>> I've got to escape some unicode text according to the following map:
>>
>> escape_map = {
>> u'\n': u'\\n',
>
t; ... u'\\': u''
> ... }
>>>> escape_map = dict((ord(k), v) for k, v in escape_map.items())
>>>> print u"the quick\n brown\tfox
> jumps\\over\\the\\lazy\\dog".translate(escape_map)
> the quick\n brown\tfox jumps\\
already do:
efoo2 = ["one", "two", "three", "four"]
["_".join(reversed((x.capitalize() + " little indian").split(" ")) * 2)
for x in efoo2]
Note 1: I've ignored the fact that reversed(...)*2 is erroneous
Note 2: I wouldn't such code myself, in either form
What's the advantage of your elementwise stuff?
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
at Ian's counts matches and the OP asked
> for non-matches, but that's an exercise for the reader :-)
Here's a variation on the same theme:
sum(map(str.__ne__, str1, str2))
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
nes of argument in this thread.
The real kiss of death is when you find yourself on the same side of the
"argument" as ranting Rick.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
or
b = Bearing("N24d30mE")
Both methods are used for builtin types:
>>> int('12')
12
>>> int(12.5)
12
>>> dict([(1, 2), (3, 4)])
{1: 2, 3: 4}
>>> dict.fromkeys([1, 2])
{1: None, 2: None}
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
l/python-list/2001-July/090659.html
Did you change your mind, Terry? I too used to be against it :)
I'll stop now. Cheers,
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
t; """
That's a clever trick!
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
ndering if I could somehow replace the dict with an
> OrderedDict.
No, you can't.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
n
lst += [a]
and
lst = lst + [a]
The first one mutates the list object named 'lst' by appending 'a' at
its end, whereas the second one creates a new list made of the items
of lst with 'a' appended at the end. So your function conc1 does not
mutate _list, whereas your function conc2 does.
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
; So maybe doing a
>
> with open(filename) as f:
> contents = f.readlines()
That's what I do, unless I'm in an interactive session.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
like
black = 0, 0, 0
white = 255, 255, 255
for color, wait in (black, 3), (white, 2), (black, 3):
screen.fill(color)
pygame.display.update()
time.sleep(wait)
pygame.quit()
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
[
("3", "section_1")
("5", "section_2")
("\xFF", "section_3")
]
with open(input_path) as input_file:
lines = iter(input_file)
for end, path in sections:
with open(path, "w") as output_file:
for line in lines:
if line >= end:
break
output_file.write(line)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 22 January 2012 16:09, MRAB wrote:
> On 22/01/2012 15:39, Arnaud Delobelle wrote:
[...]
>> Or more succintly (but not tested):
>>
>>
>> sections = [
>> ("3", "section_1")
>> ("5", "section_2")
>>
gt;> a = A()
>>> b = B()
>>> a.x
0
>>> a.x_plus_one
1
>>> b.x_plus_one
3
I don't know why one would want to do this though :)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
="top pane")
m.add(top)
bottom = Label(m, text="bottom pane")
m.add(bottom)
mainloop()
--
I can see two panes alright, but no handle to resize them (or 'sash'
as they seem to be called in tkinter). Is there something else that I
should be doing?
TIA,
--
A
On 21 March 2013 18:42, Christian Gollwitzer wrote:
> Am 21.03.13 15:37, schrieb Arnaud Delobelle:
>
>> Hi Python List,
>>
>> I'm trying to use PanedWindow on OS X (10.8.3). I've started with the
>> effbot docs example (http://effbot.org
yping. The entered text will also
> need to be captured once the user has finished typing.
>
> This is a gui-less CLI tool for python 2.7
>
> I've seen some information on tty.setraw but I'm not sure how you'd go about
> wiring that up.
Can you use curses (http:/
tools import islice
>>> items = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
>>> n = 3
>>> list(iter(lambda i=iter(items):list(islice(i, n)),[]))
[['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]
Not too readable though :)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
elf.var_a =
>
> @MyDecorator(...)
> def meth_one(self, in_data):
> ...
I don't really understand what you are trying to do. It would be
easier if you had some code that tried to do something (even if it
doesn't quite work).
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
d(lines):
... yield line
...
>>> print_pattern(mirror_pattern(generate_pretty_pattern()))
*
**
***
*
***
**
*
Here's another example:
>>> print_pattern(mirror_pattern(''.join(mirror_pattern("*".ljust(i).rjust(15)))
>>> for i in range(1,16,2)))
*
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
* *
*
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
can name these alternatives (
'(?Ppattern)'). Then you can do
if m.group('case1'):
...
elif m.group('case2'):
...
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
where you'd expect it (exit is a
constant, not a function):
http://docs.python.org/2/library/constants.html#constants-added-by-the-site-module
As for the behaviour when you pass a string, it's documented here:
http://docs.python.org/2/library/exceptions.html#exceptions.SystemExi
return sum((getattr(p, 'mybits', []) for p in cls.mro()[::-1]),
[])
class Derived(Base):
mybits = ["value3", "value4"]
class FurtherDerived(Derived):
mybits = ["value5"]
>>> Derived.mylist()
['value1', 'value2', 'value3', 'value4']
>>> FurtherDerived.mylist()
['value1', 'value2', 'value3', 'value4', 'value5']
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
lse
You've fallen victim to the fact that CPython is very quick to collect
garbage. More precisely, when Python interprets `id(A.f) == id(a.f)`,
it does the following:
1. Create a new unbound method (A.f)
2. Calculate its id
3. Now the refcount of A.f is down to 0, so it's garbage co
l it manually
> return apply(self.to_binary, varargs, keys)
>
[...]
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
t;>> sum(takewhile((100).__gt__, filter((2).__rmod__, map((2).__rpow__,
>>> count(1)
165
:)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
Python works. You won't be able to get the docstring
of a descriptor this way. You need to do it from the class. The
behaviour you observe is normal and cannot be overriden.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On 7 April 2013 21:38, Nick Gnedin wrote:
>
> Arnaud,
>
> Thanks for the answer. I understand that I cannot access the docstring as an
> attribute of a getter, but what did you mean when you said "You need to do
> it from the class"? I am still confused - is there a wa
also not the best in terms of time
or space complexity. Does this mean you have to write tests for time
and space complexity as well? That's interesting, but I don't know of
tools to help do that (time complexity seems easy enough, but space
complexity seems tougher to me).
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
hich
outputs the song "99 bottles of beer":
http://codegolf.com/99-bottles-of-beer
Cheers,
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
[1, 2]
You might be interested in code.compile_command()
(http://docs.python.org/2/library/code.html)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
;>> foo.boo(1)
Foo1.boo 1
Foo1.bar
>>> far = Far1()
>>> far.bar()
Foo1.bar
>>> far.boo(0)
DifferentBoo.boo 0
Foo1.boo 0
Foo1.bar
>>> far.boo(1)
DifferentBoo.boo 1
Foo1.bar
HTH,
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
ou come in contact with. Therefore, my
suggestion is that you stay clear of any computer equipment from now
on, as you may cause hazards for yourself and others.
Others may be able to elaborate further.
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
'colspan="2" {{Version |o |13 April 2007}}',
'2.6.12'],
['[[Ubuntu 6.06|6.06 LTS]]',
'Dapper Drake',
'1 June 2006',
'{{Version |o | 14 July 2009}}',
'{{Version |o | 1 June 2011}}',
'2.6.15'],
['[[Ubuntu 6.10|6.10]]',
'Edgy Eft',
'26 October 2006',
'colspan="2" {{Version |o | 25 April 2008}}',
'2.6.17'],
[...]
]
>>>
That should give you the info you need (until the wiki page changes too much!)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
on
this list was answered by Alex Martelli and nowadays I get most
excellent and concise tips from Peter Otten - thanks, Peter! If
there's one person on this list I don't want to offend, it's you!
So here's to lots more good and bad humour on this list, and the
occasional slightly un-pc remark even!
Cheers,
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
MyObject(metaclass=MyType):
pass
>>> class Test(MyObject):
... def __metaclass__(name, bases, attrs):
... print("Test metaclass")
... return MyType(name, bases, attrs)
...
Test metaclass
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
o ' + str(miles) + 'miles.')
>>
>> poop = MyGui()
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>
> poop? Seriously? You aren’t serious about that copying, right?
>
> Your code seems to be missing a lot of important stuff. You don’t
> inherit from tkinter.Frame. Compare your program to the sample “Hello
> world!” program:
His class is not a frame, it's just a container for the tkinter code.
It's a bit unusual but it looks correct to me (apart from the single
underscores in __init__() as spotted by Ned Batchelder).
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
101 - 200 of 1146 matches
Mail list logo