ess jargon, the other three are relevant enough to fool people
into thinking that maybe it is a human being. It had me fooled for a long
time.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ith text-based games. Here
are two suggestions:
- guess the number
- twenty questions ("is it bigger than a breadbox?")
You might also like to investigate Inform-7.
http://inform7.com/
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
;
My irony meter didn't merely explode, it actually vaporized.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ing using regexes unless the text you
are searching for actually contains a regular expression of some kind. If
it's merely a literal character or substring, standard string methods
will probably be faster.
Oh, and a tip for you:
- don't escape quotes unless you don't need to, use the other quote.
s = '\'' # No, don't do this!
s = "'" # Better!
and vice versa.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
t we ran into this problem, and
since then we've just routinely whitelisted email from Optus and Bigpond,
curse their black souls for making spam prevention just that little bit
harder. So I suppose it's possible that they've stopped being bad actors
and started following the standards correctly.
No really, stop laughing, it is technically possible.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
but even that can't always take into account localised rules, e.g. in
German, you should not convert SS to ß for placenames or person names, so
for example Herr Meißner and Herr Meissner are two different people. This
is one of the motivating reasons for introducing the uppercase ß.
http:/
lowercase. It's not a perfect solution,
but it works reasonably well if you don't care about full localization.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
r family of languages.
For an introduction to the problem:
http://www.w3.org/International/wiki/Case_folding
http://www.unicode.org/faq/casemap_charprop.html
> Also, "ß" is not really the same as "ss".
Sometimes it is. Sometimes it isn't.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 20 Jul 2013 14:30:14 -0700, Paul McGuire wrote:
> Thanks for your continued support and interest in pyparsing!
And thank you for pyparsing!
Paul, I thought I would mention that over the last week or so on the
Python-Dev mailing list, there has been some discussion about adding a
parser
temp = fsum(o*w for (o, w) in zip(self.outputs, self.o_weight))
self.output = [1/(1+exp(-temp))]*self.output_num
I have neither tested that this works the same as your code (or even
works at all!) nor that it is faster, but I would expect that it will be
faster.
Good luck!
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
s, best of 3: 0.319 usec per loop
[steve@ando ~]$ python3.3 -m timeit -s "x = 2.357e7" -s "from math import
sqrt" "sqrt(x)"
1000 loops, best of 3: 0.172 usec per loop
How exactly are you timing the code?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
to solve your problem
with "Grab" (whatever that is), feel free to come back.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
iting.
http://docs.python.org/3/library/functions.html#open
http://docs.python.org/2/library/functions.html#open
Some further discussion here:
http://stackoverflow.com/questions/12193047/is-universal-newlines-mode-
supposed-to-be-default-behaviour-for-open-in-python
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
; enforced on the newsgroups }
Are you implying that failure to avoid disparaging others in newsgroups
is harmful? That disparages me.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
. Such differences as exist are trivial:
- if you need an actual callable function or method, say to pass to some
other function, you can do this:
for method in (d.items, d.keys, d.values):
process(method)
instead of this:
# untested
for method in (d.items, d.keys, lambda d=d: iter(d)):
process(method)
- d.keys() is a view, not the dict itself. That's a pretty fundamental
difference: compare dir(d.keys()) with dir(d).
Basically, views are set-like, not list-like.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
il it stops
working.
I have code that manually walks over each dict and extracts keys that are
in both, or one but not the other. Once I drop support for Python 2.6, I
throw that code away and just use views. But until then, I'm stuck doing
it the horrible way. Judging by a naive grep of my
That second point was the deciding factor when direct iteration over
dicts was added. has_key() was deprecated in favour of "key in dict", and
that pretty much forced iteration to go over keys by default. The
reasoning is, "x in y" ought to be equivalent to:
for tmp in y:
strings are O(n) for indexing a
> position within the string.
Not so for UTF-32.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
s the same in both
> 2 and 3.
Fair point.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
re relatively small (say, a paragraph rather than multiple
pages of text) then even that initial conversion will be invisible. A
fast touch typist hits a key about every 0.1 of a second; if it takes a
millisecond to convert the chunk, you wouldn't even notice the delay. You
can copy and up-
er have been invented.
Making an actual list copy of the keys (values, items) is useful, but
it's not useful enough to dedicate a method (three methods) for it. Just
call list() on the view (or, in the case of keys, directly on the dict).
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
.
It is *possible* to have non-buggy string routines using UTF-16, but the
implementation is a lot more complex than most language developers can be
bothered with. I'm not aware of any language that uses UTF-16 internally
that doesn't give wrong results for surrogate pairs.
--
Ste
On Thu, 25 Jul 2013 16:02:42 +1000, Chris Angelico wrote:
> On Thu, Jul 25, 2013 at 3:48 PM, Steven D'Aprano
> wrote:
>> Dicts aren't sets, and don't support set methods:
>>
>> py> d1 - d2
>> Traceback (most recent call last):
>> File &q
On Thu, 25 Jul 2013 17:58:10 +1000, Chris Angelico wrote:
> On Thu, Jul 25, 2013 at 5:15 PM, Steven D'Aprano
> wrote:
>> On Thu, 25 Jul 2013 04:15:42 +1000, Chris Angelico wrote:
>>
>>> If nobody had ever thought of doing a multi-format string
>>> repres
On Thu, 25 Jul 2013 18:15:22 +1000, Chris Angelico wrote:
> On Thu, Jul 25, 2013 at 5:27 PM, Steven D'Aprano
> wrote:
>> On Thu, 25 Jul 2013 16:02:42 +1000, Chris Angelico wrote:
>>
>>> On Thu, Jul 25, 2013 at 3:48 PM, Steven D'Aprano
>>> wrote:
On Thu, 25 Jul 2013 20:34:23 +1000, Chris Angelico wrote:
> On Thu, Jul 25, 2013 at 7:44 PM, Steven D'Aprano
> wrote:
>> On Thu, 25 Jul 2013 18:15:22 +1000, Chris Angelico wrote:
>>> That's true, but we already have that issue with sets. What's the
>>>
aw 8- bit bytes and characters not unified with
> Unicode.
> "
Do you know what those characters not unified with Unicode are? Is there
a list somewhere? I've read all of the pages from here to no avail:
http://www.gnu.org/software/emacs/manual/html_node/elisp/Non_002dASCII-Characters.html
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote:
> On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano
> wrote:
>> On Thu, 25 Jul 2013 14:36:25 +0100, Jeremy Sanders wrote:
>>> "To conserve memory, Emacs does not hold fixed-length 22-bit numbers
>>>
On Thu, 25 Jul 2013 15:45:38 -0500, Ian Kelly wrote:
> On Thu, Jul 25, 2013 at 12:18 PM, Steven D'Aprano
> wrote:
>> On Fri, 26 Jul 2013 01:36:07 +1000, Chris Angelico wrote:
>>
>>> On Fri, Jul 26, 2013 at 1:26 AM, Steven D'Aprano
>>> wrote:
&
mmands by wrapping them in Python. There
are plenty of big, complex shell commands that take a plethora of options
and could do with some useful Python wrappers, like wget. But you haven't
done them.
Nor have you added extra security, or even extra convenience. You've done
nothing that couldn't be done using the shell "alias" command, except in
Python where the syntax is less convenient (e.g. "ls" in the shell,
versus "ls()" in Python).
[1] I think every newbie programmer goes through a stage of pointlessly
writing one-liner wrappers to every second function they see. I know I
did. The difference is, before the Internet, nobody did it publicly.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
esting it,
debugging it, going through revision after revision to try to bring it to
the same level of maturity as pickle, which would you prefer?
:-)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 25 Jul 2013 21:20:45 -0600, Ian Kelly wrote:
> On Thu, Jul 25, 2013 at 8:48 PM, Steven D'Aprano
> wrote:
>> UTF-8 uses a flexible representation on a character-by-character basis.
>> When parsing UTF-8, one needs to look at EVERY character to decide how
>> ma
On Fri, 26 Jul 2013 22:12:36 -0600, Ian Kelly wrote:
> On Fri, Jul 26, 2013 at 9:37 PM, Steven D'Aprano
> wrote:
>> See the similarity now? Both flexibly change the width used by code-
>> points, UTF-8 based on the code-point itself regardless of the rest of
>> th
in use, but they're unlikely to support Unicode.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
capabilities:
Windows XP, 2000, Vista, 7, 8 ...
Mac OS-X
FreeBSD, OpenBSD, Linux, running KDE (3 or 4?), Gnome (2 or 3?), Trinity,
RatPoison, XFCE, something else... or no window manager at all
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
data (lines).
Calling the get method has higher overhead than dict[key], that will also
contribute.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
d__', '__rmul__', '__setattr__', '__setitem__',
'__sizeof__', '__str__', '__subclasshook__', 'append', 'clear', 'copy',
'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']
There's 45 ASCII-only strings right there, in only one built-in type, out
of dozens. There are dozens, hundreds of ASCII-only strings in Python:
builtin functions and classes, attributes, exceptions, internal
attributes, variable names, and so on.
You already know this, and yet you persist in repeating nonsense.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
lled. That means putting it all those calls inside a
function object, for later use, instead of executing them directly *right
now*:
def method1(self):
return super(WhatEver, self).request("method1")
WhatEver = type("WhatEver", (BaseClass,), {"method1": method1})
You could alternatively use lambda:
WhatEver = type("WhatEver", (BaseClass,),
{"method1":
lambda self: super(WhatEver, self).request("method1")
}
)
Note that the class name inside super() *must* match the global name the
class is assigned to, "WhatEver". The internal class __name__ -- the
first argument to type() -- doesn't have to match, but it should, to
avoid confusion.
The above should fix the NameError you are getting, and it might even
work, but I think delegation is a better solution to this problem.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ey do the opposite: they convert the float
to a Fraction:
py> Fraction(1/3)
Fraction(6004799503160661, 18014398509481984)
Am I the only one who is surprised by this? Is there a general rule for
which way numeric coercions should go when doing such comparisons?
--
Steven
--
http://mai
e float value 1/3 is more likely to be
>>> Fraction(1, 3) than Fraction(6004799503160661, 18014398509481984).
>>
>> At what point should it become Fraction(1, 3)?
>>
> When the error drops below a certain threshold.
Good plan! I pick a threshold of 42.7. Anyone got a better
e to me to cast to Fraction when
> > comparing.
>
> Otherwise, == becomes non-transitive
This is Python, and we can make __eq__ methods that do anything,
including be non-transitive, non-reflexive, and nonsensical if we like :-)
But I take your point, and that makes sense.
--
Ste
nk it would be useful for Fraction.from_float() to accept an
optional second argument, the maximum denominator:
Fraction.from_float(x, den=None)
=> nearest fraction to float 1/3, with denominator no greater than den
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
calculating with.
Oh, for what it's worth, I don't pretend to know how to choose an epsilon
either. I can sometimes recognise a bad epsilon, but not a good one.
Floats are *hard*.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ipt performance?
No, it is irrelevant to performance, except performance of the reader.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
e base, possibly excepting unit tests with long lists of
data. I simply don't write deeply nested classes and functions unless I
absolutely need to.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
27; object has no attribute 'media'
Since your module has no attribute 'media', that error is correct.
The lesson here is, never name your own files the same as library files.
Unfortunately, that's easier said than done. I think everyone has made
the same mistake at le
g you.
But no, there's no meaningful performance difference based on line
length. Interpreting the source code is not meaningfully affected by line
length, and by the time the code is compiled and then run, line length is
irrelevant.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
install AVbin
and hopefully your distro will already support the latest, or at least
working, version.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
hours, and a minimum of 1.7
minutes (assuming the directory doesn't get deleted instantaneously).
time.sleep() takes an argument in seconds.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ither character above is larger than 4 bytes. You forgot to deduct the
size of the object header. Python is a high-level object-oriented
language, if you care about minimizing every possible byte, you should
use a low-level language like C. Then you can give every character 21
bits, and be hap
7;d prefer
> not to.
You could try running it and see if it breaks. That usually works for
me :)
For anything except throw-away scripts, I prefer to write scripts with a
"self-test" option so that I (or any other user) can run the test and see
if it works without actually using it f
On Mon, 18 Jun 2012 07:00:01 -0700, jmfauth wrote:
> On 18 juin, 12:11, Steven D'Aprano [email protected]> wrote:
>> On Mon, 18 Jun 2012 02:30:50 -0700, jmfauth wrote:
>> > On 18 juin, 10:28, Benjamin Kaplan wrote:
>> >> The u prefix is only t
)
> :u'\u00e9l\xe9phant'
> 'éléphant'
I cannot reproduce that behaviour. When I try it, I get the expected
result:
>>> input(': ')
: u'\u00e9l\xe9phant'
"u'\\u00e9l\\xe9phant'"
I expect that the mysterious smidzero.py is monkey-patching the input
builtin to do something silly. If that is the case, you are making a rod
for your own back.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
nster.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
nough JIT can be faster
than a static compiler, which leads to cases where Python can be faster
than C:
http://morepypy.blogspot.com.au/2011/02/pypy-faster-than-c-on-carefully-crafted.html
http://morepypy.blogspot.com.au/2011/08/pypy-is-faster-than-c-again-string.html
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ere implemented in Python bytecode, but still, two
calls can't be faster than one.
[...]
> Old news? Thoughts, criticisms, theories?
Premature optimization is the root of all evil.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
t case, monkey-patching __main__ may very well break that
script.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
d it's just an attractive nuisance to
beginners.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
y:
main() # run my application
except Exception as err:
display_error_dialog(err)
# or log to a file, or something...
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
heir only editor.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ou want to treat it as a
Python string literal format using escape characters, you have to parse
it as Python string literal format.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
f work. Thank you for sharing it with the
community, even if only a few people find it useful.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
uot;list zip a b c"?
Making print a statement in the first place was a mistake, but
fortunately it was a simple enough mistake to rectify once the need for
backward compatibility was relaxed.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
_" (or "prnt", "pr", etc.) around it.
Compare that to print as a statement, which only has one argument in
favour: backwards compatibility.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Repeated string concatenation can be *painfully* slow, especially under
Windows. (For some reason, the details of Windows memory management
sometimes prevents the string concat optimization from working.)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ons.html#vars
Python 3:
http://docs.python.org/py3k/library/functions.html#vars
> and it does not appear to be valid Python syntax.
It's perfectly fine syntax, no different from:
my_dict['spam'] = 'a yummy ham-like substance'
or similar.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 27 Jun 2012 17:13:00 -0700, Charles Hixson wrote:
> On 06/25/2012 12:48 AM, Steven D'Aprano wrote:
>> On Sun, 24 Jun 2012 16:16:25 -0700, Charles Hixson wrote:
>>
>>
>>> But what I wanted was to catch any exception.
>>>
>> Be c
o
CPython too.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
on 3:
http://docs.python.org/py3k/library/functions.html#vars
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ude
and pointless to repeatedly retry the same failed request if it cannot
possibly succeed.
I also find that exponential backoff for the delay is best. E.g. wait 1
second after the first failed attempt, 2 seconds after the second, 4
seconds after the third, 8 seconds after the fourth, etc.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ted.
>
> I couldn't find any actual code at that site, the git repository is
> currently empty.
Given that all code contains bugs, that's the best sort of repository!
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ibrary/string.html#formatspec
although sadly all the examples are about using brace substitutions, not
format specs.
(Personally, I find the documentation about format to be less than
helpful.)
You can also read the PEP that introduced the new formatting, but keep in
mind that there have been some changes since the PEP was written, so it
may not quite match the current status quo.
http://www.python.org/dev/peps/pep-3101/
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ropriate and composition should be used. I would re-write the Car
class as follows:
class Engine(object):
pass
class Car(Vehicle):
def __init__(self):
self.engine = Engine()
So now we can talk about Herbie's engine:
herbie.engine # Herbie, being a car, has an engine, he
feature, but the arguments don't stand up. By all means say that you
don't like chained comparisons, that is your right, but your attempts to
rationalise that dislike simply do not work.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
a language where
(unsigned)-1 == -1
apparently is true.
http://nitoprograms.blogspot.com.au/2011/05/signed-and-unsigned-
comparisons-in-c-c.html
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 01 Jul 2012 12:20:52 +1000, Chris Angelico wrote:
> On Sun, Jul 1, 2012 at 12:06 PM, Steven D'Aprano
> wrote:
>> You can't just arbitrarily stick parentheses around parts of
>> expressions and expect the result to remain unchanged. Order of
>> evaluati
On Sun, 01 Jul 2012 14:23:36 +1000, Chris Angelico wrote:
> On Sun, Jul 1, 2012 at 2:17 PM, Steven D'Aprano
> wrote:
>> Nonsense. Of course parens change the evaluation of the expression.
>> That's what parens are for!
>
> The whole point of my example was th
On Sun, 01 Jul 2012 13:48:04 +1000, Chris Angelico wrote:
> On Sun, Jul 1, 2012 at 1:23 PM, Steven D'Aprano
> wrote:
>> All the worse for those languages, since they violate the semantics of
>> mathematical notation.
>
> Not so. It simply means that booleans
ity.html
Chained comparisons in the Python sense may be rare in computer
languages, but it is the standard in mathematics and hardly needs to be
explained to anyone over the age of twelve. That is a terrible indictment
on the state of programming language design.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 01 Jul 2012 09:35:40 +0200, Thomas Jollans wrote:
> On 07/01/2012 04:06 AM, Steven D'Aprano wrote:
>> On Sun, 01 Jul 2012 00:05:26 +0200, Thomas Jollans wrote:
>>
>>> As soon as you read it as a ternary operator,
>>
>> Well that's you
On Sun, 01 Jul 2012 05:55:24 -0400, Terry Reedy wrote:
> On 7/1/2012 2:54 AM, Steven D'Aprano wrote:
>
>> So no, Python has always included chained comparisons, and yes, it is
>> shameful that a language would force you to unlearn standard notation
>> in favour
On Sun, 01 Jul 2012 16:33:15 +1000, Chris Angelico wrote:
> On Sun, Jul 1, 2012 at 4:27 PM, Steven D'Aprano
> wrote:
>> Yes, you can find specially crafted examples where adding parentheses
>> in certain places, but not others, doesn't change the overall
>> eva
On Sun, 01 Jul 2012 21:50:29 -0400, Devin Jeanpierre wrote:
> On Sun, Jul 1, 2012 at 9:28 PM, Steven D'Aprano
> wrote:
>> Technically, < in Python is left-associative: a < b < c first evaluates
>> a, not b or c. But it is left-associative under the rules of comp
thing to do with algebra. It is about picking semantics for
chained comparisons which is sensible and useful and matches what people
expect from regular language.
If you write 2+2 = 2*2 = 4, nearly everyone will agree that, yes, that is
true. Interpreting it as 1 == 4 is neither sensible nor useful and it is
certainly not what people expect.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
the world would be better off if mathematicians threw out the
existing precedence rules and replaced them with a strict left-to-right
precedence. (Personally, I doubt it.)
But until they do, consistency with mathematics is far more important
than the foolish consistency of left-to-right precedence.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 03 Jul 2012 12:25:59 +1000, John O'Hagan wrote:
> On Tue, 3 Jul 2012 11:22:55 +1000
> Chris Angelico wrote:
>
>> On Tue, Jul 3, 2012 at 10:57 AM, Steven D'Aprano
>> wrote:
>>
>> > Perhaps the world would be better off if mathematicians th
oc__': None})
I wonder whether there is some metaclass magic one can do to create a
class without a __dict__?
I don't have a use-case for this. But I have some code which assumes that
every class will have a __dict__, and I wonder whether that is a safe
assumption.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
7;t have an answer.
I suppose you could monkey-patch a bunch of stuff:
if ONLY_PRETEND:
open = my_mock_open
copytree = my_mock_copytree
# etc.
main() # run your application
but that would also be painful.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
tattr(module, class_name)() # note the extra () brackets
I say:
class_ = getattr(module, class_name)
Either that or you have a bug in your module and it can't be imported. Or
you have misspelled the module name, or the class. Or forgotten to import
importlib. Or are shadowing it with your
There are tricks to getting read-only namespaces, but you can
legitimately expect to write to globals().
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
th,
> and using slice. Works perfect.
I don't understand this. What sort of combinations do you think you need
to support? What are "I" values, and why are they important?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
nce Python 2.4 if I
remember correctly. Somebody who cares more than me can possibly check
the "What's New" documents :)
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
ructor, rather than __init__, which runs
after the instance is already created, and to use an isinstance test to
detect when you already have an instance.
Good luck!
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
arth's rotational period relative to the distant stars)
is slightly more than 86164.098 seconds; the sidereal day is slightly
more than 86164.090 seconds. Both are approximately 3 minutes 56 seconds
shorter than the mean solar day.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 05 Jul 2012 15:57:53 +0200, Hans Mulder wrote:
> On 5/07/12 07:32:48, Steven D'Aprano wrote:
>> On Wed, 04 Jul 2012 23:38:17 -0400, Terry Reedy wrote:
>>
>>> If I run the script in 3.3 Idle, I get the same output you got. If I
>>> then enter '5
tc)
t2 = datetime(t1.year, t1.month, t1.day, tzinfo=utc)
assert t1.tzinfo == t2.tzinfo
No assertion error at all.
This makes me think that the "retardation" as you put it is not in
Python's datetime module at all, but in pytz.
What does TZ == TZ give? If it returns False, I recom
ot;Hoory for new math, new-hoo-hoo math" :-)
+1 QOTW
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
chance
of being accepted if you include a patch, or at least tests.
http://bugs.python.org/
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
the 3.3 beta is no longer accepting new
functionality, only bug fixes.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
rs printed (of course! the for loops are identical), except at the
end, after the for-loop has finished, you also call print(), which gives
you this output:
py> for i in range(1, 7):
... print(2 * i, end=' ')
...
2 4 6 8 10 12 py> print()
py>
Notice the blank line printed?
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 15563 matches
Mail list logo