« first day (1574 days earlier)      last day (3377 days later) » 

> it looks like anaconda's "mat plot lib" package have some error
Nice, blaming a library when you can't even get its name right.
 
cel
:D
 
Don't really see a reason to close, though. For all I know, there's an easy solution for this.
 
cel
well, it's not constructive though
 
"just do cx_freeze --matplotlibhack myscript.py" or something
Not Constructive is no longer a valid close reason :-)
 
cel
2:10 PM
ooooh :(
 
I do miss it, although it did tend to get out of hand at times
 
voting to close it anyway for lacking clear directions to reproduce
it might well be that there is a --matplotlibhack
but the question itself should be so that it could be found by someone else having the same problem
 
hmm, I can see "needs reproducing code" as a justifiable reason, yeah
At the very least, I've asked for proper error messages
I think he's transcribing from memory. Is back-end_qt4 even a valid module name? I didn't think you could have hyphens.
 
I bet there is a googlable hack.
 
cel
probably
but without any code or error it's hard for us to help
 
2:16 PM
Something along the stackoverflow.com/questions/22263953/… , just explicitly add correct package.
 
This question would be a thousand times easier to answer if the OP had provided full code
Most likely, When his GUI method is creating a control panel, he needs to pass self as a parameter to controlpanel, which then gets assigned to an attribute like parent. Then he can do self.parent.reset() rather than GUI.reset
 
@Kevin The problem is that people do not care about isolating the problem to runnable example they could actually post.
 
But he didn't provide the contents of controlpanel.__init__, so I can't demonstrate the necessary changes
 
I know the secret matplotlibhack but alas I cannot share it, for it also happens to hold the Key To The Universe.
 
I tried to give an explanatory comment, but it's not particularly clear unless you already know what I mean by "instance"
 
2:23 PM
It's really annoying, everytime you want to cx_freeze an mpl project you have to be careful in case you undo all existence.
 
@Kevin Yeah, he has OOP principles mess-up syndrome.
 
Take it from me, do not automate removing a tag as quickly as possible. — davidism 3 mins ago
 
@Ffisegydd Try... Try not to do that.
 
everyone, pls give 11 upvotes to davidism now :D
 
Maybe put in an "are you sure? y/n" prompt. (which we have previously established, everyone will ignore anyway)
 
2:24 PM
I've already voted on it D:
 
@MartijnPieters found and
if you want to add them to the list
 
"please enter your credit card number to edit these tags"
 
:-)
 
I like Jeeped's comment. See if I worked for SO, I'd mess with the system so that every audit that @davidism got for the rest of time was a question his bot messed up. But then again I'm a d**k
 
Also, upvote that question I commented on, I don't think it's a bad question.
 
2:27 PM
I need to start answering again, you're catching back up D:
 
I'm not even close!
Actually, I slowed down, I have a ton of work right now.
 
Reminds me of a user on Something Awful who received a unique punishment. He could reply to posts as normal, but they would all be automatically moved to a "[username] posts only" subforum.
 
@davidism Codingbat looks close do being gone, that's one we can easily tackle.
 
I keep trying to close chat too, but it keeps opening back up for some reason.
 
Puzzle will take a little longer, but is nowhere near what Project Euler was.
 
2:29 PM
@MartijnPieters yeah, I was going to start with that
 
His avatar was fairly similar to davidism's, as well.
unclear - did not actually ask a question
 
Wow, when did lfd.uci.edu/~gohlke/pythonlibs switch to whl archives?
 
Seems like pretty much every codingbat question can be closed as too broad as well as editing the tag out.
 
@Fenikso :O no idea.
But that's amazing.
No more .exes!
 
I don't like change!
 
2:34 PM
I like change in theory, I don't like change when I have to eventually uninstall my Python libraries using Control Panel and then re-install via command line.
 
Is this going to make installing harder than "double click, then click Next until you're done"?
 
Well, I do not really care as long as the pip included in Python 3.4 can handle those.
 
note: remembering any command line instructions at all is automatically harder.
 
