Skip to content

Commit fe25ed4

Browse files
tdp2110braxtonmckee
authored andcommitted
StringType.cpp: remove using namespace std directive
As demonstrated in the previous commit, and as a general principle, the `using namespace std` directive can lead to surprising results and is not generally recommended. Remove it to avoid further similar bugs in the future.
1 parent 9e8dec4 commit fe25ed4

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

typed_python/MutuallyRecursiveTypeGroup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
bool isCanonicalName(std::string name) {
2020
// this is the list of standard library modules in python 3.8
21-
static std::set<string> canonicalPythonModuleNames({
21+
static std::set<std::string> canonicalPythonModuleNames({
2222
"abc", "aifc", "antigravity", "argparse", "ast", "asynchat", "asyncio", "asyncore",
2323
"base64", "bdb", "binhex", "bisect", "_bootlocale", "bz2", "calendar", "cgi", "cgitb",
2424
"chunk", "cmd", "codecs", "codeop", "code", "collections", "_collections_abc",
@@ -71,7 +71,7 @@ bool isCanonicalName(std::string name) {
7171
// is this a special name in a dict, module, or class that we shouldn't hash?
7272
// we do want to hash methods like __init__
7373
bool isSpecialIgnorableName(const std::string& name) {
74-
static std::set<string> canonicalMagicMethods({
74+
static std::set<std::string> canonicalMagicMethods({
7575
"__abs__", "__add__", "__and__", "__bool__",
7676
"__bytes__", "__call__", "__contains__", "__del__",
7777
"__delattr__", "__eq__", "__float__", "__floordiv__",

typed_python/StringType.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "AllTypes.hpp"
1818
#include <iostream>
1919
#include "UnicodeProps.hpp"
20-
using namespace std;
2120

2221
StringType::layout* StringType::upgradeCodePoints(layout* lhs, int32_t newBytesPerCodepoint) {
2322
if (!lhs) {

0 commit comments

Comments
 (0)