Re: RE: Advise of programming one of my first programs

2012-03-27 Thread Devin Jeanpierre
nding, the use of Pickle is also dangerous if you > are not completely sure what is being passed in: Oh goodness yes. pickle is exactly as unsafe as eval is. Try running this code: from pickle import loads loads("c__builtin__\neval\n(c__builtin__\nraw_input\n(S'py>'\ntRtR

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-29 Thread Devin Jeanpierre
There _are_ times when this is technical, and there are specific areas of this that have technical difficulties, but... that's different, and interesting, and being actively researched, and not really impossible either. I don't know. This is maybe a bit too rant-y and disorganized; if s

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-29 Thread Devin Jeanpierre
t things like set builder). Well, what sort of language differences make for English vs Mandarin? Relational algebraic-style programming is useful, but definitely a large language barrier to people that don't know any SQL. I think this is reasonable. (It would not matter even if you gave SQL pyth

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-29 Thread Devin Jeanpierre
es when this is technical". ("political" is a bad word for it, because it covers things that are just plain bad ideas (but, subjectively). For example, there's nothing technically challenging about adding an operator that wipes the user's home directory.) -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-29 Thread Devin Jeanpierre
r > abstractions are developed and concurrent, distributed computation is > rigorously systematized, I think we'll go full circle. Maybe I'm too tired, but this went straight over my head, sorry. Perhaps you could be a bit more explicit about what you mean by the implications/logic? -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Programing Art or Science?

2012-04-03 Thread Devin Jeanpierre
d and only stupid people care about it." You probably should have read the email before replying to it. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: f python?

2012-04-10 Thread Devin Jeanpierre
The post you're criticising specifically gave a definition for cdr that had the semantics he wanted. "where cdr(s) is conveniently defined as s + 1." (car can be defined as s[0]). The real difference is the lack of error checking and the lack of cons. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: A case for "real" multiline comments

2012-04-18 Thread Devin Jeanpierre
n editor that doesn't highlight comments appropriately? Fortunately, my editor can insert single-line comments in bulk, so multi-line comments aren't a big deal to me. I don't really get why Python doesn't have them, though. > I would say you've made a case _against_ multi

Re: A case for "real" multiline comments

2012-04-19 Thread Devin Jeanpierre
hat refuse to do this, AFAIK. Least importantly: Why are multiline comments line-oriented? Why not inline, like with the C-style /* ... */ comments? This doesn't seem like a "proper" multiline comment. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-22 Thread Devin Jeanpierre
ay or may not return True. Then let's just go to the definition: http://mathworld.wolfram.com/Well-Defined.html "An expression is called "well-defined" (or unambiguous) if its definition assigns it a unique interpretation or value. Otherwise, the expression is said to not b

Re: why () is () and [] is [] work in other way?