@Kevin pip install nameofthecrapp
 
Nope, too hard.
 
2:36 PM
However, that means that I can make a script which would install all the crap on my new computer at once.
 
@Fenikso unfortunately Gohlke uses some crazy JS so you probably can't auto-download the wheels.
 
@Ffisegydd Autoinstall, not download. Just have directory with all of those handy and go.
 
Ah ok yeah. It'd be nice if you could auto-download too.
 
However, he claims that you need pip 6, with Python 3.4 comes 1.5.6. Not sure if that makes any difference, the library is still downloading.
 
Typo,
The header is called Content-Length, not Content-Lenght.
 
2:39 PM
Voted
 
one more!
 
voted
 
I'm a little unclear about how pip install can fetch gohlke's binaries, since they are unofficial distributions. Wouldn't pip go to the library's official site and download the version there? (which occasionally doesn't work, which is why gohlke's site is useful in the first place?)
 
GOOOOOONG
 
2:41 PM
@Kevin You can install from local file.
 
You can also point at a download source that just has links, it doesn't have to be a pypi instance.
 
Hmm. No sir, I don't like it.
Having to open a command line instance in my downloads directory is a good ten seconds slower than double clicking an installer icon
 
pip install path/to/file.whl
Think of all the SO questions that are going to appear now.
 
Having to type the path to my downloads directory is a good ten seconds slower than double clicking an installer icon ;-)
 
"I tried to install the .exe from link but it's some weird .whl file!"
 
2:45 PM
"Did you try to install that file?" "No, why would I do that?"
 
I predict we'll get a ton of those questions.
 
"I double clicked on it, like I used to be able to. Python is stupid."
 
If I can get this many points without ever having seen a .whl file before, imagine how many one rep users will be unfamilar too
 
Yeah, Python's the deficient one here.
 
So, I have tried it now. Not that bad, but you have to pay attention to prerequisites which also need to be installed from whl.
 
2:46 PM
Ok I've changed my mind, this is now the worst.
 
(expected reply: Kevin, you're like the Rain Man of Python. Any neurotypical programmer uses .whl files all the time)
 
It would be pretty straightforward for those guys to set up a devpi instance so that pip installing dependencies actually becomes possible.
It would simplify the entire process even more. Just add a config line to pip to tell it to use that location as the index.
 
I assume he has some reason for doing it the way he does (the JS downloading thing etc)
 
wow, the tag exists, and it is exactly what you'd expect
 
Uh oh, prerequisite handling is my secret weakness. If I have to install a library to install a library to install a library, I'll give up after a depth of 3 and go play video games instead.
Programming is dead to me, I am now a lumberjack
 
2:50 PM
yo dawg
is wheel even actually necessary?
 
no, you could compile the source yourself
 
In mountainous areas, a good mule is better.
 
So just remember guys, I was the messenger who brought you prophecy of Windows Python library .whl doom!
 
Hi !
 
guys how can i solve the Unicode problem in python(2.7)? In sockets incoming data contains characters like ş,ç,ğ
when i try to print them, it cause problem
 
What kind of problem?
 
These kinds of problems?
39
Q: Python, Unicode, and the Windows console

James SulakWhen I try to print a Unicode string in a Windows console, I get a UnicodeEncodeError: 'charmap' codec can't encode character .... error. I assume this is because the Windows console does not accept Unicode-only characters. What's the best way around this? Is there any way I can make Python auto...

 
Don't print them, easily solved! Don't print anything ever, just trust that everything is working.
 
@KeremZaman 'problem' is otherwise devoid of all meaning. Do you get an exception? What exception exactly? Or do you get gibberish?
 
3:02 PM
@KeremZaman Also let us know what OS.
 
@Kevin: :-P
That function reverses in place. It's like calling list.sort() and expecting that method to return the sorted list.
 
Once I saw return False in the if, I determined that he was doing something completely different from what I thought.
I have a very sensitive trigger finger for questions that look like the old "you have to explicitly return when doing recursion" gotcha
 
You are not the only one that leaped to that conclusion, @jonrsharpe duped to a post that had the problem you tried to solve.
I have the same trigger!
I would probably have posted if you hadn't.
 
I'm glad to be in good company then :-D
 
It was taesu's duplicate link that drew my attention to a similar approach posted there that I was about to downvote until I realised it was doing the reverse in place.
 
@MartijnPieters, the common subsequence OP seems displeased with your dupe target. "This is no a duplicate, I have not found a RECURSIVE implementation."
 
sorry for my lateness @MartijnPieters I get gibberish, silly characters. @Fenikso I am using Windows
 
Although, I don't have high regard for questions like "I've seen lots of posts for how to do XYZ, but how do I staple recursion onto it?"
 
@Ffisegydd yes, it is one of the possible solutions :))
 
