d a separate
cleanup stack and objects that require cleanup were pushed onto that stack
after being fully constructed but before calling the initialisation that
required cleanup. See
http://www.developer.nokia.com/Community/Wiki/Two-phase_construction
--
Duncan Booth
--
http://mail.python.org/mailman/listinfo/python-list
skip to checking the 6th and then the 9th. It doesn't have to touch the
intervening characters at all.
Or as the source puts it: it's a mix between Boyer-Moore and Horspool, with
a few more bells and whistles on the top.
Also the regex library has to do a whole lot more than just figu
and a utility method rather than
just one or the other and also where you couldn't just have both.
If you can persuade me that you need _handle_bool as both a static method
and a utility function, you probably also need to explain why you can't
just use both:
class Pa
t Google's fault: they can't ignore the forwarding step otherwise
spammers could bypass SPF simply by claiming to be forwarding the emails.
It is simply a limitation of the SPF protocol. Fortunately they only use
SPF as one indicator so real messages still get through.
--
Duncan Booth
--
http://mail.python.org/mailman/listinfo/python-list
Chris Angelico wrote:
> On Tue, Jul 23, 2013 at 6:06 PM, Duncan Booth
wrote:
>> I have a very common situation where an overly strict SPF may cause
>> problems:
>>
>> Like many people I have multiple email addresses which all end up in
>> the same inbox. Th
> that every class will have a __dict__, and I wonder whether that is a
> safe assumption.
I believe so.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
database once and then write
out your status every few seconds.
import sqlite3
con = sqlite3.connect('status.db')
...
with con:
cur = con.cursor()
cur.execute('UPDATE ...', ...)
and similar code to restore the status or create required tables on
names.
Albert raised the subject of Algol 68 which if I remember correctly used :=
for assignment and = to bind names (although unlike Python you couldn't
then re-bind the name to another object in the same scope).
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
drop you into the debugger
so you can examine what's going on in more detail.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
nsactions are comitted (or aborted). This means that global objects can
be safely read from multiple threads without any semaphore locking.
See http://mail.python.org/pipermail/pypy-dev/2012-September/010513.html
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
are created.
For the comparison to be the limiting factor you have to be doing a lot of
comparisons on the same string (otherwise creating the string would be the
limiting factor), so at the expense of a single dictionary insertion when
the string is created you can get guaranteed O
trings are interned, if s is not t then s != t as well".
Right if the strings differ only in the last character, but the rest of
this thread has been about how, for random strings, the not-equal case
is O(1) as well.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
;t think you've misunderstood how it work, but so far as I can see the
code doesn't attempt to short circuit the "not equal but interned" case.
The comparison code doesn't look at interning at all, it only looks for
identity as a shortcut.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
method itself and
nowhere else. Alternatively use named values for different categories of
timeouts and adjust them on startup so instead of a default of `timeout=
15` you would have a default `timeout=MEDIUM_TIMEOUT` or whatever name
is appropriate.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
is is a CMD script
python -x %~f0 "%1"
echo Back in the CMD script
goto :eof
"""
import sys
print("Welcome to Python")
print("Arguments were {}".format(sys.argv))
print("Bye!")
You can put the Python code either before or after the triple-quote
string containing the CMD commands, just begin the file with a goto to
skip into the batch commands and end them by jumping to eof.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
e cases in Java where you have a
method that takes a map as an argument and you want to pass in a map with a
single
kep/value pair. In that case it lets you replace 3 lines of Java with 1.
e.g. from the comments:
"If you have a simple select statement like "select foo from bar where id =
:ba
:= concatenation | basic-re
concatenation ::= simple-re basic-re
basic-re ::= element | element quantifier
element ::= group | nc-group | "." | "^" | "$" | char | charset
quantifier = "*" | "+" | "?" | "{" NUMBER "}" | &q
most of the others in existence) tend more
to the spaghetti code than following a grammar (_parse is a 238 line
function). So I think it really is just trying to match existing regular
expression parsers and any possible grammar is an excuse for why it should
be the way it is rather than
old list slicing:
>>> x = [1,2,3]
>>> y = ['insertme']*(2*len(x))
>>> y[1::2] = x
>>> y
['insertme', 1, 'insertme', 2, 'insertme', 3]
--
Duncan Booth
--
http://mail.python.org/mailman/listinfo/python-list
ork in 3.1 and 3.2 there is the uprefix import hook:
https://bitbucket.org/vinay.sajip/uprefix
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
ented under 'built-in functions'.
http://docs.python.org/library/functions.html#help
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
don't
> remembers. I do not see anything on PyPI. Any advice is welcome!
>
Not exactly what you asked for, but if you clone
https://github.com/collective/buildout.python then a single command will
build Python 2.4, 2.5, 2.6, 2.7, 3.2, and 3.3 on your system.
--
Duncan Booth h
parate functions:
if sys.platform=='win32':
def function():
"""
>>> function()
[1, 2]
"""
return [1, 2]
else:
def function():
"""
>>> function()
[1, 2, 3]
Mark Lawrence wrote:
> On 19/10/2012 09:56, Duncan Booth wrote:
>> Mark Lawrence wrote:
>>
>>> Good morning/afternoon/evening all,
>>>
>>> Where is this specific usage documented as my search engine skills have
>>> let me down? By this I mea
calhost ~]$ /opt/local/bin/python2.6 -c "print('%.20e'%
2.096732150e+02,'%.7e'%2.096732150e+02)"
('2.096732149009e+02', '2.0967321e+02')
What do you get printing the value on 2.6 with a '%.20e' format? I seem to
remember that 2.7 rewrote float parsing because previously it was buggy.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
):
yield [h]+tail
for t in options(tail):
yield [head]+t
For a more 'functional' version there is also the Python 3.3 variant:
def options(heaps):
if not heaps: return []
head, *tail = heaps
yield from ([h]+tail for h in range(head))
yield from ([he
her checking types at all?
def foo(file_or_string):
try:
data = file_or_string.read()
except AttributeError:
data = file_or_string
... use data ...
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
the default lockscreen widget swipe left from the lockscreen
until you get to a page with only a '+', add the new widget there, then
long press that widget and drag it to be the rightmost page.
Then you should be sorted just so long as you don't have any friends with
December
option so that if the certificate ever does change in the
future the command will fail rather than prompting.
Alternatively use --non-interactive --trust-server-cert to just accept
any old server regardless what certificate it uses, but be aware that
this impacts security.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
ou use (if the svn server is also used by
other machines then connect to it using the external hostname rather than
localhost).
Or just use http:// configured to allow access through localhost only.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
xpands to the next
multiple of 8 spaces.
>>> if 1:
... print "yes" # space + tab
... print "no" # eight spaces
...
yes
no
If tab expanded to exactly 8 spaces the leading space would have forced an
indentation error, but it didn't.
--
Duncan Booth
c_int)]
_GetComputerNameW.restype = c_int
def GetComputerName():
buf = create_unicode_buffer(255)
len = c_int(255)
if not _GetComputerNameW(buf, len):
raise RuntimeError("Failed to get computer name")
return buf.value[:len.value]
print GetComputerName()
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
In this year's Christmas Raffle at work I won a 'party-in-a-box' including
USB fairy lights.
They sit boringly on all the time, so does anyone know if I can toggle the
power easily from a script? My work PC is running Win7.
--
http://mail.python.org/mailman/listinfo/python-list
atic way is to use a doc-string as the only body,
that way you can also explain why you feel the need for an empty
function.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
e.tostring(snippet)
'Hello world'
>
> With the tree syntax proposed in Brython it would just be
>
> doc <= DIV('hello '+B('world'))
>
> If "pythonic" means concise and readable, which one is more pythonic ?
>
The one that doesn't do unexpected things with operators.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Chris Angelico wrote:
> On Sun, Dec 23, 2012 at 6:28 PM, Tim Roberts wrote:
>> Duncan Booth wrote:
>>>
>>>In this year's Christmas Raffle at work I won a 'party-in-a-box'
>>>including USB fairy lights.
>>>
>>>They sit borin
chaouche yacine wrote:
>
> booleans
> ints, floats, longs, complexes
> strings, unicode strings
> lists, tuples, dictionaries, dictionary views, sets, frozensets,
> buffers, bytearrays, slices functions, methods, code
> objects,modules,classes, instances, types, nulls (there is exactly one
> obj
access your {l[1]}.
{l[0]} people might say {prog.NAME} has no
{tc.no}.''').format(prog=prog, l=l, tc=tc)
if hasattr(prog, 'VERSION'):
print 'But I challenge them to write code {tc.way} clean
without it
still get the same
> response (65535).
Tell the function what type to return before you call it:
InitScanLib = sLib.InitScanLib
InitScanLib.restype = c_short
See http://docs.python.org/2/library/ctypes.html#return-types
You can also tell it what parameter types to expect which will make calling
it simpler.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
tp://docs.python.org/2/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
> Matching 'if' or 'for' or 'while'.
>
or of course 'try'.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
counter.page = %s
AND visitors.host=%s''',
(useros, browser, date, page, host))
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
ntax,
it originated with Perl.
Try complaining to a Perl group instead.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
ideas support
> our ideology. Perl style regexes are not Pythonic. They violate our
> philosophy in too many places.
>
Or we could implement de-facto standards where they exist.
*plonk*
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
A, B, C]
exceptions[1:1] = exceptions,
...
except exceptions as e: # argh!
Abitrarily nested tuples of exceptions cannot contain loops so the code
simply needs to walk through the tuples until it finds a match.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
sort the items before putting them in a tuple, otherwise how do
you handle two identical dicts that return their items in a different
order?
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Nathan Rice wrote:
> On Thu, Feb 9, 2012 at 5:33 AM, Duncan Booth
> wrote:
>> Nathan Rice wrote:
>>
>>> I put dicts in sets all the time. I just tuple the items, but that
>>> means you have to re-dict it on the way out to do anything useful
>>> wit
}
>>> dict(dict.fromkeys('me'))
{'m': None, 'e': None}
>>> dict(dict(dict.fromkeys('me')))
{'e': None, 'm': None}
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
ndary bacterial
infections, but they are not effective against viruses.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Rick Johnson wrote:
> On Feb 14, 5:31 am, Duncan Booth wrote:
>> Rick Johnson wrote:
>> > BS! With free healthcare, those who would have allowed their immune
>> > system fight off the flu, now take off from work, visit a local
>> > clinic, and get pumped fu
Arnaud Delobelle wrote:
> On 15 February 2012 09:47, Duncan Booth
> wrote:
>> Rick Johnson wrote:
> [...]
>
> Perhaps it's a bit presumptuous of me but...
>
> It's tempting to react to his inflammatory posts, but after all Rick
> is a troll and ex
ers in the whole
file: see
http://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html for
some code that shows you what's in a .pyc
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
foo()
File "foo.bar", line 47, in foo
File "evil.txt", line 667, in bar
Evil line 667
RuntimeError: oops
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
ng at all like
Notepad.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
result for some user defined
types and never having converted my code to C I have no idea whether or not
the performance for the intended case would be competitive with the builtin
sum though I don't see why it wouldn't be.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
something about that.
Also the what's new doesn't mention PEP 414 although the release page does.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
as text
editors or indeed humans) to understand.
A little bit of redundancy in the grammar is seen as a good way to minimise
errors.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
argument which can be used to conditionally acquire the
lock and return a boolean indicating success or failure. When used inside a
`with` statement you can't pass in the optional argument so it acquires it
unconditionally but still returns the success status which is either True
or it never r
t;Are you $name$?"
> Template:
>>>> Template("Are you $name?").substitute(name=name)
> It is three to one in compactness, what a magic 3!
You can avoid the duplication fairly easily:
>>> name='Peter'
>>> 'Are you {name}?
Steven D'Aprano wrote:
> JSON expects double-quote marks, not single:
> v = json.loads("{'test':'test'}") fails
> v = json.loads('{"test":"test"}') succeeds
>
You mean JSON expects a string with valid
rough gmane in which case I still need to
sign up to the list to post but definitely don't want to receive emails.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
for x, y in coords:
yield x, y-1
yield x, y+1
new_coords = list(vertical_neighbours(coords))
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
empting to add the
tuple to itself you've broken the rules for reference counting.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
to the method in Base.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
e there is that the
're' module was imported in both cases:
C:\Python27>python -c "import sys; print('re' in sys.modules)"
True
C:\Python32>python -c "import sys; print('re' in sys.modules)"
True
Steven is right to assert that there
3.2.3 20030502 (Red Hat Linux 3.2.3-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(object):
..."Hello world"
...
>>> C.__doc__ = "whatever"
Traceback (most recent call last):
File "", line 1, in ?
TypeError: attribute '__doc__' of 'type' objects is not writable
>>>
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
n everything works.
>
> How can I do it to write to registry without "Run As Admin" ?
This might give you some pointers:
http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
get the same result in Python 2, you have to use sys.stdout.write
().
>
That isn't entirely true: you could set the `softspace` attribute on
sys.stdout, but that is even messier.
>>> def foo():
... print 1,
... sys.stdout.softspace=0
... print 2,
... sys.stdout.softspace=0
... print 3
...
>>> foo()
123
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
creates a decorator
factory from a decorator and passes its arguments through to the
underlying decorator.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
no
> lower-case and a 40-column limit
> on the TV display.
> But you try and tell the young
> people today that...
> and they won't believe ya'.
Acorn System One: 9 character 7 segment led display and 25 key keypad, 1Kb
RAM, 512 bytes ROM.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
_metaclass__ = MyMeta
y = 5
>>> MyClass.x = 20
Updating var "x"
>>> MyClass.x
Retrieving var "x"
20
However note that if you do this you can access "x" only directly on the
class not on an instance of the class:
>>> MyClass().x
Traceback (most recent call last):
File "", line 1, in
MyClass().x
AttributeError: 'MyClass' object has no attribute 'x'
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Peter Otten <[email protected]> wrote:
> Duncan Booth wrote:
>
>> The descriptor protocol only works when a value is being accessed or set
>> on an instance and there is no instance attribute of that name so the
>> value is fetched from the underlying class.
>
&
guages it might be legal, but this is Python.
without the parentheses it is a syntax error.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
can be got or set even when
> they shadow an instance attribute. You're (probably) thinking of
> __getattr__ which isn't invoked when an instance attribute exists.
Yes, Peter Otten already corrected me on that point last Friday and I
posted thanking him on Sunday.
--
ME/STORE_NAME instead of
LOAD_FAST/STORE_FAST and LOAD_NAME looks first in local scope and then in
global. I suspect that
http://docs.python.org/reference/executionmodel.html#naming-and-binding
should say something about this but it doesn't.
--
Duncan Booth http://kupuguy.blogspot.com
--
asy_install.py
> install module_name
Or even just use:
C:\Your Python Directory\scripts\easy_install install module_name
as easy_install will also add a .exe to your Python's 'scripts' folder.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
n32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(1.1*1.1)
1.2102
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
have
saved the bound method so that whenever you call it later it gets the
correct 'self' parameter.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
to giving you the current directory from a script (and
might be what you want if you haven't changed it since the script started).
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
foo = Foo()
print(str(foo))
--
for Python 3.2 the command:
C:\Temp>c:\python32\python bug.py
generates a popup:
python.exe - Application Error
The exception unknown software exception (0xcfd) occurred in the
application at location 0x1e08a325.
sing simple key functions?
Since you've got two keys you will of course need to make two calls to
'sort'. e.g.
data.sort(key=itemgetter(1), reverse=True)
data.sort(key=itemgetter(0))
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
credits" or "license" for more information.
>>> 2-1 is 1
1
>>> True is 1
0
>>> (True is 1) is 0
0
>>> (True is 1) is False
1
The code for the win32api made use of this fact to determine whether to
pass int or bool types through to COM methods.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
atement in the test. Also,
assertRaises has a weird dual life as a context manager: I never knew that
before today.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
gt; False or False or True or False
True
but using != for 'xor' doesn't extend the same way:
>>> False != False != True
False
You can use 'sum(...)==1' for a larger number of values but do have to be
careful that all of them are bools (or 0|1).
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
rogram which used call by name to alias I and A[I] in some recursive
calls. Not nice. Fortunately even at that time it was mostly being taught
as an oddity; real programming was of course done in Algol 68C or BCPL.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
guess that it is a hangover from the days when exceptions
were strings and you couldn't use inheritance to group exceptions.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
referenced will prevent their
methods being deleted and any functions or methods that are still
accessible will keep the globals alive as long as required.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
, 9, 1, 4, 7]
or for that mattter:
>>> list(set([3, 32, 4, 32, 5, 9, 2, 6]))
[32, 2, 3, 4, 5, 6, 9]
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
p all but
3 of their 132 claims? It isn't at all obvious yet who is going to be
'screwed over hard'.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
7;abcd'.startswith('abc', 0, 2)
False
Likewise the start parameter for endswith.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
e 2, in foo
bar(y=2, **kwargs)
TypeError: bar() got multiple values for keyword argument 'y'
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
There's a reason why Python 2 requires you to be explicit about
the class; you simply cannot work it out automatically at run time.
Python 3 fixes this by working it out at compile time, but for Python 2
there is no way around it.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
t does it to change the default action from
silently overwriting any argumement passing up the chain to raising an
error if you attempt to overwrite it without first checking whether it
exists.
--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Jason wrote:
> My first problem (lack of understanding of course) is that if I run the
> above, I get an error saying:
>
> print "%s - %s" % name,score
> TypeError: not enough arguments for format string
>
> Now I understand what it's saying, but I don't understand why.
>
The problem is
Neal Becker wrote:
> How can I write code to take advantage of new decorator syntax, while
> allowing backward compatibility?
>
> I almost want a preprocessor.
>
> #if PYTHON_VERSION >= 2.4
> @staticmethod
> ...
>
>
> Since python < 2.4 will just choke on @staticmethod, how can I do this?
>
>
Richie Hindle wrote:
>
> [Peter]
>> Does it really have to be 158 lines to demonstrate these few issues?
>
> I think you missed the other Peter's second post, where he points to
> his program: http://www.pick.ucam.org/~ptc24/yvfc.html
>
> I didn't read every one of his 158 lines, but his code i
Stefan Behnel wrote:
> Hi!
>
> I just firefoxed to Python.org and clicked on the bz2 link at
> http://python.org/2.4.2/ and what did I get?
>
> Python-3.4.2.tar.bz2 !!
>
> Python 3 - what we've all been waiting for, finally, it's there!
>
> Weird, though, the md5sum is the same as for the Pyth
Antoon Pardon wrote:
> Well I'm a bit getting sick of those references to standard idioms.
> There are moments those standard idioms don't work, while the
> gist of the OP's remark still stands like:
>
> egold = 0:
> while egold < 10:
> if test():
> ego1d = egold + 1
>
Oh come on.
Antoon Pardon wrote:
> A language where variable have to be declared before use, would allow
> to give all misspelled (undeclared) variables in on go, instead of
> just crashing each time one is encounterd.
Wrong. It would catch at compile-time those misspellings which do not
happen to coincide
Antoon Pardon wrote:
>
>> and worse it adds a burden on everyone reading the code who
>> has more lines to read before understanding the code.
>
> Well maybe we should remove all those comments from code too,
> because all it does is add more lines for people to read.
You'll get no argument fr
1 - 100 of 1775 matches
Mail list logo