2012-04-22 Thread Devin Jeanpierre
n? I thought it was universal...) definition of "ill-defined": http://mathworld.wolfram.com/Ill-Defined.html "() is ()" does not have one unique value in all interpretations. It can be either True or False, depending on the Python. (At least, I think this was the consensus). Therefore "is" is ill-defined in this case. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-22 Thread Devin Jeanpierre
On Mon, Apr 23, 2012 at 12:42 AM, Devin Jeanpierre wrote: > On Mon, Apr 23, 2012 at 12:34 AM, Steven D'Aprano > wrote: >> "is" is never ill-defined. "is" always, without exception, returns True >> if the two operands are the same object, and Fals

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
ct is implementation-dependent. >> -- > > And if I try running "from java.util import ArrayList" in CPython it > will give me an import error. It doesn't mean that the import > mechanism is broken because it returns different results in different > implementations

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
more predictable. Well, no. Immutable objects could always compare equal, for example. This is more expensive though. is as-it-stands is very quick to execute, which is probably attractive to some people (especially for its used in detecting special constants). -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
s now. I am a bit regretful, the discussion of whether "is" itself is ambiguous, or the actual values, doesn't really matter. What matters is that sometimes "() is ()" will return True, and sometimes it will return False. It doesn't really matter whether it's "is" that's ambiguous, or the identity of newly made tuples. The point is that something is ambiguous. And maybe that's worth changing? -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
On Mon, Apr 23, 2012 at 4:27 PM, Devin Jeanpierre wrote: > Well, no. Immutable objects could always compare equal, for example. > This is more expensive though. is as-it-stands is very quick to > execute, which is probably attractive to some people (especially for > its used in detec

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
crete computational process objects do. I meant "number objects". I hope I did not cause any genuine confusion. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
off the top of my head. Hold up, why do we give up interning? As you mention later, interning only involves hashing and equality comparisons, not id() or is. (e.g. we can intern `y` just fine with `y = cache.setdefault(y, y)`) -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
On Mon, Apr 23, 2012 at 8:03 PM, Tim Delaney wrote: > On 24 April 2012 09:08, Devin Jeanpierre wrote: >> >> On Mon, Apr 23, 2012 at 6:26 PM, Tim Delaney >> wrote: >> > And doing that would make zero sense, because it directly contradicts >> > the >>

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
'm not in favor of doing that. It's a nice optimization, there's no point doing it in cases where it leads to _worse_ performance. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Devin Jeanpierre
am done with this thread. ... Good idea. We clearly understand Python's behavior. I just spent the whole time bickering about definitions. Ugh. I'm an idiot. Sorry for the trouble. -- Devin (P.S. can we all start saying "muppet" next?) -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Devin Jeanpierre
ttention to the "bytes of code" comparison -- it's rare one sees a language more verbose than C) http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=ats&lang2=gcc -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting 1172026 entries

2012-05-06 Thread Devin Jeanpierre
random floats takes about 1.5 seconds to do on my machine. More complicated objects take more time, but usually not that much more time. What exactly are you sorting? -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting 1172026 entries

2012-05-06 Thread Devin Jeanpierre
time.datetime.now() + datetime.timedelta(random.getrandbits(10)), >>> random.getrandbits(32)) for _ in xrange(1172026)] >>> random.shuffle(x) >>> x.sort() >>> -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-08 Thread Devin Jeanpierre
ere is only that one thing -- Luke has no """fork""" of his own codebase. I guess it won't die of stagnation, eh? It'll be a perfectly usable, stable project, led by a thief. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-09 Thread Devin Jeanpierre
://mail.python.org/pipermail/python-list/2012-May/1291804.html ). -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: parallel programming in Python

2012-05-10 Thread Devin Jeanpierre
etty general and good though. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Retrieving result from embedded execution

2012-05-11 Thread Devin Jeanpierre
; objects in Python space, which could then forward the output in any way you > want. Surely a pipe would cause a deadlock if the pipe fills up if Python and the C program are running in the same process/thread? I'm not too familiar with these sorts of things. -- Devin -- http://mai

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Devin Jeanpierre
> you're expecting them. How am I supposed to know to expect them, if they are undocumented? Trial and error? That seems like a poor replacement for documented error conditions. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie naive question ... int() throws ValueError