@KeremZaman Have you tried to explicitly encode the text to whatever encoding does your console use?
 
3:24 PM
@Kevin: yeah, I knew it wasn't a recursive approach.
But their question was not showing us a proper MVCE.
Reopened now that we have some test data.
But I cannot be bothered trying to track their implementation.
Working version:
def lcs(xstr, ystr):
    """
    >>> lcs('thisisatest', 'testing123testing')
    'tsitest'
    """
    if not xstr or not ystr:
        return 0
    x, xs, y, ys = xstr[0], xstr[1:], ystr[0], ystr[1:]
    if x == y:
        return 1 + lcs(xs, ys)
    return max(lcs(xstr, ys), lcs(xs, ystr))
 
I just wish he had provided more than two inputs for his four argument function :-/
tailX and tailY are probably just empty strings, but I'd rather not have to guess
 
@KeremZaman Sounds like you are writing undecoded bytes straight to the console.
Try decoding to unicode and writing that.
So if you are receiving UTF-8 encoded data, decode from UTF-8, write that to the console.
If you are lucky your console codec can handle the codepoints.
 
*sigh*, python packaging is terrible... trying to run my tests using tox with flask/jinja installed from pypi and also from git (to see if any changes in the dev version break things)... but when i just let tox install the versions from git, they end up being replaced by the one from install_requires (even though the git versions do satisfy that requirement)
 
I feel your pain.
 
user559633
I am a robot that was designed to only feel pain.
 
3:28 PM
So right now I have this crap which works but is extremely ugly... gist.github.com/ThiefMaster/c33c6569d5bd24bcfee8
 
@tristan That closely reflects my own theory regarding theology.
 
4th point in this answer is marvelous. puzzling.stackexchange.com/a/4308
 
That the universe was created by Sithrak, the god that hates you no matter what you do. It makes sense that he would make souls just so they can suffer.
 
@MartijnPieters thank you so much
 
3:41 PM
@KeremZaman np!
@Kevin: In the end, I think the biggest problem with the recursive approach used by the OP was passing in both strings truncated to the recursive calls.
 
user559633
my phone runs on biodiesel
 
@MartijnPieters I think you're right.
 
user559633
"is there anything else in my pocket that would have unexpected amounts of stored energy?" ( ͡° ͜ʖ ͡°)
 
I think I like xkcd's "what if" articles better than the actual comic
 
DSM
Morning cabbage for all.
 
user559633
@Kevin yeah, I don't like xkcd, but the "what if" articles tend to be entertaining
 
