Aahz <[EMAIL PROTECTED]> wrote:
> Ben Finney <[EMAIL PROTECTED]> wrote:
> >So, under PEP 328 rules, the original poster's current-directory
> >module could only be imported (a) if the current directory was in
> >sys.path, or (b) if the code specified a relati
\ it, it said 'Day 1: Still tired from the move. Day 2: Everybody |
_o__) talks to me like I'm an idiot.'" -- Steven Wright |
Ben Finney <http://www.benfinney.id.au/>
--
http://mail.python.org/mailman/listinfo/python-list
and each
instance has its own 'bar' attribute created separately (in the
__init__() method).
--
\ "Unix is an operating system, OS/2 is half an operating system, |
`\ Windows is a shell, and DOS is a boot partition virus." -- |
_o__) Peter H. Coffin |
Ben Finney <http://www.benfinney.id.au/>
--
http://mail.python.org/mailman/listinfo/python-list
quot; -- Justice Roberts in 319 U.S. 624 (1943) |
_o__) |
Ben Finney <http://www.benfinney.id.au/>
--
http://mail.python.org/mailman/listinfo/python-list
ond-class citizen in the wx
world.
--
\ "I was the kid next door's imaginary friend." -- Emo Philips |
`\ |
_o__) |
Ben Finney <http://www.benfinney.id.au/>
--
http://mail.python.org/mailman/listinfo/python-list
://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/408713>
--
\ "Any sufficiently advanced bug is indistinguishable from a |
`\ feature." -- Rich Kulawiec |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
tacts, but I only need them when I read, so I got |
`\ flip-ups." -- Steven Wright |
_o__) |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
-
\ "If trees could scream, would we be so cavalier about cutting |
`\ them down? We might, if they screamed all the time, for no good |
_o__) reason." -- Jack Handey |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list
alex wrote On 17/02/05 02:08:
how can I check if a variable is a structure (i.e. a list)? For my
special problem the variable is either a character string OR a list
of character strings line ['word1', 'word2',...]
You're trying to apply the LBYL principle. My bet is that your "special
problem" c
what I'm pondering?” “I think so, |
`\ Brain, but shouldn't the bat boy be wearing a cape?” —_Pinky |
_o__) and The Brain_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ith some good ideas.” —Jack Handey |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ge
http://pillow.readthedocs.org/en/latest/reference/Image.html>.
--
\ “It seems intuitively obvious to me, which means that it might |
`\ be wrong.” —Chris Torek |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Ben Finney writes:
> To turn a byte string into a file-like object for use with PIL, extract
> the byte string as ‘image_data’, use the standard library ‘io.StringIO’
> class http://docs.python.org/3/library/io.html#io.StringIO>, then
> create a new ‘PIL.Image’ object by reading f
ntaining a URL to an amusing Twitter post about
Python.
--
\ “True greatness is measured by how much freedom you give to |
`\ others, not by how much you can coerce others to do what you |
_o__) want.” —Larry Wall |
Ben
el.
Is there something particular about these functions that make them more
difficult than good code?
--
\ “Generally speaking, the errors in religion are dangerous; |
`\those in philosophy only ridiculous.” —David Hume, _A Treatise |
_o__)
r the long run on distinguishing one |
`\ bitstream from another in order to figure out which rules |
_o__) apply.” —Eben Moglen, _Anarchism Triumphant_, 1999 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ure.
--
\ “The trouble with the world is that the stupid are cocksure and |
`\ the intelligent are full of doubt.” —Bertrand Russell |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
, but how does it work in |
`\ *theory*?” —anonymous |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
rk?
--
\“Program testing can be a very effective way to show the |
`\presence of bugs, but is hopelessly inadequate for showing |
_o__) their absence.” —Edsger W. Dijkstra |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
and/or convince your system
administrators to remove it when sending to public forums.
--
\“… Nature … is seen to do all things Herself and through |
`\ herself of own accord, rid of all gods.” —Titus Lucretius |
_o__) Carus, c. 40
“Nature hath given men one tongue but two ears, that we may |
`\ hear from others twice as much as we speak.” —Epictetus, |
_o__) _Fragments_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ey should get. If they want to take advantage
of a local connection, they can use a Unix domain socket.
--
\ “I wrote a song, but I can't read music so I don't know what it |
`\is. Every once in a while I'll be listening to the radio and I |
_o__) say, ‘I think I
rums http://getnikola.com/contact.html>.
--
\ “I do not believe in forgiveness as it is preached by the |
`\church. We do not need the forgiveness of God, but of each |
_o__)other and of ourselves.” —Robert G. Ingersoll |
Ben Finney
--
https://mai
oughts?
I'd try very hard to find an equivalent URL that isn't so long :-) but
URLs in comments are a good example of a PEP 8 exception: if the line is
over 80 characters because it contains a long URL in a comment, that's
fine, as I'm not expecting the human reader to be scanning it carefully
like other text in the code.
--
\“I fly Air Bizarre. You buy a combination one-way round-trip |
`\ticket. Leave any Monday, and they bring you back the previous |
_o__) Friday. That way you still have the weekend.” —Steven Wright |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Not least because you're very likely going to use the value of
‘file_path’ yet again in the body of that ‘if’ block.
--
\ “Two paradoxes are better than one; they may even suggest a |
`\ solution.” —Edward Teller |
_o__)
ers. Thank you.
--
\ “The most common way people give up their power is by thinking |
`\ they don't have any.” —Alice Walker |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano writes:
> On Thu, 28 Nov 2013 13:47:22 +1100, Ben Finney wrote:
> > [A triple-quoted string is] not syntactically a comment, and I don't
> > think pretending triple-quoted strings are comments is good
> > practice. If nothing else, you'l
\ so, Brain, but three men in a tub? Ooh, that's unsanitary!” |
_o__) —_Pinky and The Brain_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
provided with a filename dynamically created by Bash, referring to a
temporary file that contains the output of the subshell.
--
\ “Welchen Teil von ‘Gestalt’ verstehen Sie nicht? [What part of |
`\‘gestalt’ don't you understand?]” —Karsten M. Self |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
27;s article.
--
\ “Pray, v. To ask that the laws of the universe be annulled in |
`\ behalf of a single petitioner confessedly unworthy.” —Ambrose |
_o__) Bierce, _The Devil's Dictionary_, 1906 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
alf of you half as well as I should like, and I |
`\ like less than half of you half as well as you deserve.” —Bilbo |
_o__) Baggins |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
re unpopular because they require |
`\ hard work and discipline to achieve and education to be |
_o__)appreciated.” —Edsger W. Dijkstra |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
“A child of five could understand this. Fetch me a child of |
`\ five.” —Groucho Marx |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Dan Stromberg writes:
> On Mon, Dec 9, 2013 at 10:40 PM, Ben Finney wrote:
> > What information would you want access to? Why would a library
> > (rather than, say, a short set of strings) be needed?
> >
> Movie ratings. EG G, PG, PG-13, etc.
That tells me only tha
at the brain was the most wonderful organ in |
`\ my body. Then I realized who was telling me this.” —Emo Philips |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
a furious |
`\ argument over what I considered to be an odd number.” —Steven |
_o__) Wright |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
;ll be interested to know the rest of that paragraph, to know whether
the above list comprehension meets your constraints.
--
\ “I was in the first submarine. Instead of a periscope, they had |
`\ a kaleidoscope. ‘We're surrounded.’” —Steven Wright |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ives
the command line as a parameter, and returns the exit code.
--
\ “Faith, n. Belief without evidence in what is told by one who |
`\ speaks without knowledge, of things without parallel.” —Ambrose |
_o__) Bierce, _The Devil's Dictionary_, 1906 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ly from several operating systems (e.g.
Debian) or install it yourself. It works with numerous existing mail
clients, and brings the significant advantage of organising one's email
by search, not by exclusive folders.
--
\“Intellectual property is to the 21st century what the slave |
? Is that useful for
determining which branch to take?
--
\ “The fact that a believer is happier than a skeptic is no more |
`\ to the point than the fact that a drunken man is happier than a |
_o__) sober one.” —George Bernard Shaw |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
u tell the users of today about that, and they don't believe you.
--
\ “If nature has made any one thing less susceptible than all |
`\others of exclusive property, it is the action of the thinking |
_o__) power called an idea” —Thomas Jefferson |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Ben Finney writes:
> Larry Martell writes:
>
> > On Wed, Dec 11, 2013 at 8:42 PM, Roy Smith wrote:
> > > rusi wrote:
> > >
> > >> Many assumptions need to be verified/truthified/dovetailed
> > >> starting from switching on the machine
ur way to a time when faith, without evidence, |
`\disgraces anyone who would claim it.” —Sam Harris, _The End of |
_o__) Faith_, 2004 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ering what I'm pondering?” “I think so, |
`\Brain, but Zero Mostel times anything will still give you Zero |
_o__) Mostel.” —_Pinky and The Brain_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
“For fast acting relief, try slowing down.” —Jane Wagner, via |
`\ Lily Tomlin |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
the supply has always been in excess of |
`\ the demand.” —Josh Billings |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> On Mon, Dec 16, 2013 at 3:50 PM, Ben Finney
> wrote:
> > Should we expect (ignoring pathological cases) the assertion
> > ‘type(obj) is obj.__class__’ to hold true? If not, under what
> > circumstances would it be sensible for those to diff
my life there.” —Charles F. Kettering |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
g down.” —Jane Wagner, via |
`\ Lily Tomlin |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
for peace. Hitler was for |
`\ peace. Everybody is for peace. The question is: what kind of |
_o__) peace?” —Noam Chomsky, 1984-05-14 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
\ “It is far better to grasp the universe as it really is than to |
`\persist in delusion, however satisfying and reassuring.” —Carl |
_o__) Sagan |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
o Google Groups being scrapped!
--
\ “And if I laugh at any mortal thing, / 'Tis that I may not |
`\ weep.” —“Lord” George Gordon Noel Byron, _Don Juan_ |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
roprietary software packages, is |
`\ being able to choose your master. Freedom means not having a |
_o__) master.” —Richard M. Stallman, 2007-05-16 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Michael Torrie writes:
> On 01/05/2014 04:30 PM, Ben Finney wrote:
> > In short: Everything that was good about OpenOffice is now called
> > LibreOffice, which had to change its name only because the owners of
> > that name refused to let it go.
>
> Your information i
grammers need to learn this messy
arbitrary crap, at least to the point of knowing unambiguously what we
ask the computer to do when it interacts with the messy real world.
--
\ “I prayed for twenty years but received no answer until I |
`\ prayed with my legs.” —Frederick Do
Chris Angelico writes:
> On Thu, Jan 9, 2014 at 2:34 PM, Ben Finney wrote:
> > With time zones, as with text encodings, there is a single
> > technically elegant solution (for text: Unicode; for time zones:
> > twelve simple, static zones that never change)
>
> Twe
e responses giving feedback.
--
\ “My girlfriend has a queen sized bed; I have a court jester |
`\ sized bed. It's red and green and has bells on it, and the ends |
_o__) curl up.” —Steven Wright |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
for you? If not, can you explain more precisely what you're
asking?
--
\ “A child of five could understand this. Fetch me a child of |
`\ five.” —Groucho Marx |
_o__) |
w’
function explicitly returns a naive datetime object, not an aware
datetime object.
--
\ “We must respect the other fellow's religion, but only in the |
`\ sense and to the extent that we respect his theory that his |
_o__) wife is beautiful and his children smart.” —Henry
Kushal Kumaran writes:
> Ben Finney writes:
>
> > Kushal Kumaran writes:
> >
> >> Roy Smith writes:
> >> > How, in Python, do you get an aware UTC datetime object?
> >>
> >> classmethod datetime.utcnow()
> >>
> >>
—Edsger W. Dijkstra |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
stdin and stdout are ASCII, largely because it hasn't been told
otherwise.
--
\“The greatest tragedy in mankind's entire history may be the |
`\ hijacking of morality by religion.” —Arthur C. Clarke, 1991 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
--
\ “Nature hath given men one tongue but two ears, that we may |
`\ hear from others twice as much as we speak.” —Epictetus, |
_o__) _Fragments_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
hich exception?)
+1. I'd like a custom exception class, sub-classed from ValueError.
--
\ “I love to go down to the schoolyard and watch all the little |
`\ children jump up and down and run around yelling and screaming. |
_o__) They don't know I'm only using blanks.” —Emo Philips |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Roy Smith writes:
> Ben Finney wrote:
>
> > Who says it's frowned on to do work in the initialiser? Where are they
> > saying it? That seems over-broad, I'd like to read the context of that
> > advice.
>
> There are some people who advocate that C++ co
x27;ll leave
the academic exercise to someone else.
--
\“… Nature … is seen to do all things Herself and through |
`\ herself of own accord, rid of all gods.” —Titus Lucretius |
_o__) Carus, c. 40 BCE |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
\ looks out it, and if he leans too far, he falls out. Wait. I |
_o__)guess that's like a regular window.” —Jack Handey |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
), and
removal of ‘except ExcClass, exc_instance’ (use ‘except ExcClass as
exc_instance’ instead).
--
\ “For my birthday I got a humidifier and a de-humidifier. I put |
`\ them in the same room and let them fight it out.” —Steven Wright |
_o__)
Ben Finney writes:
> Terry Reedy writes:
>
> > Since 3.0, we have added new syntax ('yield from', u'' for instance)
> > but I do not believe we have deleted or changed any syntax (I might
> > have forgotten something minor)
>
> I'm aware o
ever enough to keep |
`\up.” —Jane Wagner, via Lily Tomlin |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
iarism rules.
--
\ “It is well to remember that the entire universe, with one |
`\ trifling exception, is composed of others.” —John Andrew Holmes |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
le’
library https://pypi.python.org/pypi/lockfile/> which is commonly
used with ‘python-daemon’.
--
\ “Pinky, are you pondering what I'm pondering?” “I think so, |
`\Brain, but if we give peas a chance, won't the lima beans feel |
_o__)left out?
bert |
_o__)Einstein, unsent letter, 1955 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
I just can't get started until |
`\ I've had that first, piping hot pot of coffee. Oh, I've tried |
_o__)other enemas...” —Emo Philips |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
\ for granted … but to weigh and consider.” —Francis Bacon |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
|
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
s it is an attractive but inappropriate tool. You
may need to construct a more specific parser for your needs. Even if
it's possible with regex, the resulting pattern may be so complex that
it's better to write it out more explicitly.
--
\ “To punish me for my contempt of aut
Woodcock |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
pecific operation is occupying too much time. Write
the code correct and readable first, before trying to optimise what you
don't need to yet.
--
\ “Value your freedom or you will lose it, teaches history. |
`\ “Don't bother us with politics,” respond those who don'
All my life I've had one dream: to achieve my many goals.” |
`\ —Homer, _The Simpsons_ |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ohn Kenneth Galbraith, 1989-07-28 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Roy Smith writes:
> Ben Finney wrote:
>
> > Makes sense, since ‘datetime’ can do everything ‘date’ can do, and
> > is conceptually a subset of the same concept.
>
> That's reasonable, but given that, it's weird that date(2014, 1, 23) ==
> datetime(2014,
ey're exactly like the old ones.” —Charles F. Kettering |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
races anyone who would claim it.” —Sam Harris, _The End of |
_o__) Faith_, 2004 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
does not have this command; you may want to use a better mail
client which implements this feature.
--
\ “I must say that I find television very educational. The minute |
`\ somebody turns it on, I go to the library and read a book.” |
_o__)
ust take precedence over public relations, for nature |
`\ cannot be fooled.” —Richard P. Feynman |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
2014, 1, 29, 22, 35, 7, 900526, tzinfo=)
>>> now.astimezone(LOCAL_TZ)
datetime.datetime(2014, 1, 29, 16, 35, 7, 900526, tzinfo=)
--
\ “We tend to scoff at the beliefs of the ancients. But we can't |
`\scoff at them personally, to their faces, and this is what |
_o__) annoys me.” —Jack Handey |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
\ his fellow-men is dishonest and infamous.” —Robert G. |
_o__) Ingersoll, _The Liberty of Man, Woman and Child_, 1877 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
should-go>.
--
\ “My, your, his, hers, ours, theirs, its. I'm, you're, he's, |
`\ she's, we're, they're, it's.” —anonymous, alt.sysadmin.recovery |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ed (I'm not
convinced it is needed), it should have that same behaviour.
--
\ “I tell you the truth: this generation will certainly not pass |
`\ away until all these things [the end of the world] have |
_o__) happened.” —Jesus Christ, c. 30 CE, as quoted in Matthew
Ben Finney writes:
> Time zones are a hairy beast to manage, made all the more difficult
> because national politicians continually fiddle with them which means
> they can't just be a built-in part of the Python standard library.
PyCon 2013 had a good talk on calendaring and t
Steven D'Aprano writes:
> On Fri, 31 Jan 2014 11:35:14 +1100, Ben Finney wrote:
>
> > Cameron Simpson writes:
> >> Firstly, replace is a verb, and I would normally read
> >> td.replace(microseconds=0) as an instruction to modify td in place.
> >>
in arms is not spending money alone. It is spending |
`\ the sweat of its laborers, the genius of its scientists, the |
_o__) hopes of its children.” —Dwight Eisenhower, 1953-04-16 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Python warn that it's not 100% perfect? Are people |
`\ just supposed to “know” this, magically?” —Mitya Sirenef, |
_o__) comp.lang.python, 2012-12-27 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Ned Batchelder writes:
> On 1/31/14 6:05 PM, Ben Finney wrote:
> > Here we disagree. I think the meaning “… and that returns the new
> > instance” is entailed in the meaning of “constructor”.
> > […]
>
> You say these terms already have meanings, and that construc
Ethan Furman writes:
> On 01/31/2014 03:47 PM, Ben Finney wrote:
> > I suggest:
> >
> > Called automatically by the constructor “__new__” during
> > instance creation, to initialise the new instance.
>
> But __new__ does not call __init__, type does [1]
Ben Finney writes:
> My apologies, you're right and that's made clear at
> .
And that's a URL to my local filesystem.
Clearly it's time for me to step away from the discussion for a while
:-)
--
\ “I went to the cinema, it said ‘Adults: $5.00, Children $2.50’.
cs should (somehow) say
that clearly.
--
\ “He may look like an idiot and talk like an idiot but don't let |
`\ that fool you. He really is an idiot.” —Groucho Marx |
_o__) |
Ben Finney
--
https://mail.pyth
\ “If nature has made any one thing less susceptible than all |
`\others of exclusive property, it is the action of the thinking |
_o__) power called an idea” —Thomas Jefferson |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
” —Ogden Nash |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
901 - 1000 of 4138 matches
Mail list logo