2012-05-11 Thread Devin Jeanpierre
p` in the list documentation. Kinda hard to get there without already knowing the answer. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie naive question ... int() throws ValueError

2012-05-12 Thread Devin Jeanpierre
reading the docs on ValueError is probably worth doing the first time you see it. Although, it's also one of those exceptions that has a "clear" name, so it isn't something everyone will do. I'm not sure if I ever did it. And certainly the OP never looked there. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call and execute C code in Python?

2012-05-13 Thread Devin Jeanpierre
: http://docs.cython.org/src/userguide/debugging.html Now if only my editor would bold those "cdef"s... :) -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: non-pickle persistance for dicts?

2012-05-16 Thread Devin Jeanpierre
t wasn't serialized properly. repr() is not meant for storing data, it's meant for presenting it to a programmer. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-17 Thread Devin Jeanpierre
t on the wording of str.isdecimal()? It seems to imply that ''.isdecimal() should be true. (It isn't.) Especially when compared like that to isdigit, which makes a point of noting this particular edge case. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Where is the most recent Tkinter information

2012-05-17 Thread Devin Jeanpierre
only a few weeks ago. And that's a stronger claim anyway. ;) > Here are some other resources I have stumbled on... > [...] > http://www.tkdocs.com/tutorial/index.html This looks really good. Thanks. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Doctest documentation?

2012-05-20 Thread Devin Jeanpierre
This was previously reported as http://bugs.python.org/issue12947 -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespace hack

2012-05-25 Thread Devin Jeanpierre
laugh > even though I'd like to. Can you be less condescending? -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 raw strings and \u escapes

2012-05-30 Thread Devin Jeanpierre
be backwards incompatible, though, so maybe it's too late. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to exec() a string like interactive python does?

2012-06-05 Thread Devin Jeanpierre
>>> >>> def myexec(s): ... eval(compile(s, '', 'single')) ... >>> x = 3 >>> myexec('x = 4') >>> myexec('x') 3 >>> myexec('print x') 3 >>> On Tue, Jun 5, 2012 at 6:12 PM, News123 wrote: > If I start Python in interactive mode, > and I yype the commands, > 'a=3', 'a', 'print a' > > > Then the  

Re: mode for file created by open

2012-06-08 Thread Devin Jeanpierre
the additional option of providing a special file opener. http://docs.python.org/dev/library/functions.html#open -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: Import semantics?

2012-06-08 Thread Devin Jeanpierre
eap.py were in the same directory. Otherwise it looks like whichever comes first in the search path is imported first. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: mode for file created by open

2012-06-09 Thread Devin Jeanpierre
'w', and open has a large and growing list of parameters. A chmod method would also work. Although you can use os.fchmod(f.fileno(), ...) instead (another workaround? fun. TIMTOWTDI I guess). -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: which one do you prefer? python with C# or java?

2012-06-09 Thread Devin Jeanpierre
fter Haskell). Of those three, Prolog would be easiest to use with Python, due to its predictable execution and the existence of bindings (search PyPI). -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: How does python bytecode works?

2012-06-17 Thread Devin Jeanpierre
thing other than the interpreter. The bytecode doesn't really have much to do with all this, except that it is the specific thing that CPython works with. -- Devin -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] allow line break at operators

2011-08-11 Thread Devin Jeanpierre
Javascript also lets you break lines. For example, this does what you want: return 1 + 5 Whereas this does not return 1 + 5 Of course, Python would have no such problem, because you could make both cases unambiguous due to the indent. Devin On Thu, Aug 11, 2011 at 3

Re: [Python-ideas] allow line break at operators

2011-08-11 Thread Devin Jeanpierre
ts, namely, by doing it to the tokenstream rather than to the actual text) Devin On Thu, Aug 11, 2011 at 4:45 PM, Bruce Leban wrote: > > On Thu, Aug 11, 2011 at 12:24 PM, Devin Jeanpierre > wrote: >> >> Javascript also lets you break lines. For example, this does what yo

Re: [Python-ideas] allow line break at operators

2011-08-11 Thread Devin Jeanpierre
parentheses and especially \ everywhere. Parentheses can be awkward and don't quite work everywhere the way one might want, and \ has that trailing space ugliness. Devin On Thu, Aug 11, 2011 at 5:21 PM, Bruce Leban wrote: > > On Thu, Aug 11, 2011 at 2:06 PM, Devin Jeanpierre >

Re: [Python-ideas] allow line break at operators

2011-08-11 Thread Devin Jeanpierre
that has indentation stripped or mangled due to the transition medium would be even harder to recompose. Devin On Thu, Aug 11, 2011 at 5:39 PM, Jim Jewett wrote: > On Thu, Aug 11, 2011 at 5:29 PM, Devin Jeanpierre > wrote: >> Howeverm indentation errors have been extremely rare

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
value in a meaningful sense, it's just that by saying that we say that the values being passed are references/pointers. This is maybe one level of abstraction below what's ideal, but Scheme, Java, etc. share this terminology. (Ruby calls it pass-by-reference AFAIK. Whatever, a rose by any other name...) Devin Jeanpierre -- http://mail.python.org/mailman/listinfo/python-list

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
On May 4, 6:51 am, Steven D'Aprano wrote: > On Wed, 04 May 2011 02:56:28 -0700, Devin Jeanpierre wrote: > > Python is pass-by-value in a > > meaningful sense, it's just that by saying that we say that the values > > being passed are references/pointers. This is may

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
On May 4, 6:56 am, Hans Georg Schaathun wrote: > On Wed, 4 May 2011 02:56:28 -0700 (PDT), Devin Jeanpierre  > wrote: > > :  Eh, that example doesn't say what you think it does. It has the same > :  behavior in C:http://ideone.com/Fq09N. Python is pass-by-value in a > :

Re: What other languages use the same data model as Python?

2011-05-04 Thread Devin Jeanpierre
thing for me to self-deprecatingly suggest I'm brainwashed (with a smile), and another for you to agree in complete seriousness. Devin Jeanpierre -- http://mail.python.org/mailman/listinfo/python-list

Re: binary decision diagrams

2017-12-20 Thread Devin Jeanpierre
ean function f. But > what is the easiest (fool-proof) way to print out a diagram of g ? Python doesn't come with support for (ro)bdds built-in. You're probably thinking of this library, which includes visualization instructions: http://pyeda.readthedocs.io/en/latest/bdd.html

Re: Clickable hyperlinks

2017-01-03 Thread Devin Jeanpierre
Sadly, no. :( Consoles (and stdout) are just text, not hypertext. The way to make an URL clickable is to use a terminal that makes URLs clickable, and print the URL: print("%s: %s" % (description, url)) -- Devin On Tue, Jan 3, 2017 at 11:46 AM, Deborah Swanson wrote: > Excel

Re: Clickable hyperlinks

2017-01-05 Thread Devin Jeanpierre
Sadly, no. :( Consoles (and stdout) are just text, not hypertext. The way to make an URL clickable is to use a terminal that makes URLs clickable, and print the URL: print("%s: %s" % (description, url)) -- Devin On Tue, Jan 3, 2017 at 11:46 AM, Deborah Swanson wrote: > Excel

Re: Why is the use of an undefined name not a syntax error?

2018-04-01 Thread Devin Jeanpierre
raise UnboundLocalError if not x -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is the use of an undefined name not a syntax error?

2018-04-01 Thread Devin Jeanpierre
possibility, and there's no rule that says "just because this will always raise an exception, we can fail at compile-time instead". Maybe a particular UnboundLocalError was on purpose, after all. Python doesn't know. So probably this can't ever sensibly be a compile error, even if it's a fantastically useful lint warning. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Thread-safe way to add a key to a dict only if it isn't already there?

2018-07-07 Thread Devin Jeanpierre
ety a couple of years ago (to help with things like GIL-less python projects), but I guess nothing ever came of it. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Kindness

2018-07-13 Thread Devin Jeanpierre
g someone. Even if you think it is justified, consider how it looks to others. I am afraid of ever getting on your "bad side", and I bet the same is true of other non-Bart people, too. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Users banned

2018-07-15 Thread Devin Jeanpierre
were bullying. The behavior on the list the past few days has been unforgivably toxic, and that has nothing to do with the behavior of Bart et al. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Importing by file name

2013-11-23 Thread Devin Jeanpierre
ext(fname) sys.path.insert(0, dname) try: return __import__(modname) finally: del sys.path[0] -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-23 Thread Devin Jeanpierre
can either maintain a killfile or use the mailing list. The state of discussion here as it stands is absurd, what with the trolling and irrelevant rants and subsequent explosions of hate. This list needs stronger moderation. Please. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Implement logic on object.attribute and object.attribute()

2013-11-24 Thread Devin Jeanpierre
uot; I want an > HTTP POST request to be executed. Uh oh. What you want is impossible. You cannot call an attribute without first accessing it. :( -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Implement logic on object.attribute and object.attribute()

2013-11-24 Thread Devin Jeanpierre
On Sun, Nov 24, 2013 at 5:45 AM, Steven D'Aprano wrote: > On Sun, 24 Nov 2013 05:04:16 -0800, Devin Jeanpierre wrote: >> Uh oh. What you want is impossible. You cannot call an attribute without >> first accessing it. :( > > Not quite impossible. All you need is an

Re: Understanding relative imports in package - and running pytest with relative imports?

2013-11-24 Thread Devin Jeanpierre
setup.py * furniture/ ... * tests/ - test_chair.py - test_common.py - test_table.py Note that tests is not a package either. py.test and nose work by loading files, NOT modules. So they won't work with loading test submodules in a package. For this and other reasons, I personally stay away from nose and py.test. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: interactive help on the base object

2013-12-07 Thread Devin Jeanpierre
docs frequently point out potential security vulnerabilities in usages of libraries where pydoc does not. (The wording *is* awkward, though.) -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread Devin Jeanpierre
learn things that are unnecessary to get the bare minimum accomplished. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-15 Thread Devin Jeanpierre
e will be either classobj or instance; and the __class__ doesn't exist (for class objects) or is what you'd expect (for instances). This isn't particularly pathological, so I disagree with the suggestion that one should always definitely use type() for style reasons. -- Devin --

Re: Comparing values of counter in python 3.3

2013-12-16 Thread Devin Jeanpierre
'aab') >>> c2 - c1 Counter({'a': 1}) >>> [(k, c2[k]) for k in c2 - c1] [('a', 2)] Counter subtraction is multiset subtraction, not set subtraction. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-17 Thread Devin Jeanpierre
going to perform. I don't know. Will it do float addition? int addition? size_t addition? How does coercion work? + can do many different things, it's not just a straight translation to an obvious machine instruction. > If you maim yourself with a razor-sharp chisel, do you blame the chi

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-17 Thread Devin Jeanpierre
On Tue, Dec 17, 2013 at 7:01 PM, Chris Angelico wrote: > On Wed, Dec 18, 2013 at 1:33 PM, Devin Jeanpierre > wrote: >> Yes you do. Lifetimes are hard, because you need to malloc a lot, and >> there is no defined lifetime for pointers -- they could last for just >> the l

Re: sort(*, key=None, reverse=None)

2013-12-20 Thread Devin Jeanpierre
arguments that can only be passed by keyword". Am I correct? It's good practice in technical writing to repeat yourself: once in the formal spec, and once in plain english. I don't see why this would be a typo. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: @property simultaneous setter and getter

2013-12-21 Thread Devin Jeanpierre
print "accessing attr" return instance._attr def __set__(self, instance, value): print "setting attr to {}".format(value) instance._attr = value a = A() a.attr a.attr = 42 A().attr A().attr = 3 -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Mailing list erraticness

2013-12-31 Thread Devin Jeanpierre
I can't tell from your email who the original author of the forwarded email is. :( On Mon, Dec 30, 2013 at 9:19 PM, Ethan Furman wrote: > More mailing list erraticness: > I see Ethan's comment on Devin but not Devin's post > Neither in GG nor in my email No

Re: Blog "about python 3"

2013-12-31 Thread Devin Jeanpierre
h I will explain few to no specific disagreements, nor will I give anyone the benefit of the doubt, because that would be silly. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: PySerial for Python 2 vs. Python 3

2013-12-31 Thread Devin Jeanpierre
et the most help if you provide a minimal, self-contained, runnable example, and an example of its exact output. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp?

2014-01-03 Thread Devin Jeanpierre
is doesn't seem like a useful question to ask. Anyway, most of the useful bits of Python aren't present or have different semantics than how they work in lisps. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Is Python really "Lisp without parentheses"? So would it be easy to *implement* a lot of Python in Scheme/Lisp?

2014-01-03 Thread Devin Jeanpierre
On Fri, Jan 3, 2014 at 9:26 AM, Chris Seberino wrote: > On Friday, January 3, 2014 11:10:07 AM UTC-6, Devin Jeanpierre wrote: >> A lecturer of mine back in university did this (implemented a subset >> of Python in Racket). My understanding is that this is primarily >> int

Re: Blog "about python 3"

2014-01-05 Thread Devin Jeanpierre
abeled as such. I try to reword them as, "I prefer to look at it as ..." -- it's less aggressive, which means people are more likely to really listen to what you have to say. It also doesn't pretend to be an argument when it isn't. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: "More About Unicode in Python 2 and 3"

2014-01-06 Thread Devin Jeanpierre
, if a benefit of backporting things is an easier eventual migration to 3.x, it's killing two birds with one stone. At any rate it's not a possibility to sneer at and suggest is improbable or a waste of time. It is a rational outcome for a codebase of a large enough size. -- Devin -- http

Re: the Gravity of Python 2

2014-01-06 Thread Devin Jeanpierre
ould have to look up the callstack to see if its direct caller came from a module which enabled that future feature). I'm not sure there's anything that can't in principle be sort-of-sanely encoded as a __future__ feature though. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: the Gravity of Python 2

2014-01-06 Thread Devin Jeanpierre
On Mon, Jan 6, 2014 at 5:00 PM, Chris Angelico wrote: > On Tue, Jan 7, 2014 at 11:27 AM, Devin Jeanpierre > wrote: >> For example, I imagine that it is kind of _silly_ to have a >> __future__.disable_str_autoencoding on a per-module basis, because >> some modules'

Re: the Gravity of Python 2

2014-01-06 Thread Devin Jeanpierre
On Mon, Jan 6, 2014 at 6:00 PM, Chris Angelico wrote: > On Tue, Jan 7, 2014 at 12:55 PM, Devin Jeanpierre > wrote: >> What if we decide there is no single source of responsibility, and it >> can't be limited exactly to a module, and make a __future__ feature >> the b

Re: the Gravity of Python 2

2014-01-06 Thread Devin Jeanpierre
ppy that there's no way to enforce/test a polyglot conversion until it is complete. Any kind of granularity would have helped. :( -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Chanelling Guido - dict subclasses

2014-01-15 Thread Devin Jeanpierre
it is a directory. It can do it this way because it doesn't need to preserve the interleaved order of directories and files, but there's other solutions for you if you do want to preserve that order. (Although they won't be as clean as they would be in a language with ADTs) -- Devin

Re: Can post a code but afraid of plagiarism

2014-01-18 Thread Devin Jeanpierre
uring out who to punish, and discourages people from enabling cheaters. If one of their fellow students copied their assignment, they actually likely would be in trouble, and could be expelled or failed. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: regex multiple patterns in order

2014-01-20 Thread Devin Jeanpierre
uld ever match two, though. It'd match once as-is, or thrice if you make the repetition greedy (get rid of the ?s). >>> p = re.compile('((?:CAA)+?)((?:TCT)+?)((?:TA)+?)') >>> p.findall('CAACAACAATCTTCTTCTTCTTATATA') [('CAACAACAA', 'TCTTCTTCTTCT', 'TA')] -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: regex multiple patterns in order

2014-01-20 Thread Devin Jeanpierre
prevent you from doing > so? I don't see any way in which someone uncomfortable with the re module would magically find themselves perfectly at home with the regex module. The regex module is the re module with some extra features (and complexity), is it not? -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Early retirement project?

2014-01-21 Thread Devin Jeanpierre
mp;& make install). -- Devin On Tue, Jan 21, 2014 at 12:00 AM, wrote: > Well, I retired early, and I guess now I've got some spare time to learn > about programming, which always seemed rather mysterious. I am using an old > mac as my main computer, and it runs os x 10.4 is this t

Re: 1 > 0 == True -> False

2014-01-30 Thread Devin Jeanpierre
assume you don't have the function definition syntax memorized, and just define functions. And assume you don't know Python, so just hire someone else to write your code instead. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: __init__ is the initialiser

2014-02-02 Thread Devin Jeanpierre
on after the fact, but you'd want the memory to be unpageable before it has contents put in it, not after. Destroying memory is comparatively easy, as you say -- just make the object's internal state "invalid", rather than adding anything to the language. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: __init__ is the initialiser

2014-02-02 Thread Devin Jeanpierre
On Sun, Feb 2, 2014 at 5:37 PM, Chris Angelico wrote: > On Mon, Feb 3, 2014 at 12:24 PM, Devin Jeanpierre >> Destroying memory is comparatively easy, as you say -- just make the >> object's internal state "invalid", rather than adding anything to the >> langua

Re: Looking for ideas to improve library API

2015-11-26 Thread Devin Jeanpierre
Why not take ownership of the file object, instead of requiring users to manage lifetimes? -- Devin On Wed, Nov 25, 2015 at 12:52 PM, Chris Lalancette wrote: > Hello, > I'm currently developing a library called pyiso ( > https://github.com/clalancette/pyiso), used for manipul

Re: Looking for ideas to improve library API

2015-11-28 Thread Devin Jeanpierre
Documentation is all you can do. -- Devin On Thu, Nov 26, 2015 at 5:35 AM, Chris Lalancette wrote: > On Thu, Nov 26, 2015 at 7:46 AM, Devin Jeanpierre > wrote: >> Why not take ownership of the file object, instead of requiring users >> to manage lifetimes? > > Yeah, I&#

Re: is_ as method or property?

2014-12-11 Thread Devin Jeanpierre
ersus “non-callable attribute”? Obviously, yes. -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Portable code: __import__ demands different string types between 2 and 3

2014-12-15 Thread Devin Jeanpierre
in benefit of the u'...' syntax addition. For 3.2, you'll have to do b'...' for bytes, '...' for unicode, and str('...') for platform-specific strings (bytes on 2.x, unicode on 3.x). It is in good taste to make an alias of str so it's less confusin

Re: Portable code: ‘from __future__ import unicode_literals’ a good idea? (was: Portable code: __import__ demands different string types between 2 and 3)

2014-12-15 Thread Devin Jeanpierre
On Mon, Dec 15, 2014 at 4:42 PM, Ben Finney wrote: > Devin Jeanpierre writes: > >> On Sun, Dec 14, 2014 at 11:29 PM, Ben Finney >> wrote: >> > from __future__ import unicode_literals >> >> Ordinarily, for 2.x/3.3+ code I would suggest not doing

Re: pickle, modules, and ImportErrors

2015-01-07 Thread Devin Jeanpierre
em as my_svr.blahblah, then only the second set of imports are necessary. P.S. don't use import *, and if you do use import *, don't use more than one per file -- it makes it really hard to figure out where a given global came from (was it defined here? was it defined in model? was it defined in sampling?) I hope that resolves all your questions! -- Devin -- https://mail.python.org/mailman/listinfo/python-list

Re: Playing with threads

2015-01-07 Thread Devin Jeanpierre
r not grep succeeded -- so you can redirect stdout and stderr to os.devnull and avoid using .communicate(). Also, if you can't use .communicate(), but need to access stdout, this is the most common reason to need threads with subprocess. -- Devin On Wed, Jan 7, 2015 at 8:00 PM, Ganesh P

Decimals and other numbers

2015-01-08 Thread Devin Jeanpierre
0 ** 0 I'd file a bug report but I'm anticipating some rational (heh) explanation. Any ideas? Python 3.4 also raises this exception, but the error message is less informative. ("decimal.InvalidOperation: []"). -- Devin -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   >