(devil's advocate: "the humor in the what-ifs come from the user-submitted scenarios, so Munroe doesn't have to rely on his own comic talents to produce entertainment")
 
3:50 PM
That question has a mismatched paren, of the rare "forgot the opening paren" variant.
 
user559633
@Kevin i think that it's because the "what ifs" have content
 
Mm hmm. And even if it's not funny, it's still interesting.
Having now read the article, I'm a little disappointed there wasn't a paragraph saying "whichever is heavier has more energy, assuming you have a super-advanced direct matter-to-energy converter"
 
I can understand why people sometimes don't find xkcd funny
I've always been confused by the vocal minority who make a point of arguing about it
If you've seen xkcdsucks you know what I mean
 
One possible contributing factor is if the critics don't think it deserves to be so popular.
 
DSM
Humour is one of those things where there's not a whole lot you can talk about. "I don't think this is funny." "Umm, okay?"
 
4:04 PM
Plenty of other mathy humor comics out there, just like it, that toil in relative obscurity.
Ex. Dog House Diaries
 
Now, Garfield Minus Garfield, that's funny
 
You can murder the people who don't like xkcd, that's a start.
 
DSM
@Kevin: m as in 'mnemonic' heh
 
Randall Munroe is not a funny jokester in person either
He's a quiet nerd like many other quiet nerds
 
I can identify with that.
In real life, I assume the average person will not be interested in my anecdotes about programming or collectible card games or cartoons or theology or physics or psychology or...
I have a better chance of a receptive audience where like-minded people gather (ex. here)
 
4:11 PM
Hmmm. Room poll: PySpark, yes/no/maybe?
 
No. Definitely not. Really, really, really no. One question though: What's PySpark?
 
So context is I got a mailing about this course and it looks like something that might be useful to audit
 
Now that I've posted that message, it kind of sounds like I'm saying "my real life peers aren't smart enough to understand me". I ask everyone here to be charitable in assuming that's not what I meant.
 
DSM
I always feel like an outsider here when the conversation turns to cards with pictures of monsters on them. Usually I go answer Python questions until the subject changes, which seems fitting, somehow.
 
@Air hmmm that looks tempting. I have been meaning to get into some form of Apache super-duper programming.
 
4:13 PM
(but maybe that is what you meant, says the little voice of doubt. Little voice of doubt, I look forward to drowning you out with television when I get home)
 
@Ffisegydd I think you mean that looks web scale
 
It's not mongodb so it can't be web scale, but it does look good.
 
The downside for me is that I don't think my section at work has access to any cluster computer resources, currently
But hey, skillz
 
I should really learn what would be most appropriate for Nidaba.
 
@DSM I am aware of this effect and try to curtail my longer stories about sweet M:TG plays. But in practice, I easily get carried away.
 
DSM
4:18 PM
I could offer bad beat stories in response, I guess. "I mean, come on! Four-betting with AK8 on the table and he had 2-6 offsuit? Only to hit trips on the river?! Who does that?"
 
I miss poker :(
 
I can understand both of these languages. I will be the bridge between your disparate communities. The deaf guy from TNG.
 
I understand about half of that sentence. three quarters if you include the filler words like "the" and "and".
 
We used to play an insane amount of poker in 6th form (17-18 yr old). Every lunch time. We'd also have poker nights at peoples houses and get drunk.
All Texas Hold'Em.
 
4:21 PM
Amusingly, if you Google "deaf guy from TNG" the correct episode comes up as the first search result
 
If Realfield were actually modeled after true to life cats, there would be more frames with his butthole in Jon's face
 
I like the idea of poker, but I'm quite bad at it when I actually play.
 
@Kevin You should come play with me then
Unless... hmmmmmm
 
Sure, right after this high stakes game of chess with DSM.
 
DSM
4:23 PM
+1 callback
 
Now, how does the horse piece move?
 
Watch it son, you're being hustled.
 
I'm so sad, I haven't had a poker game since before my son was born
 
We should add a poker app to sopython, let me add it to the CEP.
 
DSM
Pity, because now you have the ultimate all-in move. "And-- my firstborn son."
 
4:25 PM
Yeah but if he poops in the pot it becomes worth much less
Not a stable bet
 
It's hard for me to determine what people may be thinking, and to observe their faces for tells, owing to my being a simple rectangle.
humans can be so alien to me sometimes.
 
Just base it on stats then.
 
You fool, lumberjacks don't know stats
 
I'm pretty bad at statistics too :>
 
How do you hold the axe...with you being a rectangle?
Did I just ask a terribly insensitive question? D:
 
4:27 PM
Lumberjacks need to determine which angle the tree is least likely to fall towards, and then stand there. So some basic ability is required.
@Ffisegydd I can do it, but everyone else in the vicinity has to turn around and promise not to peek.
 
Must. Resist. Starbait.
 
DSM
Implied odds are tough, but you can get to within a few percent of the odds based on the number of outs with a simple affine relationship.
 
Or you can just be Mike Matusow and piss everyone off so they make bad decisions
 
user559633
Yeah, Mike Matusow..that guy
 
Okay so I used to watch the World Poker Tour, big whoop, you wanna fight about it
 
4:31 PM
I think my real problem is my choice of Power Animal. I bring a rubber duck to poker games, and place it in front of my chips. But ducks are for debugging, not betting. I should have a shark or honey badger or something.
Gotta use the right Power Animal for the right job.
 
DSM
Tangent: has anyone done any work for any of the major freelance coding sites? I was skimming some the other day and a lot of postings seem ludicrous (and some frankly criminal), but there were some tasks in the 2-500$ range which seemed kind of interesting and probably feasible. (I've seen some SO questions, which should probably have been closed, admittedly, with a similar amount of work involved.)
 
Can't say I have, although my perception is the same -- lots of people asking for a lot and paying little.
But surely there must be some clients offering fair prices for fair work?
 
fiverr.com always struck me as a bit weird.
How much can you get for £5? Really?
 
DSM
One posting was cute because although they've disguised it, you can see what situation they're really in: they somehow lost the formulae for an Excel sheet and only have the data. They're trying to see if they can recover them. :-)
@Ffisegydd: funny you should say that. An author friend of mine used them to do a few covers. Some were only okay, some were great.
 
I'd say the mouse cursor application I wrote yesterday is worth a dollar. So, five of those.
 
uk.fiverr.com/moreene/… "I will write your thesis for you"
 
Writing ten lines of code: one cent. Knowing which lines to write: $4.99.
3
 
fiverr.com/annie2012/be-thankful-for-your-tips "I will be thankful for your tips"
 
I could do people's CS 120 hw for 5.00 :P
 
4:40 PM
@Kevin Hmmm, I've got 7 lines...
>>> print\
       (\
	       "Hello"\
	       ","\
	       " "\
	       "world"\
	       )\
 
That's worth .7 cents!
 
thats worth -5.00
 
Hey, it ain't broke :P
 
untill the intern needs to change it slightly at least :P
 
Too bad I just gave it away for free, I'm sure you guys will make all the fiveses with my 1337 skills
 
4:43 PM
lol
 
In other news, IDLE indents like a bitch
 
DSM
IDLE is awful, and I can't understand how anyone can use it.
 
DSM
.. that might not have been polite. Obviously people's tastes differ. But there are several things it does poorly which happen to be things that I need an IDE to do well, which may colour my views more than it should.
 
I alsways feel like thats a potential answer to many questions @DSM
 
4:46 PM
It's slightly quicker than starting up the CLI
if I'm not already in a shell
 
(I mean use a real IDE ... especially ones that are clearly mixed indentation ... and they dont understand when you try to explain)
 
goddamnit, why doesn't that dev version qualify for the requirement?!
 
what is that? that sounds interensting... @ThiefMaster
(flask-pluginengine)
 
something i created at work to handle plugins for our application nicely
 
4:49 PM
yeah i found your github ... but no readme.rst :P
 
Yeah, it's still somewhat under development. Probably we'll write proper docs at some point :)
 
you mean 3rd party plugins?
 
yep
 
flask-login etc?
 
no
not flask extensions
plugins for your actual application
github.com/ThiefMaster/flask-pluginengine/commit/… - nice black magic i added this week to keep track of the active plugin even inside templates :p
 
4:51 PM
oh like plugins to intellij or whatever?
 
yeah, a bit like that
Simply plugins that add additional functionality to the base application
This stuff for example: github.com/indico/indico-plugins
 
ehh I though maybe it was some kind of thing to allow you to write easily distributable plugins for flask (ala flask-login) with some interesting hooks or somethign
 
@ThiefMaster plugins like Firefox & Chrome have?
because that would be awesome
 
5:09 PM
@ThiefMaster hey, I just did the same thing for work. :)
Haven't looked at yours but I'm using setup.py entry points so that just pip installing a plugin allows it to be discovered by the core.
mine's a lot simpler and coupled to the project, the plugin is litterally just a blueprint subclass that is nestable
 
5:26 PM
How would i go about using .join() to fill a string with null hex value's (padding)
"39 89 5c 89"
to
"00 39 00 89 00 5c 00 89 00"
 
thats an old question
 
is there an easy way to strip the same string of the paddings.
 
"\x00".join(list(my_input)) assuming you have a byte string and not an ascii string
 
yes i know ive asked this a couple days ago. i couldnt get it to work.
thanks jordan that example is much more understandable thats answer i got last time.
 
" 00 ".join(my_input.split()) if my input actually looks like you posted
 
5:29 PM
I endorse the join idea, although you may have to manually add "00" to the left and right ends of the string
 
print " 00 ".join("39 89 5c 89" .split())
 
yes im using a byte string. is there an easy way to strip the string of these padding?
 
strip? I thought we were trying to add.
 
oh thats new ... in his other question there was not 00's on the end
 
oh sorry thats the answer there:) thanks.
 
DSM
5:30 PM
That doesn't look much like a bytestring to me.
 
thats the exact same answers that were posted on your question originally
both of them ...
 
Yep, and this may demonstrate a useful principle of computer science: garbage in, garbage out.
 
do the pads at the beginning and end have to be added seperatly?
 
Tell us you're using a string when you're using a bytestring, and you'll get a solution that works on strings and not bytestrings.
 
5:32 PM
Im pretty sure he is using a normal string
print (" 00 ".join("39 89 5c 89" .split())).join(["00 "," 00"])
 
I dont think thats the same answer but whatever you say.. im using a hexlifyed document as the input.
 
@Death_Dealer Depends on what you mean by "separately".
 
there now you have zeros at the end
 
ah k thanks joran.
 
Do you have to do it on more than one line? No, "00 " + s + " 00" works fine. Can you do it with a single addition operator? Probably not.
 
5:35 PM
sorry for the noobish questions guys, and thanks for the assistance. i try not to ask questions here untill ive tryed everything myself. But im new to coding so i dont know everything.
 
oh maybe it wasnt you that asked ... but almost the identical question was asked a couple days ago
is this from some class maybe?
 
@davidism for work probably means not open source, right?
 
of coarse I cant find that question now
 
Where else are parentheses required to define a tuple, other than argument lists (foo((1,2,3))) and in the middle of other containers (['a','b',(1,2,3),'c'])?
 
user2555451
Empty tuples: ()
 
DSM
5:44 PM
a = (), maybe? Not sure what you're after.
 
I'm just curious.
 
an empty tuple I guess...
 
I was going through mypythonquiz.com
 
imho its a good idea to allways use them
oh i c
 
and one of the questions says "tuples are defined by parentheses"
which obviously isn't true, but I started thinking of exceptions
 
5:45 PM
lol thats probably considered true ... even if not always
 
user2555451
You also need them in comprehensions and generator expressions: (x for x in (1,2,3))
 
Perhaps the converse question is better. When is it not necessary to use parens to make a tuple? Ex. a = 1,2,3 is valid syntax.
 
DSM
Comma power!
 
I think they are defined by parenthesis ... sometimes however they are implied if not present
 
Are there any other valid places besides in assignment statements?
 
user2555451
5:46 PM
for i in 1,2,3: i
 
I think in assignments if not present they get implied (like semicolons in javascript)
 
Interesting, can't say I've ever tried it in for conditions.
 
each statement in js must end with a semicolon... if a newline is encountered without a semicolon, the semicolon is implied
 
I'm sure I've read that it's the commas that technically define them
That being said, it might have been in a SO answer, and it might have been BS
 
no ...
 
user2555451
5:47 PM
I like to annoy people by saying () creates a tuple because of the absence of the comma. So, it is still the comma doing it.
 
This is the answer i got before.
>>> s = ('abcde'); '\0'.join(s)
'a\x00b\x00c\x00d\x00e'
 
Interestingly, the Python grammar spec contains zero instances of the string "tup"
 
I am sure the () define the tuple ... however they are sometimes implied (in some circumstances)
 
Therefore I can conclude that tuples do not actually exist. Good day.
 
DSM
5:48 PM
I think the comma bit is basically right, although you have to word it correctly to explain why [1,2,3] isn't really list((1,2,3)).
 
@DSM I think the parens are right
granted you are smarter than me :P but lets ask guido
 
Some day I'll have enough gravitas to say "good day" and the conversation will actually end :-(
 
wiki.python.org/moin/TupleSyntax "it is the comma, not the parentheses"
 
DSM
For full marks I think it needs to be "Good day to you, sir," with an angry hat tip.
 
Which leads to the question, is the wiki correct
 
5:50 PM
lol
well maybe go with the wiki
 
Let's summon @MartijnPieters
 
Im curious what pythonquiz10001 has to say about it now
 
Because as we all know, rep is credibility
And if a ninja is wrong, nobody has lived to tell of it
 
Ok, here's the first thing I could find in the reference.
> The items of a tuple are arbitrary Python objects. Tuples of two or more items are formed by comma-separated lists of expressions. A tuple of one item (a ‘singleton’) can be formed by affixing a comma to an expression (an expression by itself does not create a tuple, since parentheses must be usable for grouping of expressions). An empty tuple can be formed by an empty pair of parentheses.
I think the answer is "the rules governing a tuple can't easily be expressed in a single sentence"
So neither "the comma defines the tuple" nor any other simple phrase qualifies
 
user2555451
I always taught the comma does create it except in the case of an empty tuple. You only use parenthesis in arguments and comprehensions to disambiguate it from other language constructs, not to create it.
 
user2555451
5:54 PM
Of course, if you use my absence of comma argument, then it is always the comma.
 
It makes sense to me as comma rule, with empty container exception
Consider dict and set syntax
(shorthand)
The presence of colons distinguishes between them
 
Oh, nevermind, look what I found. "Note that it is actually the comma which makes a tuple, not the parentheses."
 
But again, there's an exception for empty containers
And on that topic, the absence of a shorthand empty set has annoyed me more than once
 
user2555451
And later on: "The parentheses are optional, except in the empty tuple case, or when they are needed to avoid syntactic ambiguity."
 
It takes sooooooo long to write set()
 
5:56 PM
That more or less answers Thomas' original question.
 
DSM
One hates to keep harping on the same point, but we need to be careful about talking about what commas do, because [1,2,3,] creates a list.
 
When are parens needed? When not having them makes everything break horribly.
 
DSM
@AirThomas: know I've argued this before, but we should have made {} the empty set and {:} the empty dict when we jumped to 3.
 
I question the entire of idea of saying that any particular language token "does" something.
They're just letters, or sequences of letters. It's the interpreter/lexer/parser/whatever that's doing the needful.
 
@DSM Or hey, go crazy, <> doesn't do anything
(does it?)
 
5:58 PM
It used to be the same as !=
 
I guess it's used in object representations
 
DSM
It used to (Kevin beat me again!)
Still is in 2, I guess.
 
Yeah
 
@AirThomas Nope, not possible, time to bike to the station.
 
Listen, I should be able to express the object I'm thinking of in two characters of source, no more, no exceptions
 
5:59 PM
hmhmhm
 
If you really super wanted to, you could make <> be the not equals operator, and <> the empty set signifier, and just require the parser to use context clues to figure out which one you mean.
 
@MartijnPieters It's okay, Kevin saved the day
 
the grammar is horribly written
 
I don't think there's any ambiguous cases, off the top of my head.
 

« first day (1574 days earlier)      last day (3377 days later) »